61 const LatticeTiling *semi_tiling,
62 const UINT4 freq_partitions,
63 const UINT4 f1dot_partitions
72 WeaveSearchIterator *itr =
XLALCalloc( 1,
sizeof( *itr ) );
86 GAVEC_NULL( itr->semi_rssky, itr->ndim );
90 itr->partition_count = f1dot_partitions;
91 itr->partition_index = 0;
97 itr->partition_max =
stats->max_points;
98 itr->partition_size = 1 + ( itr->partition_max - 1 ) / itr->partition_count;
102 itr->repetition_count = freq_partitions;
103 itr->repetition_index = 0;
118 WeaveSearchIterator *itr
123 GFVEC( itr->semi_rssky );
132 const WeaveSearchIterator *itr,
161 WeaveSearchIterator *itr,
193 WeaveSearchIterator *itr,
197 const gsl_vector **semi_rssky,
200 UINT4 *repetition_index
210 *iteration_complete = 0;
219 if ( itr_retn == 0 ) {
222 ++itr->partition_index;
223 if ( itr->partition_index == itr->partition_count ) {
224 itr->partition_index = 0;
227 ++itr->repetition_index;
228 if ( itr->repetition_index == itr->repetition_count ) {
231 *iteration_complete = 1;
248 if ( itr->partition_count > 1 ) {
249 INT4 current_left = 0, current_right = 0;
251 const UINT4 current_max = current_right - current_left + 1;
253 const UINT4 current_index = -current_left / itr->partition_size;
255 if ( current_index != itr->partition_index ) {
270 *semi_rssky = itr->semi_rssky;
272 *repetition_index = itr->repetition_index;
282 const WeaveSearchIterator *itr
290 return GSL_MAX( 0.0, GSL_MIN( ( (
double ) itr->prog_index ) / itr->prog_count, 1.0 ) ) * 100.0;
299 const WeaveSearchIterator *itr,
300 const REAL8 elapsed_time
308 return elapsed_time * ( itr->prog_count - itr->prog_index ) / itr->prog_index;
int XLALFITSHeaderWriteUINT4(FITSFile UNUSED *file, const CHAR UNUSED *key, const UINT4 UNUSED value, const CHAR UNUSED *comment)
int XLALFITSHeaderWriteUINT8(FITSFile UNUSED *file, const CHAR UNUSED *key, const UINT8 UNUSED value, const CHAR UNUSED *comment)
int XLALFITSHeaderReadUINT8(FITSFile UNUSED *file, const CHAR UNUSED *key, UINT8 UNUSED *value)
int XLALFITSHeaderReadUINT4(FITSFile UNUSED *file, const CHAR UNUSED *key, UINT4 UNUSED *value)
int XLALWeaveSearchIteratorNext(WeaveSearchIterator *itr, BOOLEAN *iteration_complete, BOOLEAN *expire_cache, UINT8 *semi_index, const gsl_vector **semi_rssky, INT4 *semi_left, INT4 *semi_right, UINT4 *repetition_index)
Advance to next state of iterator.
REAL8 XLALWeaveSearchIteratorProgress(const WeaveSearchIterator *itr)
Return progress of iterator as a percentage.
void XLALWeaveSearchIteratorDestroy(WeaveSearchIterator *itr)
Destroy iterator.
int XLALWeaveSearchIteratorSave(const WeaveSearchIterator *itr, FITSFile *file)
Save state of iterator to a FITS file.
WeaveSearchIterator * XLALWeaveMainLoopSearchIteratorCreate(const LatticeTiling *semi_tiling, const UINT4 freq_partitions, const UINT4 f1dot_partitions)
Create iterator over the main loop search parameter space.
REAL8 XLALWeaveSearchIteratorRemainingTime(const WeaveSearchIterator *itr, const REAL8 elapsed_time)
Return estimate of time remaining for iteration to complete, assuming a equal dstribution in computat...
int XLALWeaveSearchIteratorRestore(WeaveSearchIterator *itr, FITSFile *file)
Restore state of iterator from a FITS file.
Module which implements iterators over search parameter spaces.
struct tagFITSFile FITSFile
Representation of a FITS file.
void * XLALCalloc(size_t m, size_t n)
size_t XLALTotalLatticeTilingDimensions(const LatticeTiling *tiling)
Return the total number of dimensions of the lattice tiling.
UINT8 XLALTotalLatticeTilingPoints(const LatticeTilingIterator *itr)
Return the total number of points covered by the lattice tiling iterator.
int XLALSaveLatticeTilingIterator(const LatticeTilingIterator *itr, FITSFile *file, const char *name)
Save the state of a lattice tiling iterator to a FITS file.
int XLALLatticeTilingDimensionByName(const LatticeTiling *tiling, const char *bound_name)
Return the index of the lattice tiling dimension which has the given name.
UINT8 XLALCurrentLatticeTilingIndex(const LatticeTilingIterator *itr)
Return the index of the current point in the lattice tiling iterator.
int XLALRestoreLatticeTilingIterator(LatticeTilingIterator *itr, FITSFile *file, const char *name)
Restore the state of a lattice tiling iterator from a FITS file.
LatticeTilingIterator * XLALCreateLatticeTilingIterator(const LatticeTiling *tiling, const size_t itr_ndim)
Create a new lattice tiling iterator.
void XLALDestroyLatticeTilingIterator(LatticeTilingIterator *itr)
Destroy a lattice tiling iterator.
int XLALNextLatticeTilingPoint(LatticeTilingIterator *itr, gsl_vector *point)
Advance lattice tiling iterator, and optionally return the next point in point.
int XLALCurrentLatticeTilingBlock(const LatticeTilingIterator *itr, const size_t dim, INT4 *left, INT4 *right)
Return indexes of the left-most and right-most points in the current block of points in the given dim...
const LatticeTilingStats * XLALLatticeTilingStatistics(const LatticeTiling *tiling, const size_t dim)
Return statistics related to the number/value of lattice tiling points in a dimension.
int XLALResetLatticeTilingIterator(LatticeTilingIterator *itr)
Reset an iterator to the beginning of a lattice tiling.
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_REAL8(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
Statistics related to the number/value of lattice tiling points in a dimension.
Iterator over a search parameter space.
UINT4 partition_size
Number of points in each partition.
UINT4 partition_count
Number of partitions of iterator output.
UINT4 partition_max
Maximum number of points in the partitioned dimension.
UINT4 partition_index
Index of the current iterator output partition.
UINT4 repetition_count
Number of times to repeat iteration over semicoherent parameter space.
UINT8 prog_index
Progress index for iteration.
gsl_vector * semi_rssky
Current lattice tiling point.
UINT8 prog_count
Progress count for iteration.
LatticeTilingIterator * semi_itr
Iterator over semicoherent parameter space.
UINT4 repetition_index
Index of the current repetition.
size_t ndim
Number of parameter-space dimensions.
int partition_dim
Dimension in which to partition iterator output.