SALSA Analysis Modules
|
Go to the source code of this file.
Data Structures | |
struct | IntArray_ |
struct | StringArray_ |
struct | AnalysisItemArray_ |
struct | AnalysisDataTypeArray_ |
Defines | |
#define | NALLOC 70 |
Functions | |
PetscErrorCode | CreateIntArray (const char *name, int size, IntArray *array) |
PetscErrorCode | DeleteIntArray (IntArray array) |
PetscErrorCode | IntArrayAdd (IntArray array, int val, int *idx) |
PetscErrorCode | IntArraySetAt (IntArray array, int idx, int val) |
PetscErrorCode | IntArrayTryGetAt (IntArray array, int idx, int *val, PetscBool *has) |
PetscErrorCode | IntArrayGetAt (IntArray array, int idx, int *val) |
PetscErrorCode | CreateStringArray (const char *name, int size, StringArray *array) |
PetscErrorCode | DeleteStringArray (StringArray array) |
PetscErrorCode | StringArrayAdd (StringArray array, const char *val, int *idx) |
PetscErrorCode | StringArrayGetFill (StringArray array, int *idx) |
PetscErrorCode | StringArraySetAt (StringArray array, int idx, const char *val) |
PetscErrorCode | StringArrayTryGetAt (StringArray array, int idx, char **val, PetscBool *has) |
PetscErrorCode | StringArrayGetAt (StringArray array, int idx, char **val) |
PetscErrorCode | CreateAnalysisItemArray (const char *name, int size, AnalysisItemArray *array) |
PetscErrorCode | DeleteAnalysisItemArray (AnalysisItemArray array) |
PetscErrorCode | AnalysisItemArrayAdd (AnalysisItemArray array, AnalysisItem val, int *idx) |
PetscErrorCode | AnalysisItemArraySetAt (AnalysisItemArray array, int idx, AnalysisItem val) |
PetscErrorCode | AnalysisItemArrayTryGetAt (AnalysisItemArray array, int idx, AnalysisItem *val, PetscBool *has) |
PetscErrorCode | AnalysisItemArrayGetAt (AnalysisItemArray array, int idx, AnalysisItem *val) |
PetscErrorCode | CreateAnalysisDataTypeArray (const char *name, int size, AnalysisDataTypeArray *array) |
PetscErrorCode | DeleteAnalysisDataTypeArray (AnalysisDataTypeArray array) |
PetscErrorCode | AnalysisDataTypeArrayAdd (AnalysisDataTypeArray array, AnalysisDataType val, int *idx) |
PetscErrorCode | AnalysisDataTypeArraySetAt (AnalysisDataTypeArray array, int idx, AnalysisDataType val) |
PetscErrorCode | AnalysisDataTypeArrayTryGetAt (AnalysisDataTypeArray array, int idx, AnalysisDataType *val, PetscBool *has) |
PetscErrorCode | AnalysisDataTypeArrayGetAt (AnalysisDataTypeArray array, int idx, AnalysisDataType *val) |
#define NALLOC 70 |
Definition at line 5 of file anamodutils.c.
Referenced by CreateAnalysisDataTypeArray(), CreateAnalysisItemArray(), CreateIntArray(), and CreateStringArray().
PetscErrorCode AnalysisDataTypeArrayAdd | ( | AnalysisDataTypeArray | array, |
AnalysisDataType | val, | ||
int * | idx | ||
) |
Add a new value and return the index. Right now we do not yet dynamically reallocate the array if there is no more space.
Definition at line 372 of file anamodutils.c.
References AnalysisDataTypeArray_::alloc, AnalysisDataTypeArray_::data, AnalysisDataTypeArray_::fill, and AnalysisDataTypeArray_::has.
PetscErrorCode AnalysisDataTypeArrayGetAt | ( | AnalysisDataTypeArray | array, |
int | idx, | ||
AnalysisDataType * | val | ||
) |
As AnalysisDataTypeArrayTryGetAt(), except that it is an error to ask for an index where no value has been set.
Definition at line 424 of file anamodutils.c.
References AnalysisDataTypeArray_::alloc, AnalysisDataTypeArray_::data, and AnalysisDataTypeArray_::has.
PetscErrorCode AnalysisDataTypeArraySetAt | ( | AnalysisDataTypeArray | array, |
int | idx, | ||
AnalysisDataType | val | ||
) |
Set a value at a given index. Right now we do not yet dynamically reallocate the array if the index is out of bound.
Definition at line 388 of file anamodutils.c.
References AnalysisDataTypeArray_::alloc, AnalysisDataTypeArray_::data, AnalysisDataTypeArray_::fill, and AnalysisDataTypeArray_::has.
Referenced by InstantiateFeatureSet().
PetscErrorCode AnalysisDataTypeArrayTryGetAt | ( | AnalysisDataTypeArray | array, |
int | idx, | ||
AnalysisDataType * | val, | ||
PetscBool * | has | ||
) |
Retrieve data from a given index.
Arguments:
array
: the AnalysisDataTypeArray objectidx
: the index; it is an error to ask out of bounds, but not to ask beyond the highest position filled; in that case failure will be reportedval
(output) : the value retrieved. This argument is allowed to be null.has
(output) : true if a value was stored at this index. This argument is allowed to be null. Definition at line 410 of file anamodutils.c.
References AnalysisDataTypeArray_::alloc, AnalysisDataTypeArray_::data, and AnalysisDataTypeArray_::has.
PetscErrorCode AnalysisItemArrayAdd | ( | AnalysisItemArray | array, |
AnalysisItem | val, | ||
int * | idx | ||
) |
Add a new value and return the index. Right now we do not yet dynamically reallocate the array if there is no more space.
Definition at line 267 of file anamodutils.c.
References AnalysisItemArray_::alloc, AnalysisItemArray_::data, AnalysisItemArray_::fill, and AnalysisItemArray_::has.
PetscErrorCode AnalysisItemArrayGetAt | ( | AnalysisItemArray | array, |
int | idx, | ||
AnalysisItem * | val | ||
) |
As AnalysisItemArrayTryGetAt(), except that it is an error to ask for an index where no value has been set.
Definition at line 319 of file anamodutils.c.
References AnalysisItemArray_::alloc, AnalysisItemArray_::data, and AnalysisItemArray_::has.
PetscErrorCode AnalysisItemArraySetAt | ( | AnalysisItemArray | array, |
int | idx, | ||
AnalysisItem | val | ||
) |
Set a value at a given index. Right now we do not yet dynamically reallocate the array if the index is out of bound.
Definition at line 283 of file anamodutils.c.
References AnalysisItemArray_::alloc, AnalysisItemArray_::data, AnalysisItemArray_::fill, and AnalysisItemArray_::has.
Referenced by InstantiateFeatureSet().
PetscErrorCode AnalysisItemArrayTryGetAt | ( | AnalysisItemArray | array, |
int | idx, | ||
AnalysisItem * | val, | ||
PetscBool * | has | ||
) |
Retrieve data from a given index.
Arguments:
array
: the AnalysisItemArray objectidx
: the index; it is an error to ask out of bounds, but not to ask beyond the highest position filled; in that case failure will be reportedval
(output) : the value retrieved. This argument is allowed to be null.has
(output) : true if a value was stored at this index. This argument is allowed to be null. Definition at line 305 of file anamodutils.c.
References AnalysisItemArray_::alloc, AnalysisItemArray_::data, and AnalysisItemArray_::has.
Referenced by GetFeatureValue().
PetscErrorCode CreateAnalysisDataTypeArray | ( | const char * | name, |
int | size, | ||
AnalysisDataTypeArray * | array | ||
) |
Definition at line 338 of file anamodutils.c.
References AnalysisDataTypeArray_::alloc, AnalysisDataTypeArray_::data, AnalysisDataTypeArray_::fill, AnalysisDataTypeArray_::has, NALLOC, and AnalysisDataTypeArray_::name.
Referenced by NewFeatureValues().
{ AnalysisDataTypeArray anew; PetscErrorCode ierr; PetscFunctionBegin; ierr = PetscMalloc(sizeof(struct AnalysisDataTypeArray_),&anew); CHKERRQ(ierr); ierr = PetscMemzero(anew,sizeof(struct AnalysisDataTypeArray_)); CHKERRQ(ierr); if (name) anew->name = strdup(name); anew->fill = 0; anew->alloc = NALLOC; ierr = PetscMalloc(anew->alloc*sizeof(PetscBool),&(anew->has)); CHKERRQ(ierr); ierr = PetscMemzero(anew->has,anew->alloc*sizeof(PetscBool)); CHKERRQ(ierr); ierr = PetscMalloc(anew->alloc*sizeof(AnalysisDataType),&(anew->data)); CHKERRQ(ierr); ierr = PetscMemzero(anew->data,anew->alloc*sizeof(AnalysisDataType)); CHKERRQ(ierr); *array = anew; PetscFunctionReturn(0); }
PetscErrorCode CreateAnalysisItemArray | ( | const char * | name, |
int | size, | ||
AnalysisItemArray * | array | ||
) |
Definition at line 233 of file anamodutils.c.
References AnalysisItemArray_::alloc, AnalysisItemArray_::data, AnalysisItemArray_::fill, AnalysisItemArray_::has, NALLOC, and AnalysisItemArray_::name.
Referenced by NewFeatureValues().
{ AnalysisItemArray anew; PetscErrorCode ierr; PetscFunctionBegin; ierr = PetscMalloc(sizeof(struct AnalysisItemArray_),&anew); CHKERRQ(ierr); ierr = PetscMemzero(anew,sizeof(struct AnalysisItemArray_)); CHKERRQ(ierr); if (name) anew->name = strdup(name); anew->fill = 0; anew->alloc = NALLOC; ierr = PetscMalloc(anew->alloc*sizeof(PetscBool),&(anew->has)); CHKERRQ(ierr); ierr = PetscMemzero(anew->has,anew->alloc*sizeof(PetscBool)); CHKERRQ(ierr); ierr = PetscMalloc(anew->alloc*sizeof(AnalysisItem),&(anew->data)); CHKERRQ(ierr); ierr = PetscMemzero(anew->data,anew->alloc*sizeof(AnalysisItem)); CHKERRQ(ierr); *array = anew; PetscFunctionReturn(0); }
PetscErrorCode CreateIntArray | ( | const char * | name, |
int | size, | ||
IntArray * | array | ||
) |
Definition at line 13 of file anamodutils.c.
References IntArray_::alloc, IntArray_::data, IntArray_::fill, IntArray_::has, NALLOC, and IntArray_::name.
Referenced by NewFeatureSet().
{ IntArray inew; PetscErrorCode ierr; PetscFunctionBegin; ierr = PetscMalloc(sizeof(struct IntArray_),&inew); CHKERRQ(ierr); ierr = PetscMemzero(inew,sizeof(struct IntArray_)); CHKERRQ(ierr); if (name) inew->name = strdup(name); inew->fill = 0; inew->alloc = NALLOC; ierr = PetscMalloc(inew->alloc*sizeof(PetscBool),&(inew->has)); CHKERRQ(ierr); ierr = PetscMemzero(inew->has,inew->alloc*sizeof(PetscBool)); CHKERRQ(ierr); ierr = PetscMalloc(inew->alloc*sizeof(int),&(inew->data)); CHKERRQ(ierr); ierr = PetscMemzero(inew->data,inew->alloc*sizeof(int)); CHKERRQ(ierr); *array = inew; PetscFunctionReturn(0); }
PetscErrorCode CreateStringArray | ( | const char * | name, |
int | size, | ||
StringArray * | array | ||
) |
Definition at line 117 of file anamodutils.c.
References StringArray_::alloc, StringArray_::data, StringArray_::fill, StringArray_::has, NALLOC, and StringArray_::name.
Referenced by NewFeatureSet().
{ StringArray snew; PetscErrorCode ierr; PetscFunctionBegin; ierr = PetscMalloc(sizeof(struct StringArray_),&snew); CHKERRQ(ierr); ierr = PetscMemzero(snew,sizeof(struct StringArray_)); CHKERRQ(ierr); if (name) snew->name = strdup(name); snew->fill = 0; snew->alloc = NALLOC; ierr = PetscMalloc(snew->alloc*sizeof(PetscBool),&(snew->has)); CHKERRQ(ierr); ierr = PetscMemzero(snew->has,snew->alloc*sizeof(PetscBool)); CHKERRQ(ierr); ierr = PetscMalloc(snew->alloc*sizeof(char*),&(snew->data)); CHKERRQ(ierr); ierr = PetscMemzero(snew->data,snew->alloc*sizeof(char*)); CHKERRQ(ierr); *array = snew; PetscFunctionReturn(0); }
PetscErrorCode DeleteAnalysisDataTypeArray | ( | AnalysisDataTypeArray | array | ) |
Definition at line 356 of file anamodutils.c.
References AnalysisDataTypeArray_::data, AnalysisDataTypeArray_::has, and AnalysisDataTypeArray_::name.
Referenced by DeleteFeatureValues().
PetscErrorCode DeleteAnalysisItemArray | ( | AnalysisItemArray | array | ) |
Definition at line 251 of file anamodutils.c.
References AnalysisItemArray_::data, AnalysisItemArray_::has, and AnalysisItemArray_::name.
Referenced by DeleteFeatureValues().
PetscErrorCode DeleteIntArray | ( | IntArray | array | ) |
Definition at line 31 of file anamodutils.c.
References IntArray_::data, IntArray_::has, and IntArray_::name.
Referenced by DeleteFeatureSet().
PetscErrorCode DeleteStringArray | ( | StringArray | array | ) |
Definition at line 135 of file anamodutils.c.
References StringArray_::data, StringArray_::fill, StringArray_::has, and StringArray_::name.
Referenced by DeleteFeatureSet().
{ int i; PetscErrorCode ierr; PetscFunctionBegin; for (i=0; i<array->fill; i++) if (array->has[i]) free(array->data[i]); ierr = PetscFree(array->data); CHKERRQ(ierr); ierr = PetscFree(array->has); CHKERRQ(ierr); if (array->name) free(array->name); ierr = PetscFree(array); CHKERRQ(ierr); PetscFunctionReturn(0); }
PetscErrorCode IntArrayAdd | ( | IntArray | array, |
int | val, | ||
int * | idx | ||
) |
Add a new value and return the index. Right now we do not yet dynamically reallocate the array if there is no more space.
Definition at line 47 of file anamodutils.c.
References IntArray_::alloc, IntArray_::data, IntArray_::fill, and IntArray_::has.
PetscErrorCode IntArrayGetAt | ( | IntArray | array, |
int | idx, | ||
int * | val | ||
) |
As IntArrayTryGetAt(), except that it is an error to ask for an index where no value has been set.
Definition at line 99 of file anamodutils.c.
References IntArray_::alloc, IntArray_::data, and IntArray_::has.
PetscErrorCode IntArraySetAt | ( | IntArray | array, |
int | idx, | ||
int | val | ||
) |
Set a value at a given index. Right now we do not yet dynamically reallocate the array if the index is out of bound.
Definition at line 63 of file anamodutils.c.
References IntArray_::alloc, IntArray_::data, IntArray_::fill, and IntArray_::has.
PetscErrorCode IntArrayTryGetAt | ( | IntArray | array, |
int | idx, | ||
int * | val, | ||
PetscBool * | has | ||
) |
Retrieve data from a given index.
Arguments:
array
: the IntArray objectidx
: the index; it is an error to ask out of bounds, but not to ask beyond the highest position filled; in that case failure will be reportedval
(output) : the value retrieved. This argument is allowed to be null.has
(output) : true if a value was stored at this index. This argument is allowed to be null. Definition at line 85 of file anamodutils.c.
References IntArray_::alloc, IntArray_::data, and IntArray_::has.
PetscErrorCode StringArrayAdd | ( | StringArray | array, |
const char * | val, | ||
int * | idx | ||
) |
Add a new value and return the index. Right now we do not yet dynamically reallocate the array if there is no more space.
Definition at line 153 of file anamodutils.c.
References StringArray_::alloc, StringArray_::data, StringArray_::fill, and StringArray_::has.
Referenced by AddToFeatureSet().
PetscErrorCode StringArrayGetAt | ( | StringArray | array, |
int | idx, | ||
char ** | val | ||
) |
As StringArrayTryGetAt(), except that it is an error to ask for an index where no value has been set.
Definition at line 214 of file anamodutils.c.
References StringArray_::alloc, StringArray_::data, and StringArray_::has.
Referenced by InstantiateFeatureSet().
PetscErrorCode StringArrayGetFill | ( | StringArray | array, |
int * | idx | ||
) |
Definition at line 166 of file anamodutils.c.
References StringArray_::fill.
Referenced by InstantiateFeatureSet().
{ PetscFunctionBegin; *idx = array->fill; PetscFunctionReturn(0); }
PetscErrorCode StringArraySetAt | ( | StringArray | array, |
int | idx, | ||
const char * | val | ||
) |
Set a value at a given index. Right now we do not yet dynamically reallocate the array if the index is out of bound.
Definition at line 178 of file anamodutils.c.
References StringArray_::alloc, StringArray_::data, StringArray_::fill, and StringArray_::has.
PetscErrorCode StringArrayTryGetAt | ( | StringArray | array, |
int | idx, | ||
char ** | val, | ||
PetscBool * | has | ||
) |
Retrieve data from a given index.
Arguments:
array
: the StringArray objectidx
: the index; it is an error to ask out of bounds, but not to ask beyond the highest position filled; in that case failure will be reportedval
(output) : the value retrieved. This argument is allowed to be null.has
(output) : true if a value was stored at this index. This argument is allowed to be null. Definition at line 200 of file anamodutils.c.
References StringArray_::alloc, StringArray_::data, and StringArray_::has.