00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef _LATTICECOVERING_H
00042 #define _LATTICECOVERING_H
00043
00044
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048
00049
00050 #include <gsl/gsl_matrix.h>
00051
00052 #include <lal/LALStdlib.h>
00053 #include <lal/LALDatatypes.h>
00054 #include <lal/AVFactories.h>
00055
00056
00057 #include <lal/PtoleMetric.h>
00058
00059
00060
00061 NRCSID( LATTICECOVERINGH, "$Id: LatticeCovering.h,v 1.5 2007/01/31 00:18:41 reinhard Exp $" );
00062
00063
00064
00065
00066
00067
00068 #define LATTICECOVERING_ENULL 1
00069 #define LATTICECOVERING_ENONULL 2
00070 #define LATTICECOVERING_EMEM 3
00071 #define LATTICECOVERING_EINPUT 4
00072 #define LATTICECOVERING_ELIST 5
00073 #define LATTICECOVERING_EFUNC 6
00074
00075 #define LATTICECOVERING_MSGENULL "Arguments contained an unexpected null pointer"
00076 #define LATTICECOVERING_MSGENONULL "Output pointer is not NULL"
00077 #define LATTICECOVERING_MSGEMEM "Out of memory"
00078 #define LATTICECOVERING_MSGEINPUT "Invald input parameter"
00079 #define LATTICECOVERING_MSGELIST "Error occurred in list-handling ..."
00080 #define LATTICECOVERING_MSGEFUNC "Sub-routine failed"
00081
00082
00083
00084
00085 typedef enum
00086 {
00087 LATTICE_TYPE_ANSTAR = 0,
00088 LATTICE_TYPE_CUBIC,
00089 LATTICE_TYPE_LAST
00090 } LatticeType;
00091
00092
00093 typedef struct tagINT4VectorList
00094 {
00095 INT4Vector entry;
00096 struct tagINT4VectorList *next;
00097 struct tagINT4VectorList *prev;
00098 } INT4VectorList;
00099
00100
00101 typedef struct tagREAL8VectorList
00102 {
00103 REAL8Vector entry;
00104 struct tagREAL8VectorList *next;
00105 struct tagREAL8VectorList *prev;
00106 } REAL8VectorList;
00107
00108
00109
00110 extern INT4VectorList empty_INT4VectorList;
00111 extern REAL8VectorList empty_REAL8VectorList;
00112
00113
00114 void LALLatticeCovering (LALStatus *, REAL8VectorList **covering, REAL8 coveringRadius,
00115 const gsl_matrix *metric, const REAL8Vector *startPoint,
00116 BOOLEAN (*isInside)(const REAL8Vector *point),
00117 LatticeType latticeType);
00118
00119 void LALLatticeFill (LALStatus *, REAL8VectorList **fillGrid, const gsl_matrix *generator,
00120 const REAL8Vector *startPoint, BOOLEAN (*isInside)(const REAL8Vector *point) );
00121
00122
00123 int XLALFindCoveringGenerator (gsl_matrix **outmatrix, LatticeType type, REAL8 coveringRadius, const gsl_matrix *gij);
00124 int XLALReduceGenerator2FullRank(gsl_matrix **outmatrix, const gsl_matrix *inmatrix);
00125 int XLALGetLatticeGenerator (gsl_matrix **outmatrix, UINT4 dimension, LatticeType type);
00126
00127 REAL8 XLALMetricScalarProduct (const gsl_vector *vector1, const gsl_vector *vector2,
00128 const gsl_matrix *metric);
00129
00130
00131
00132 REAL8VectorList* XLALREAL8VectorListAddEntry (REAL8VectorList *head, const REAL8Vector *entry);
00133 void XLALREAL8VectorListDestroy (REAL8VectorList *head);
00134
00135
00136
00137 REAL8Vector *XLALgsl2LALmetric (const gsl_matrix *gmetric);
00138
00139
00140 gsl_matrix *XLALmetric2gsl (const REAL8Vector *metric);
00141
00142 #ifdef __cplusplus
00143 }
00144 #endif
00145
00146
00147 #endif