Woolz Image Processing Version 1.4.0
|
Matrix allocation and maintenance functions. More...
Functions | |
AlgMatrix | AlgMatrixNew (AlgMatrixType aType, size_t nR, size_t nC, size_t nE, double tol, AlgError *dstErr) |
Allocates a new matrix or the requested type. | |
AlgMatrixRect * | AlgMatrixRectNew (size_t nR, size_t nC, AlgError *dstErr) |
Allocates a new rectangular matrix. | |
void | AlgMatrixFree (AlgMatrix mat) |
Frees a matrix. | |
void | AlgMatrixRectFree (AlgMatrixRect *mat) |
Frees a rectangular matrix. | |
AlgMatrixSym * | AlgMatrixSymNew (size_t nN, AlgError *dstErr) |
Allocates a new symmetric matrix. | |
void | AlgMatrixSymFree (AlgMatrixSym *mat) |
Frees a symmetric matrix. | |
AlgMatrixLLR * | AlgMatrixLLRNew (size_t nR, size_t nC, size_t nE, double tol, AlgError *dstErr) |
Allocates a new linked list row matrix. | |
void | AlgMatrixLLRFree (AlgMatrixLLR *mat) |
Frees a linked list row matrix. | |
AlgMatrixLLRE * | AlgMatrixLLRENew (AlgMatrixLLR *mat) |
Gets a linked list row matrix entry from the matrix. The return value may be NULL if none are available and the entries need to be expanded sing AlgMatrixLLRExpand(). | |
void | AlgMatrixLLREFree (AlgMatrixLLR *mat, AlgMatrixLLRE *p) |
Returns a linked list row matrix entry to the free stack of the matrix. | |
AlgError | AlgMatrixWriteAscii (AlgMatrix mat, FILE *fP) |
Writes a matrix in numeric ASCI format to the given file file. The rows are on separate lines and the columns of each row are white space seperated. | |
AlgMatrix | AlgMatrixReadAscii (AlgMatrixType mType, double tol, FILE *fP, const char *fSep, size_t recMax, AlgError *dstErr) |
Reads a matrix of the requested type from an ASCII file. If the type is ALG_MATRIX_SYM then only the first half of each row will be used, although all must be given. | |
AlgError | AlgMatrixSet (AlgMatrix mat, size_t row, size_t col, double val) |
AlgError | AlgMatrixLLRCopyInPlace (AlgMatrixLLR *aM, AlgMatrixLLR *bM) |
AlgError | AlgMatrixLLRSet (AlgMatrixLLR *mat, size_t row, size_t col, double val) |
This can have one of three actions: 1. If no value exists at the given coordinates then the new value is added with a new entry. 2. If a value exists at the given coordinate and the given value is non-zero then the entry value is replaced with the given value. 3. If a value exists at the given coordinate and the given value is zero then the corresponding entry is removed. Errors can only occur because of a memory allocation failure. These can be avoided by preallocating sufficient entries using AlgMatrixLLRExpand(). | |
double | AlgMatrixValue (AlgMatrix mat, size_t row, size_t col) |
Returns the value in the matrix at the given coordinates. | |
double | AlgMatrixLLRValue (AlgMatrixLLR *mat, size_t row, size_t col) |
Returns the value in the matrix at the given coordinates. | |
AlgError | AlgMatrixLLRExpand (AlgMatrixLLR *mat, size_t nE) |
Ensures that there are at least the requested number of free linked list row matrix entries available. | |
void | AlgMatrixRectZero (AlgMatrixRect *mat) |
Sets all elements of the matrix to zero. | |
void | AlgMatrixSymZero (AlgMatrixSym *mat) |
Sets all elements of the matrix to zero. | |
void | AlgMatrixLLRZero (AlgMatrixLLR *mat) |
Sets all elements of the matrix to zero. | |
void | AlgMatrixLLRERemove (AlgMatrixLLR *mat, size_t row, size_t col) |
Removes the entry at the given coordinates. |
Matrix allocation and maintenance functions.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
void AlgMatrixFree | ( | AlgMatrix | mat | ) |
Frees a matrix.
mat | Given matrix. |
References ALG_MATRIX_LLR, ALG_MATRIX_RECT, ALG_MATRIX_SYM, AlgMatrixLLRFree(), AlgMatrixRectFree(), AlgMatrixSymFree(), _AlgMatrix::core, _AlgMatrix::llr, _AlgMatrix::rect, _AlgMatrix::sym, and _AlgMatrixCore::type.
Referenced by AlgMatrixReadAscii(), WlzAffineTransformLSqDQ2D(), WlzAffineTransformLSqDQ3D(), WlzAffineTransformLSqGen2D(), WlzAffineTransformLSqGen3D(), WlzAffineTransformLSqReg2D(), WlzAffineTransformLSqReg3D(), WlzBasisFnConf2DFromCPts(), WlzBasisFnGauss2DFromCPts(), WlzBasisFnIMQ2DFromCPts(), WlzBasisFnIMQ3DFromCPts(), WlzBasisFnMQ2DFromCPts(), WlzBasisFnMQ3DFromCPts(), WlzBasisFnPoly2DFromCPts(), WlzBasisFnScalarMOS3DFromCPts(), WlzBasisFnTPS2DFromCPts(), WlzCMeshCompSurfMapIdx(), WlzCMeshMeshMeshProduct(), WlzGeomCurvature(), WlzGeometryLSqOPlane(), and WlzMakeAffine3D4pointsTrFn().
void AlgMatrixRectFree | ( | AlgMatrixRect * | mat | ) |
Frees a rectangular matrix.
mat | Rectangular matrix. |
References AlcDouble2Free(), AlcFree(), and _AlgMatrixRect::array.
Referenced by AlgMatrixFree(), AlgMatrixSVSolve(), and AlgPolynomialLSq().
void AlgMatrixSymFree | ( | AlgMatrixSym * | mat | ) |
Frees a symmetric matrix.
mat | symmetric matrix. |
References AlcDouble2Free(), AlcFree(), and _AlgMatrixSym::array.
Referenced by AlgMatrixFree().
void AlgMatrixLLRFree | ( | AlgMatrixLLR * | mat | ) |
Frees a linked list row matrix.
mat | Linked list row matrix. |
References AlcFree(), AlcFreeStackFree(), _AlgMatrixLLR::blk, and _AlgMatrixLLR::tbl.
Referenced by AlgMatrixFree(), and AlgMatrixLLRNew().
AlgError AlgMatrixLLRCopyInPlace | ( | AlgMatrixLLR * | aM, |
AlgMatrixLLR * | bM | ||
) |
References ALG_ERR_NONE, AlgMatrixLLRENew(), AlgMatrixLLRExpand(), AlgMatrixLLRZero(), _AlgMatrixLLRE::col, _AlgMatrixLLR::nR, _AlgMatrixLLR::numEnt, _AlgMatrixLLRE::nxt, _AlgMatrixLLR::tbl, and _AlgMatrixLLRE::val.
Referenced by AlgMatrixCopy().