Woolz Image Processing
Version 1.7.5
|
Files | |
file | AlcVector.c |
A general purpose 1D vector (extensible array). | |
Data Structures | |
struct | _AlcVector |
An extensible 1D array. Typedef: AlcVector. More... | |
Functions | |
AlcVector * | AlcVectorNew (size_t elmCnt, size_t elmSz, size_t blkSz, AlcErrno *dstErr) |
Creates a new 1D vector (extensible array) with the required element size and initial number of elements. Vector elements are initialised by setting all bytes to zero. More... | |
AlcErrno | AlcVectorFree (AlcVector *vec) |
Free's the given vector. More... | |
AlcErrno | AlcVectorExtend (AlcVector *vec, size_t elmCnt) |
Extend the vector for at least the given number of elements. More... | |
void * | AlcVectorItemGet (AlcVector *vec, size_t idx) |
Gets a pointer to the vector item with the given index. More... | |
void * | AlcVectorExtendAndGet (AlcVector *vec, size_t idx) |
Extends the vector and gets the vector item with the given index. More... | |
size_t | AlcVectorCount (AlcVector *vec) |
Gets the number of elements that the vector can hold before it needs to be extended. More... | |
void | AlcVectorSetArray1D (AlcVector *vec, size_t fIdx, size_t lIdx, void *aM) |
Copies elements from the vector into a 1 dimensional array. More... | |
void * | AlcVectorToArray1D (AlcVector *vec, size_t fIdx, size_t lIdx, AlcErrno *dstErr) |
Creates a 1 dimensional array which contains a copy of the vectors elements. More... | |
void ** | AlcVectorToArray2D (AlcVector *vec, size_t nR, size_t nC, AlcErrno *dstErr) |
Creates a 2 dimensional array which contains a copy of the vectors elements. More... | |
AlcVector * | AlcVecReadDouble1Asci (FILE *fP, const char *fSep, size_t recMax, size_t *dstNV, AlcErrno *dstErr) |
Reads a 1D double array from the given numeric ASCI file. Each value should be on a seperate line. More... | |
AlcVector * | AlcVecReadDouble2Asci (FILE *fP, const char *fSep, size_t recMax, size_t *dstNR, size_t *dstNC, AlcErrno *dstErr) |
Reads a 2D double array from the given numeric ASCI file into an extensible vector. The number of fields per record must be the same for all records. More... | |
Creates a new 1D vector (extensible array) with the required element size and initial number of elements. Vector elements are initialised by setting all bytes to zero.
elmCnt | Initial number of elements. |
elmSz | Size of elements. |
blkSz | Number of elements per block, also minimum initial number of blocks allocated. If blkSz <= 0 then a default a defualt value is used. |
dstErr | Destination pointer for error code, may be NULL. |
References ALC_ER_ALLOC, ALC_ER_NONE, ALC_ER_PARAM, AlcCalloc(), AlcFree(), AlcFreeStackPush(), _AlcVector::blkCnt, _AlcVector::blkSz, _AlcVector::blkUse, _AlcVector::blocks, _AlcVector::elmSz, and _AlcVector::freeStack.
Referenced by AlcVecReadDouble1Asci(), AlcVecReadDouble2Asci(), WlzCMeshCopy2D(), WlzCMeshCopy2D5(), WlzCMeshCopy3D(), WlzCMeshNew2D(), WlzCMeshNew2D5(), WlzCMeshNew3D(), WlzCMeshToDomObjValues(), WlzCopyIndexedValues(), WlzEffReadObjObj(), WlzGeoModelGridWSpSet3D(), WlzGMModelFindNMEdges(), WlzGMModelNew(), WlzMakeIndexedValues(), and WlzPointsFromDomObj().
Free's the given vector.
vec | Vector to free. |
References ALC_ER_NONE, ALC_ER_NULLPTR, AlcFree(), AlcFreeStackFree(), _AlcVector::blocks, and _AlcVector::freeStack.
Referenced by AlcDouble1ReadAsci(), AlcDouble2ReadAsci(), AlcVecReadDouble1Asci(), AlcVecReadDouble2Asci(), AlgMatrixReadAscii(), WlzCMeshCopy2D(), WlzCMeshCopy2D5(), WlzCMeshCopy3D(), WlzCMeshFree2D(), WlzCMeshFree2D5(), WlzCMeshFree3D(), WlzCMeshToDomObjValues(), WlzCopyObject(), WlzEffReadObjObj(), WlzFreeIndexedValues(), WlzGeoModelGridFree3D(), WlzGMModelFindNMEdges(), WlzGMModelFree(), and WlzPointsFromDomObj().
Extend the vector for at least the given number of elements.
vec | Vector to extend. |
elmCnt | Required number of elements. |
References ALC_ER_ALLOC, ALC_ER_NONE, AlcCalloc(), AlcFree(), AlcFreeStackPush(), _AlcVector::blkCnt, _AlcVector::blkSz, _AlcVector::blkUse, _AlcVector::blocks, _AlcVector::elmSz, and _AlcVector::freeStack.
Referenced by AlcVectorExtendAndGet(), WlzCMeshCopy2D(), WlzCMeshCopy2D5(), WlzCMeshCopy3D(), WlzCMeshIntersect2Mesh2D(), WlzCMeshToDomObjValues(), WlzCMeshTransformInvert(), WlzExtendIndexedValues(), and WlzPointsFromDomObj().
void* AlcVectorItemGet | ( | AlcVector * | vec, |
size_t | idx | ||
) |
Gets a pointer to the vector item with the given index.
vec | Vector to extend. |
idx | Given item index. |
References _AlcVector::blkSz, _AlcVector::blkUse, _AlcVector::blocks, and _AlcVector::elmSz.
Referenced by AlgMatrixReadAscii(), nrerror(), WlzAffineTransformGMModel(), WlzAffineTransformIsTranslate(), WlzBasisFnSetCMesh2D(), WlzBasisFnSetCMesh3D(), WlzBasisFnTransformGMModel(), WlzBasisFnValueMOSPhi(), WlzCentreOfMassVtx3D(), WlzCMeshAffineProduct(), WlzCMeshAffineTransformMesh2D(), WlzCMeshAffineTransformMesh2D5(), WlzCMeshAffineTransformMesh3D(), WlzCMeshBoundConform2D(), WlzCMeshBoundConform3D(), WlzCMeshClearElmFlags2D(), WlzCMeshClearElmFlags3D(), WlzCMeshClearNodFlags2D(), WlzCMeshClearNodFlags3D(), WlzCMeshClosePointDom2D5(), WlzCMeshCmpElmFeat2D(), WlzCMeshCmpElmFeat3D(), WlzCMeshCompSurfMap(), WlzCMeshCompSurfMapToDomain(), WlzCMeshComputeCurvaturesFromNodNorm(), WlzCMeshComputeNormalsElm(), WlzCMeshComputeNormalsIxv2D5(), WlzCMeshComputeNormalsNod(), WlzCMeshCopy2D(), WlzCMeshCopy2D5(), WlzCMeshCopy3D(), WlzCMeshCountBoundNodes2D(), WlzCMeshCountBoundNodes2D5(), WlzCMeshCountBoundNodes3D(), WlzCMeshCurvToImage(), WlzCMeshDbgOutVTK2D(), WlzCMeshDbgOutVTK3D(), WlzCMeshDelUnusedNodes2D(), WlzCMeshDelUnusedNodes2D5(), WlzCMeshDelUnusedNodes3D(), WlzCMeshDispToField(), WlzCMeshElmClosestPosIn3D(), WlzCMeshElmUseNod3D(), WlzCMeshExpansion(), WlzCMeshExpValues(), WlzCMeshExtract2D(), WlzCMeshFixNegativeElms2D(), WlzCMeshFixNegativeElms3D(), WlzCMeshFlatten2D5(), WlzCMeshFMarNodes2D(), WlzCMeshFMarNodes3D(), WlzCMeshFromGM(), WlzCMeshGetBoundNodes2D(), WlzCMeshGetBoundNodes2D5(), WlzCMeshGetBoundNodes3D(), WlzCMeshGetNodesAndEdges(), WlzCMeshIntersect2Mesh2D(), WlzCMeshIntersectDom2D5(), WlzCMeshLaplacianSmooth2D(), WlzCMeshLaplacianSmooth3D(), WlzCMeshMeshMeshProduct(), WlzCMeshNextElm2D(), WlzCMeshNextElm3D(), WlzCMeshNextNod2D(), WlzCMeshNextNod3D(), WlzCMeshProduct(), WlzCMeshReassignGridCells2D(), WlzCMeshReassignGridCells2D5(), WlzCMeshReassignGridCells3D(), WlzCMeshSetBoundElmFlags2D(), WlzCMeshSetBoundElmFlags3D(), WlzCMeshSetBoundNodFlags2D(), WlzCMeshSetBoundNodFlags2D5(), WlzCMeshSetBoundNodFlags3D(), WlzCMeshSetDispFromField(), WlzCMeshSetElmIdxTbl2D(), WlzCMeshSetElmIdxTbl2D5(), WlzCMeshSetElmIdxTbl3D(), WlzCMeshSetNodFlags2D(), WlzCMeshSetNodFlags3D(), WlzCMeshSetNodIdxTbl2D(), WlzCMeshSetNodIdxTbl2D5(), WlzCMeshSetNodIdxTbl3D(), WlzCMeshSetVertices2D(), WlzCMeshSetVertices3D(), WlzCMeshStrainTensorAtPts(), WlzCMeshToDomObjValues(), WlzCMeshTransformGetBBox2D(), WlzCMeshTransformGetBBox3D(), WlzCMeshTransformInvert(), WlzCMeshTransformManyObjAsIdx(), WlzCMeshTrRegSM3D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateBBox2D5(), WlzCMeshUpdateBBox3D(), WlzCMeshUpdateMaxSqEdgLen2D(), WlzCMeshUpdateMaxSqEdgLen2D5(), WlzCMeshUpdateMaxSqEdgLen3D(), WlzCMeshValuesNormalise(), WlzCMeshValueTransfer(), WlzCMeshVerify2D(), WlzCMeshVerify3D(), WlzContourGrdObj2D(), WlzCopyValues(), WlzDVerticesFromGM(), WlzEffReadObjEMT(), WlzEffReadObjMesh(), WlzEffReadObjNodeEle(), WlzEffReadObjObj(), WlzEffReadObjVMesh(), WlzEffWriteObjEMT(), WlzEffWriteObjMesh(), WlzEffWriteObjNodeEle(), WlzEffWriteObjObj(), WlzEffWriteObjPly2(), WlzEffWriteObjSMesh(), WlzEffWriteObjStl(), WlzEffWriteObjVMesh(), WlzEffWriteObjVtk(), WlzEffWritePointsVtkFieldValues(), WlzGeometryTrackUpAndDown_s(), WlzGeoModelGridWSpSet3D(), WlzGMFilterFlipOrient(), WlzGMFilterGeomLPLM(), WlzGMModelCopy(), WlzGMModelCutDom(), WlzGMModelFindNMEdges(), WlzGMModelRehashVHT(), WlzGMModelResIdx(), WlzGMModelSetSG(), WlzGMModelSpxStats(), WlzIndexedValueGet(), WlzIndexedValuesSet(), WlzMatchICPWeightMatches(), WlzObjectFacts(), WlzPointsFromDomObj(), WlzReadMeshTransform3D(), WlzShiftValues(), WlzVertexHeapSortIdxFnD3(), WlzWriteMeshTransform3D(), and WlzWriteObj().
void* AlcVectorExtendAndGet | ( | AlcVector * | vec, |
size_t | idx | ||
) |
Extends the vector and gets the vector item with the given index.
vec | Vector to extend. |
idx | Given item index. |
References ALC_ER_NONE, AlcVectorExtend(), _AlcVector::blkSz, _AlcVector::blkUse, _AlcVector::blocks, and _AlcVector::elmSz.
Referenced by AlcVecReadDouble1Asci(), AlcVecReadDouble2Asci(), WlzCMeshAllocElm2D(), WlzCMeshAllocElm2D5(), WlzCMeshAllocElm3D(), WlzCMeshAllocNod2D(), WlzCMeshAllocNod2D5(), WlzCMeshAllocNod3D(), WlzCMeshExtract2D(), WlzCMeshFlatten2D5(), WlzCMeshFromGM(), WlzCMeshToDomObjValues(), WlzEffReadObjEMT(), WlzEffReadObjMesh(), WlzEffReadObjNodeEle(), WlzEffReadObjObj(), WlzEffReadObjVMesh(), WlzEffWritePointsVtkFieldValues(), WlzGeoModelGridWSpSet3D(), WlzGMModelCopy(), WlzGMModelFindNMEdges(), WlzGMModelNewE(), WlzGMModelNewET(), WlzGMModelNewF(), WlzGMModelNewLT(), WlzGMModelNewS(), WlzGMModelNewV(), WlzGMModelNewVT(), WlzIndexedValueExtGet(), and WlzReadMeshTransform3D().
size_t AlcVectorCount | ( | AlcVector * | vec | ) |
Gets the number of elements that the vector can hold before it needs to be extended.
vec | Vector to extend. |
References _AlcVector::blkSz, and _AlcVector::blkUse.
Referenced by WlzCopyIndexedValues().
void AlcVectorSetArray1D | ( | AlcVector * | vec, |
size_t | fIdx, | ||
size_t | lIdx, | ||
void * | aM | ||
) |
Copies elements from the vector into a 1 dimensional array.
vec | Given vector. |
fIdx | Index of the first element in the vector to copy. |
lIdx | Index of the last element in the vector to copy. |
aM | The 1 dimensional array. |
References _AlcVector::blkSz, _AlcVector::blocks, and _AlcVector::elmSz.
Referenced by AlcVectorToArray1D(), AlcVectorToArray2D(), and AlgMatrixReadAscii().
Creates a 1 dimensional array which contains a copy of the vectors elements.
vec | Given vector. |
fIdx | Index of the first element in the vector to copy, becomes the first element of the array. |
lIdx | Index of the last element in the vector to copy, becomes the last element of the array. |
dstErr | Destination pointer for error code, may be NULL. |
References ALC_ER_ALLOC, ALC_ER_NONE, ALC_ER_NULLPTR, ALC_ER_PARAM, AlcCalloc(), AlcVectorSetArray1D(), and _AlcVector::elmSz.
Referenced by AlcDouble1ReadAsci().
Creates a 2 dimensional array which contains a copy of the vectors elements.
vec | Given vector. |
nR | Number of rows (1D arrays). |
nC | Number of columns (elements in each 1D array). |
dstErr | Destination pointer for error code, may be NULL. |
References ALC_ER_NONE, ALC_ER_NULLPTR, ALC_ER_PARAM, AlcCalloc(), AlcFree(), AlcMalloc(), AlcVectorSetArray1D(), and _AlcVector::elmSz.
Referenced by AlcDouble2ReadAsci(), and AlgMatrixReadAscii().
AlcVector* AlcVecReadDouble1Asci | ( | FILE * | fP, |
const char * | fSep, | ||
size_t | recMax, | ||
size_t * | dstNV, | ||
AlcErrno * | dstErr | ||
) |
Reads a 1D double array from the given numeric ASCI file. Each value should be on a seperate line.
fP | File pointer. |
fSep | Field seperator chracter string. If NULL whitespace assumed. |
recMax | Maximum record length. |
dstNV | Destination pointer for the number of vector values. Must not be NULL. |
dstErr | Destination error pointer, may be NULL. |
References ALC_ER_ALLOC, ALC_ER_NONE, ALC_ER_READ, AlcFree(), AlcMalloc(), AlcVectorExtendAndGet(), AlcVectorFree(), and AlcVectorNew().
Referenced by AlcDouble1ReadAsci().
AlcVector* AlcVecReadDouble2Asci | ( | FILE * | fP, |
const char * | fSep, | ||
size_t | recMax, | ||
size_t * | dstNR, | ||
size_t * | dstNC, | ||
AlcErrno * | dstErr | ||
) |
Reads a 2D double array from the given numeric ASCI file into an extensible vector. The number of fields per record must be the same for all records.
fP | File pointer. |
fSep | Field seperator chracter string. If NULL whitespace assumed. |
recMax | Maximum record length. |
dstNR | Destination pointer for the number of rows (records) read. Must not be NULL. |
dstNC | Destination pointer for the number of columns, ie the number of elements in each 1D array (number of fields per record). Must not be NULL. |
dstErr | Destination error pointer, may be NULL. |
References ALC_ER_ALLOC, ALC_ER_NONE, ALC_ER_READ, AlcFree(), AlcMalloc(), AlcVectorExtendAndGet(), AlcVectorFree(), and AlcVectorNew().
Referenced by AlcDouble2ReadAsci(), and AlgMatrixReadAscii().