Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:33

0001 /*
0002 # <<BEGIN-copyright>>
0003 # <<END-copyright>>
0004 */
0005 
0006 #ifndef xDataTOM_h_included
0007 #define xDataTOM_h_included
0008 
0009 #include <statusMessageReporting.h>
0010 
0011 #if defined __cplusplus
0012     extern "C" {
0013     namespace GIDI {
0014 #endif
0015 
0016 typedef int xDataTOM_Int;
0017 
0018 /* Note: xDataTOM_interpolationFlag_flat must be last for current logic in xDataTOM_interpolation.c to work. */
0019 enum xDataTOM_interpolationFlag { xDataTOM_interpolationFlag_invalid, xDataTOM_interpolationFlag_linear, xDataTOM_interpolationFlag_log, 
0020     xDataTOM_interpolationFlag_byRegion, xDataTOM_interpolationFlag_flat };
0021 enum xDataTOM_interpolationQualifier { xDataTOM_interpolationQualifier_invalid, xDataTOM_interpolationQualifier_dependent,
0022     xDataTOM_interpolationQualifier_none, xDataTOM_interpolationQualifier_unitBase, xDataTOM_interpolationQualifier_correspondingPoints };
0023 enum xDataTOM_frame { xDataTOM_frame_invalid, xDataTOM_frame_lab, xDataTOM_frame_centerOfMass };
0024 enum xDataTOM_subAxesType { xDataTOM_subAxesType_proxy, xDataTOM_subAxesType_intepolationAxes };
0025 enum xDataTOM_KalbachMannType { xDataTOM_KalbachMannType_fr, xDataTOM_KalbachMannType_fra };
0026 
0027 typedef struct xDataTOM_interpolation_s xDataTOM_interpolation;
0028 typedef struct xDataTOM_axis_s xDataTOM_axis;
0029 typedef struct xDataTOM_axes_s xDataTOM_axes;
0030 typedef struct xDataTOM_subAxes_s xDataTOM_subAxes;
0031 
0032 typedef struct xDataTOM_XYs_s xDataTOM_XYs;
0033 typedef struct xDataTOM_regionsXYs_s xDataTOM_regionsXYs;
0034 typedef struct xDataTOM_W_XYs_s xDataTOM_W_XYs;
0035 typedef struct xDataTOM_V_W_XYs_s xDataTOM_V_W_XYs;
0036 
0037 typedef struct xDataTOM_LegendreSeries_s xDataTOM_LegendreSeries;
0038 typedef struct xDataTOM_W_XYs_LegendreSeries_s xDataTOM_W_XYs_LegendreSeries;
0039 typedef struct xDataTOM_regionsW_XYs_LegendreSeries_s xDataTOM_regionsW_XYs_LegendreSeries;
0040 typedef struct xDataTOM_V_W_XYs_LegendreSeries_s xDataTOM_V_W_XYs_LegendreSeries;
0041 typedef struct xDataTOM_KalbachMannCoefficients_s xDataTOM_KalbachMannCoefficients;
0042 typedef struct xDataTOM_KalbachMann_s xDataTOM_KalbachMann;
0043 typedef struct xDataTOM_polynomial_s xDataTOM_polynomial;
0044 
0045 typedef struct xDataTOM_xDataInfo_s xDataTOM_xDataInfo;
0046 
0047 typedef struct xDataTOM_attribute_s xDataTOM_attribute;
0048 typedef struct xDataTOM_attributionList_s xDataTOM_attributionList;
0049 typedef struct xDataTOM_elementListItem_s xDataTOM_elementListItem;
0050 typedef struct xDataTOM_elementList_s xDataTOM_elementList;
0051 typedef struct xDataTOM_element_s xDataTOM_element;
0052 typedef struct xDataTOM_TOM_s xDataTOM_TOM;
0053 
0054 typedef int (*xDataTOM_sortElementFunc)( const void *, const void * );
0055 
0056 struct xDataTOM_interpolation_s {
0057     enum xDataTOM_interpolationFlag independent, dependent;
0058     enum xDataTOM_interpolationQualifier qualifier;
0059 };
0060 
0061 struct xDataTOM_axis_s {
0062     int index;
0063     char *label;
0064     char *unit;
0065     xDataTOM_interpolation interpolation;
0066 };
0067 
0068 struct xDataTOM_axes_s {
0069     int numberOfAxes;
0070     xDataTOM_axis *axis;
0071 };
0072 
0073 struct xDataTOM_subAxes_s {
0074     enum xDataTOM_subAxesType type;
0075     int offset;
0076     xDataTOM_axes *axes;
0077     xDataTOM_interpolation interpolation;
0078 };
0079 
0080 struct xDataTOM_XYs_s {
0081     int index, length;
0082     double value, accuracy;
0083     xDataTOM_subAxes subAxes;
0084     double *data;
0085 };
0086 
0087 struct xDataTOM_regionsXYs_s {
0088     int length;
0089     xDataTOM_axes *axes;
0090     xDataTOM_XYs *XYs;
0091 };
0092 
0093 struct xDataTOM_W_XYs_s {
0094     int index, length;
0095     double value;
0096     xDataTOM_subAxes subAxes;
0097     xDataTOM_XYs *XYs;
0098 };
0099 
0100 struct xDataTOM_V_W_XYs_s {
0101     int length;
0102     xDataTOM_subAxes subAxes;
0103     xDataTOM_W_XYs *W_XYs;
0104 };
0105 
0106 struct xDataTOM_LegendreSeries_s {
0107     int index, length;
0108     double value;
0109     double *LegendreSeries;
0110 };
0111 
0112 struct xDataTOM_W_XYs_LegendreSeries_s {
0113     int index, length;
0114     double value;
0115     xDataTOM_subAxes subAxes;
0116     xDataTOM_LegendreSeries *LegendreSeries;
0117 };
0118 
0119 struct xDataTOM_regionsW_XYs_LegendreSeries_s {
0120     int length;
0121     xDataTOM_axes *axes;
0122     xDataTOM_W_XYs_LegendreSeries *W_XYs_LegendreSeries;
0123 };
0124 
0125 struct xDataTOM_V_W_XYs_LegendreSeries_s {
0126     int length;
0127     xDataTOM_subAxes subAxes;
0128     xDataTOM_W_XYs_LegendreSeries *W_XYs_LegendreSeries;
0129 };
0130 
0131 struct xDataTOM_KalbachMannCoefficients_s {
0132     int index, length;
0133     double value;
0134     double *coefficients;
0135 };
0136 
0137 struct xDataTOM_KalbachMann_s {
0138     enum xDataTOM_KalbachMannType type;
0139     int numberOfEnergies;
0140     xDataTOM_subAxes subAxes;
0141     xDataTOM_KalbachMannCoefficients *coefficients;
0142 };
0143 
0144 struct xDataTOM_polynomial_s {
0145     int length;
0146     xDataTOM_subAxes subAxes;
0147     double *coefficients;
0148 };
0149 
0150 struct xDataTOM_xDataInfo_s {
0151     const char *ID;
0152     xDataTOM_element *element;
0153     xDataTOM_axes axes;
0154     void *data;
0155 };
0156 
0157 struct xDataTOM_attribute_s {
0158     xDataTOM_attribute *next;
0159     char *name;
0160     char *value;
0161 };
0162 
0163 struct xDataTOM_attributionList_s {
0164     int number;
0165     xDataTOM_attribute *attributes;
0166 };
0167 
0168 struct xDataTOM_elementListItem_s {
0169     xDataTOM_element *element;
0170     const char *sortString;
0171 };
0172 
0173 struct xDataTOM_elementList_s {
0174     int n;
0175     xDataTOM_elementListItem *items;
0176 };
0177 
0178 struct xDataTOM_element_s {
0179     int ordinal;                                    /* Counting from 0. */
0180     int index;                                      /* Value from "index" attribute if present or -1. */
0181     xDataTOM_element *parent;
0182     xDataTOM_element *next;
0183     char *name;
0184     xDataTOM_attributionList attributes;
0185     int numberOfChildren;
0186     xDataTOM_element *children;
0187     xDataTOM_xDataInfo xDataInfo;
0188 };
0189 
0190 struct xDataTOM_TOM_s {
0191     char *fileName;
0192     char *realFileName;
0193     xDataTOM_element root;
0194 };
0195 
0196 /*
0197 * Stuff in common/xDataTOM.c
0198 */
0199 xDataTOM_TOM *xDataTOM_importFile( statusMessageReporting *smr, const char *fileName );
0200 xDataTOM_TOM *xDataTOM_mallocTOM( statusMessageReporting *smr );
0201 int xDataTOM_initializeTOM( statusMessageReporting *smr, xDataTOM_TOM *doc );
0202 void *xDataTOM_freeTOM( statusMessageReporting *smr, xDataTOM_TOM **TOM );
0203 int xDataTOM_setFileNameTOM( statusMessageReporting *smr, xDataTOM_TOM *doc, const char *fileName );
0204 void xDataTOM_displayTree( statusMessageReporting *smr, xDataTOM_TOM *TOM, int printAttributes );
0205 
0206 xDataTOM_element *xDataTOM_mallocElement( statusMessageReporting *smr, xDataTOM_element *parent, int ordinal, int index, char const *name );
0207 void xDataTOM_freeElement( xDataTOM_element **element );
0208 void xDataTOM_releaseElement( xDataTOM_element *element );
0209 xDataTOM_element *xDataTOM_addElementInElement( statusMessageReporting *smr, xDataTOM_element *parent, int index, char const *name );
0210 xDataTOM_element *xDataTOM_getDocumentsElement( xDataTOM_TOM *TOM );
0211 xDataTOM_element *xDataTOME_getFirstElement( xDataTOM_element *element );
0212 xDataTOM_element *xDataTOME_getNextElement( xDataTOM_element *element );
0213 xDataTOM_element *xDataTOME_getOneElementByName( statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required );
0214 int xDataTOM_numberOfElementsByName( statusMessageReporting *smr, xDataTOM_element *element, char const *name );
0215 int xDataTOME_addAttribute( statusMessageReporting *smr, xDataTOM_element *element, char const *name, char const *value );
0216 char const *xDataTOM_getAttributesValueInElement( xDataTOM_element *element, char const *name );
0217 int xDataTOME_copyAttributionList( statusMessageReporting *smr, xDataTOM_attributionList *desc, xDataTOM_element *element );
0218 int xDataTOME_convertAttributeToInteger( statusMessageReporting *smr, xDataTOM_element *element, char const *name, int *n );
0219 int xDataTOME_convertAttributeToDouble( statusMessageReporting *smr, xDataTOM_element *element, char const *name, double *d );
0220 int xDataTOME_convertAttributeToDoubleWithUnit( statusMessageReporting *smr, xDataTOM_element *element, char const *name, double *d, char *unit );
0221 int xDataTOME_getInterpolation( statusMessageReporting *smr, xDataTOM_element *element, int index, 
0222     enum xDataTOM_interpolationFlag *independent, enum xDataTOM_interpolationFlag *dependent, enum xDataTOM_interpolationQualifier *qualifier );
0223 
0224 void xDataTOMAL_initial( statusMessageReporting *smr, xDataTOM_attributionList *attributes );
0225 void xDataTOMAL_release( xDataTOM_attributionList *attributes );
0226 int xDataTOMAL_addAttribute( statusMessageReporting *smr, xDataTOM_attributionList *attributes, char const *name, char const *value );
0227 char const *xDataTOMAL_getAttributesValue( xDataTOM_attributionList *attributes, char const *name );
0228 int xDataTOMAL_copyAttributionList( statusMessageReporting *smr, xDataTOM_attributionList *desc, xDataTOM_attributionList *src );
0229 int xDataTOMAL_convertAttributeToInteger( statusMessageReporting *smr, xDataTOM_attributionList *attributes, char const *name, int *n );
0230 int xDataTOMAL_convertAttributeToDouble( statusMessageReporting *smr, xDataTOM_attributionList *attributes, char const *name, double *d );
0231 
0232 void *xData_initializeData( statusMessageReporting *smr, xDataTOM_element *TE, char const *ID, size_t size );
0233 int xDataTOM_isXDataID( xDataTOM_element *TE, char const *ID );
0234 
0235 /*
0236 * Stuff in common/xDataTOMMisc.c
0237 */
0238 char *xDataTOMMisc_getAbsPath( statusMessageReporting *smr, const char *fileName );
0239 int xDataTOM_setMessageError_ReturnInt( int value, statusMessageReporting *smr, void *userData, const char *file, int line, int code, const char *fmt, ... );
0240 xDataTOM_element *xDataTOM_getLinksElement( statusMessageReporting *smr, xDataTOM_element *element, char const *link );
0241 
0242 #define xDataTOMMisc_allocateCopyString2( smr, s, forItem ) xDataTOMMisc_allocateCopyString( smr, s, forItem, __FILE__, __LINE__ )
0243 
0244 /*
0245 * Stuff in common/xDataTOM_interpolation.c
0246 */
0247 int xDataTOM_interpolation_set( statusMessageReporting *smr, xDataTOM_interpolation *interpolation, enum xDataTOM_interpolationFlag independent, 
0248     enum xDataTOM_interpolationFlag dependent, enum xDataTOM_interpolationQualifier qualifier );
0249 int xDataTOM_interpolation_setFromString( statusMessageReporting *smr, xDataTOM_interpolation *interpolation, char const *str );
0250 int xDataTOM_interpolation_copy( statusMessageReporting *smr, xDataTOM_interpolation *desc, xDataTOM_interpolation *src );
0251 
0252 /*
0253 * Stuff in common/xDataTOM_axes.c
0254 */
0255 int xDataTOM_axes_initialize( statusMessageReporting *smr, xDataTOM_axes *axes, int numberOfAxes );
0256 int xDataTOM_axes_release( xDataTOM_axes *axes );
0257 char const *xDataTOM_axes_getLabel( statusMessageReporting *smr, xDataTOM_axes *axes, int index );
0258 char const *xDataTOM_axes_getUnit( statusMessageReporting *smr, xDataTOM_axes *axes, int index );
0259 int xDataTOM_axes_getInterpolation( statusMessageReporting *smr, xDataTOM_axes *axes, int index, enum xDataTOM_interpolationFlag *independent,
0260         enum xDataTOM_interpolationFlag *dependent, enum xDataTOM_interpolationQualifier *qualifier );
0261 
0262 int xDataTOM_subAxes_initialize( statusMessageReporting *smr, xDataTOM_subAxes *subAxes, enum xDataTOM_subAxesType type, int offset, 
0263     xDataTOM_axes *axes, xDataTOM_interpolation *interpolation );
0264 int xDataTOM_subAxes_release( xDataTOM_subAxes *subAxes );
0265 char const *xDataTOM_subAxes_getLabel( statusMessageReporting *smr, xDataTOM_subAxes *subAxes, int index );
0266 char const *xDataTOM_subAxes_getUnit( statusMessageReporting *smr, xDataTOM_subAxes *subAxes, int index );
0267 
0268 xDataTOM_axis *xDataTOM_axis_new( statusMessageReporting *smr, int index, char const *label, char const *unit, xDataTOM_interpolation *interpolation );
0269 int xDataTOM_axis_initialize( statusMessageReporting *smr, xDataTOM_axis *axis, int index, char const *label, char const *unit, 
0270     xDataTOM_interpolation *interpolation );
0271 xDataTOM_axis *xDataTOM_axis_release( statusMessageReporting *smr, xDataTOM_axis *axis );
0272 enum xDataTOM_frame xDataTOM_axis_stringToFrame( statusMessageReporting *smr, char const *frame );
0273 char const *xDataTOM_axis_frameToString( statusMessageReporting *smr, enum xDataTOM_frame frame );
0274 
0275 /*
0276 * Stuff in common/xDataTOM_XYs.c
0277 */
0278 int xDataTOM_XYs_free( xDataTOM_xDataInfo *xDI );
0279 int xDataTOM_XYs_release( xDataTOM_XYs *XYs );
0280 int xDataTOM_XYs_getData( xDataTOM_XYs *XYs, double **data );
0281 int xDataTOM_XYs_getDataFromXDataInfo( xDataTOM_xDataInfo *xDI, double **data );
0282 
0283 /*
0284 * Stuff in common/xDataTOM_regionsXYs.c
0285 */
0286 int xDataTOM_regionsXYs_free( xDataTOM_xDataInfo *xDI );
0287 
0288 /*
0289 * Stuff in common/xDataTOM_W_XYs.c
0290 */
0291 xDataTOM_W_XYs *xDataTOM_W_XYs_new( statusMessageReporting *smr, int index, int length, double value, xDataTOM_axes *axes, int axesOffset );
0292 int xDataTOM_W_XYs_initialize( statusMessageReporting *smr, xDataTOM_W_XYs *W_XYs, int index, int length, double value, xDataTOM_axes *axes,
0293     int axesOffset );
0294 xDataTOM_W_XYs *xDataTOM_W_XYs_free( xDataTOM_W_XYs *W_XYs );
0295 int xDataTOM_W_XYs_freeFrom_xDataInfo( xDataTOM_xDataInfo *xDI );
0296 int xDataTOM_W_XYs_release( xDataTOM_W_XYs *W_XYs );
0297 xDataTOM_xDataInfo *xDataTOME_getXData( xDataTOM_element *TE );
0298 void *xDataTOME_getXDataIfID( statusMessageReporting *smr, xDataTOM_element *TE, char const *ID );
0299 
0300 /*
0301 * Stuff in common/xDataTOM_V_W_XYs.c
0302 */
0303 int xDataTOM_V_W_XYs_initialize( statusMessageReporting *smr, xDataTOM_V_W_XYs *V_W_XYs, int length, xDataTOM_axes *axes );
0304 int xDataTOM_V_W_XYs_free( xDataTOM_xDataInfo *xDI );
0305 
0306 /*
0307 * Stuff in common/xDataTOM_LegendreSeries.c
0308 */
0309 int xDataTOM_LegendreSeries_initialize( statusMessageReporting *smr, xDataTOM_LegendreSeries *LegendreSeries, int index, int length, double value );
0310 int xDataTOM_LegendreSeries_release( xDataTOM_LegendreSeries *LegendreSeries );
0311 
0312 /*
0313 * Stuff in common/xDataTOM_W_XYs_LegendreSeries.c
0314 */
0315 int xDataTOM_W_XYs_LegendreSeries_initialize( statusMessageReporting *smr, xDataTOM_W_XYs_LegendreSeries *W_XYs_LegendreSeries, int index, 
0316         int length, double value, enum xDataTOM_subAxesType subAxesType, xDataTOM_axes *axes, xDataTOM_interpolation *interpolation );
0317 int xDataTOM_W_XYs_LegendreSeries_free( xDataTOM_xDataInfo *xDI );
0318 int xDataTOM_W_XYs_LegendreSeries_release( xDataTOM_W_XYs_LegendreSeries *W_XYs_LegendreSeries );
0319 
0320 /*
0321 * Stuff in common/xDataTOM_regionsW_XYs_LegendreSeries.c
0322 */
0323 int xDataTOM_regionsW_XYs_LegendreSeries_initialize( statusMessageReporting *smr, xDataTOM_regionsW_XYs_LegendreSeries *regionsW_XYs_LegendreSeries,
0324         int length, xDataTOM_axes *axes );
0325 int xDataTOM_regionsW_XYs_LegendreSeries_free( xDataTOM_xDataInfo *xDI );
0326 int xDataTOM_regionsW_XYs_LegendreSeries_release( xDataTOM_regionsW_XYs_LegendreSeries *regionsW_XYs_LegendreSeries );
0327 
0328 /*
0329 * Stuff in common/xDataTOM_V_W_XYs_LegendreSeries.c
0330 */
0331 int xDataTOM_V_W_XYs_LegendreSeries_initialize( statusMessageReporting *smr, xDataTOM_V_W_XYs_LegendreSeries *V_W_XYs_LegendreSeries, 
0332         int length, xDataTOM_axes *axes );
0333 int xDataTOM_V_W_XYs_LegendreSeries_free( xDataTOM_xDataInfo *xDI );
0334 
0335 /*
0336 * Stuff in common/xDataTOM_KalbachMann.c
0337 */
0338 int xDataTOM_KalbachMann_initialize( statusMessageReporting *smr, xDataTOM_KalbachMann *KalbachMann, int length, xDataTOM_axes *axes );
0339 int xDataTOM_KalbachMann_free( xDataTOM_xDataInfo *xDI );
0340 int xDataTOM_KalbachMann_release( xDataTOM_KalbachMann *KalbachMann );
0341 
0342 /*
0343 * Stuff in common/xDataTOM_polynomial.c
0344 */
0345 int xDataTOM_polynomial_initialize( statusMessageReporting *smr, xDataTOM_polynomial *polynomial, int length, xDataTOM_axes *axes );
0346 int xDataTOM_polynomial_free( xDataTOM_xDataInfo *xDI );
0347 int xDataTOM_polynomial_release( xDataTOM_polynomial *polynomial );
0348 int xDataTOM_polynomial_getData( xDataTOM_polynomial *polynomial, double **data );
0349 int xDataTOM_polynomial_getDataFromXDataInfo( xDataTOM_xDataInfo *xDI, double **data );
0350 
0351 #if defined __cplusplus
0352     }
0353     }
0354 #endif
0355 
0356 #endif              /* End of xDataTOM_h_included. */