Commit 87ef9802 authored by Karl Wette's avatar Karl Wette

LatticeTiling: re-enable and require extra padding for rapidly-changing bounds

- This reverts commit e8ce37ada3e86428195def9423a53472ee9ad4ce
- Remove LATTICE_TILING_PAD_EXTRA flag from LatticeTilingPaddingFlags enum
- Optimise LT_FindBoundExtrema() to avoid extra call to LT_SetPhysPoint()
Original: 1b304a7fc56e46b47b731a766b9ddd4c4850e00a
parent c4bc7663
......@@ -275,37 +275,23 @@ static void LT_FindBoundExtrema(
return;
}
// Original value of physical point in this dimension
// Sample parameter-space bounds at +/0/- half the lattice tiling step size
const double phys_point_i = gsl_vector_get( phys_point, i );
// Sample parameter-space bounds at offset 'x' from original physical point
#define LT_FindBoundExtrema_SAMPLE_BOUNDS(x) { \
LT_SetPhysPoint( tiling, phys_point_cache, phys_point, i, phys_point_i + (x) ); \
double phys_lower = *phys_lower_minimum; \
double phys_upper = *phys_upper_maximum; \
LT_FindBoundExtrema( tiling, i + 1, dim, phys_point_cache, phys_point, &phys_lower, &phys_upper ); \
*phys_lower_minimum = GSL_MIN( *phys_lower_minimum, phys_lower ); \
*phys_upper_maximum = GSL_MAX( *phys_upper_maximum, phys_upper ); \
}
// Sample parameter-space bounds at original physical point
LT_FindBoundExtrema_SAMPLE_BOUNDS( 0 );
if ( bound->padf & LATTICE_TILING_PAD_EXTRA ) {
// Sample parameter-space bounds at +/- half the lattice tiling step size
const double phys_hstep_i = 0.5 * gsl_matrix_get( tiling->phys_from_int, i, i );
LT_FindBoundExtrema_SAMPLE_BOUNDS( -phys_hstep_i );
LT_FindBoundExtrema_SAMPLE_BOUNDS( +phys_hstep_i );
const double phys_hstep_i = 0.5 * gsl_matrix_get( tiling->phys_from_int, i, i );
const double phys_point_sample_i[] = {
phys_point_i - phys_hstep_i,
phys_point_i + phys_hstep_i,
phys_point_i // Must be last to reset physical point to original value
};
for ( size_t j = 0; j < XLAL_NUM_ELEM( phys_point_sample_i ); ++j ) {
LT_SetPhysPoint( tiling, phys_point_cache, phys_point, i, phys_point_sample_i[j] );
double phys_lower = *phys_lower_minimum;
double phys_upper = *phys_upper_maximum;
LT_FindBoundExtrema( tiling, i + 1, dim, phys_point_cache, phys_point, &phys_lower, &phys_upper );
*phys_lower_minimum = GSL_MIN( *phys_lower_minimum, phys_lower );
*phys_upper_maximum = GSL_MAX( *phys_upper_maximum, phys_upper );
}
// Clear macro LT_FindBoundExtrema_SAMPLE_BOUNDS()
#undef LT_FindBoundExtrema_SAMPLE_BOUNDS
// Reset physical point in this dimension to original value
LT_SetPhysPoint( tiling, phys_point_cache, phys_point, i, phys_point_i );
}
///
......
......@@ -74,7 +74,6 @@ typedef enum tagLatticeTilingPaddingFlags {
LATTICE_TILING_PAD_UHBBX = 0x02, ///< Add half-bounding-box padding to upper physical parameter-space bounds
LATTICE_TILING_PAD_LINTP = 0x04, ///< Add integer point padding to lower integer parameter-space bounds
LATTICE_TILING_PAD_UINTP = 0x08, ///< Add integer point padding to upper integer parameter-space bounds
LATTICE_TILING_PAD_EXTRA = 0x10, ///< Add extra padding for rapidly-changing bounds
LATTICE_TILING_PAD_MAX = 0x20,
} LatticeTilingPaddingFlags;
......
......@@ -2559,11 +2559,6 @@ int XLALSetSuperskyRangeBounds(
XLAL_CHECK( XLALSetLatticeTilingConstantBound( tiling, j, gsl_vector_get( min_rssky, j ), gsl_vector_get( max_rssky, j ) ) == XLAL_SUCCESS, XLAL_EFUNC );
}
// Add to the parameter-space padding control flags for all coordinates
for ( size_t j = 0; j < n; ++j ) {
XLAL_CHECK_MAIN( XLALAddLatticeTilingPaddingFlags( tiling, j, LATTICE_TILING_PAD_EXTRA ) == XLAL_SUCCESS, XLAL_EFUNC );
}
return XLAL_SUCCESS;
}
......
......@@ -812,12 +812,12 @@ int main( void )
XLAL_CHECK_MAIN( MismatchSquareTest( TILING_LATTICE_ANSTAR, 1e-4, -2e-9, 2e-17, 20268, A3s_mism_hist ) == XLAL_SUCCESS, XLAL_EFUNC );
// Perform mismatch tests with an age--braking index parameter space
XLAL_CHECK_MAIN( MismatchAgeBrakeTest( TILING_LATTICE_ANSTAR, 100, 4.0e-5, 37868, A3s_mism_hist ) == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN( MismatchAgeBrakeTest( TILING_LATTICE_ANSTAR, 100, 4.0e-5, 37870, A3s_mism_hist ) == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN( MismatchAgeBrakeTest( TILING_LATTICE_ANSTAR, 200, 1.5e-5, 37230, A3s_mism_hist ) == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN( MismatchAgeBrakeTest( TILING_LATTICE_ANSTAR, 300, 1.0e-5, 37022, A3s_mism_hist ) == XLAL_SUCCESS, XLAL_EFUNC );
// Perform a variety of tests with the reduced supersky parameter space and metric
XLAL_CHECK_MAIN( SuperskyTests( 5241516, 770802, 527943, 24586791553 ) == XLAL_SUCCESS, XLAL_EFUNC );
XLAL_CHECK_MAIN( SuperskyTests( 6886488, 1050134, 932765, 26063227993 ) == XLAL_SUCCESS, XLAL_EFUNC );
return EXIT_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment