Commit b586923c authored by Karl Wette's avatar Karl Wette
Browse files

make internal FlatLatticeTiling structures opaque

- these shouldn't really be accessible fro external code,
  so move the structure definitions inside FlatLatticeTiling.c,
  and replace the enum with an opaque 'int'.
- this breaks some debugging code in testFlatLatticeTilingPulsar.c,
  commented out until a better fix can be found.
Original: e89a3734ca61a6790b207e397e8ab4624b31c521
parent e6fb797c
......@@ -55,43 +55,12 @@ typedef BOOLEAN (*FlatLatticeTilingBoundFunc)(
typedef void (*FlatLatticeTilingBoundFree)(
void *data /**< Arbitrary data describing parameter space */
);
typedef struct tagFlatLatticeTilingBound {
/* Number of bound dimensions */
INT4 dimensions;
/* Dimensions which are bound */
UINT8 is_bound;
/* Parameter space bound function */
FlatLatticeTilingBoundFunc func;
/* Arbitrary data describing parameter space */
void *data;
/* Cleanup function */
FlatLatticeTilingBoundFree free;
} FlatLatticeTilingBound;
typedef struct tagFlatLatticeTilingBound FlatLatticeTilingBound;
/**
* Flat lattice tiling subspace
*/
typedef struct tagFlatLatticeTilingSubspace {
/* Total number of tiled (non-flat) dimensions */
INT4 dimensions;
/* Dimensions which are tiled (non-flat) */
UINT8 is_tiled;
/* Padding of bounds along each dimension */
gsl_vector *padding;
/* Increment vectors of the lattice tiling generator */
gsl_matrix *increment;
} FlatLatticeTilingSubspace;
typedef struct tagFlatLatticeTilingSubspace FlatLatticeTilingSubspace;
/**
* Flat tiling lattice generator
......@@ -103,14 +72,8 @@ typedef int (*FlatTilingLatticeGenerator)(
);
/**
* State of the flat lattice tiling algorithm
* Flat lattice tiling state/input structure
*/
typedef enum tagFlatLatticeTilingState {
FLT_S_NotInitialised,
FLT_S_NotStarted,
FLT_S_InProgress,
FLT_S_Finished
} FlatLatticeTilingState;
typedef struct tagFlatLatticeTiling {
/* Dimension of the parameter space */
......@@ -162,7 +125,7 @@ typedef struct tagFlatLatticeTiling {
UINT4 count;
/* State of the tiling */
FlatLatticeTilingState state;
int state;
} FlatLatticeTiling;
......
......@@ -56,6 +56,61 @@ NRCSID(FLATLATTICETILINGC, "$Id$");
#define UNUSED
#endif
/********** Structures and Enumerations **********/
/**
* Flat lattice tiling bound
*/
struct tagFlatLatticeTilingBound {
/* Number of bound dimensions */
INT4 dimensions;
/* Dimensions which are bound */
UINT8 is_bound;
/* Parameter space bound function */
FlatLatticeTilingBoundFunc func;
/* Arbitrary data describing parameter space */
void *data;
/* Cleanup function */
FlatLatticeTilingBoundFree free;
};
/**
* Flat lattice tiling subspace
*/
struct tagFlatLatticeTilingSubspace {
/* Total number of tiled (non-flat) dimensions */
INT4 dimensions;
/* Dimensions which are tiled (non-flat) */
UINT8 is_tiled;
/* Padding of bounds along each dimension */
gsl_vector *padding;
/* Increment vectors of the lattice tiling generator */
gsl_matrix *increment;
};
/**
* State of the flat lattice tiling algorithm
*/
enum {
FLT_S_NotInitialised,
FLT_S_NotStarted,
FLT_S_InProgress,
FLT_S_Finished
};
/********** Functions **********/
/**
* Create a new flat lattice tiling bound structure
*/
......
......@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
CHAR *output_file = NULL;
REAL8 scale_padding = 0;
int i, j;
int i;
UINT4 k;
VeryBasicXMLOutput xml = empty_VeryBasicXMLOutput;
int spaces = 0;
......@@ -302,22 +302,22 @@ int main(int argc, char *argv[]) {
XLAL_VBXMLO_EndTag(&xml, "tiling");
/* Output subspaces */
XLAL_VBXMLO_BeginTag(&xml, "subspaces");
for (i = 0; i < tiling->num_subspaces; ++i) {
XLAL_VBXMLO_BeginTag(&xml, "subspace");
XLAL_VBXMLO_Tag(&xml, "dimensions", "%i", tiling->subspaces[i]->dimensions);
XLAL_VBXMLO_BeginTag(&xml, "is_tiled");
XLAL_VBXMLO_Indent(&xml);
for (j = 0; j < tiling->dimensions; ++j) {
XLAL_VBXMLO_Printf(&xml, "%c", GET_BIT(UINT8, tiling->subspaces[i]->is_tiled, j) ? 'Y' : 'N');
}
XLAL_VBXMLO_Printf(&xml, "\n");
XLAL_VBXMLO_EndTag(&xml, "is_tiled");
XLAL_VBXMLO_gsl_vector(&xml, "padding", "%0.12g", tiling->subspaces[i]->padding);
XLAL_VBXMLO_gsl_matrix(&xml, "increment", "%0.12g", tiling->subspaces[i]->increment);
XLAL_VBXMLO_EndTag(&xml, "subspace");
}
XLAL_VBXMLO_EndTag(&xml, "subspaces");
/* XLAL_VBXMLO_BeginTag(&xml, "subspaces"); */
/* for (i = 0; i < tiling->num_subspaces; ++i) { */
/* XLAL_VBXMLO_BeginTag(&xml, "subspace"); */
/* XLAL_VBXMLO_Tag(&xml, "dimensions", "%i", tiling->subspaces[i]->dimensions); */
/* XLAL_VBXMLO_BeginTag(&xml, "is_tiled"); */
/* XLAL_VBXMLO_Indent(&xml); */
/* for (j = 0; j < tiling->dimensions; ++j) { */
/* XLAL_VBXMLO_Printf(&xml, "%c", GET_BIT(UINT8, tiling->subspaces[i]->is_tiled, j) ? 'Y' : 'N'); */
/* } */
/* XLAL_VBXMLO_Printf(&xml, "\n"); */
/* XLAL_VBXMLO_EndTag(&xml, "is_tiled"); */
/* XLAL_VBXMLO_gsl_vector(&xml, "padding", "%0.12g", tiling->subspaces[i]->padding); */
/* XLAL_VBXMLO_gsl_matrix(&xml, "increment", "%0.12g", tiling->subspaces[i]->increment); */
/* XLAL_VBXMLO_EndTag(&xml, "subspace"); */
/* } */
/* XLAL_VBXMLO_EndTag(&xml, "subspaces"); */
/* Output template count */
XLAL_VBXMLO_Tag(&xml, "template_count", "%li", XLALTotalFlatLatticePointCount(tiling));
......
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