Woolz Image Processing  Version 1.8.3
AlgMatrix.c File Reference

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. More...
 
AlgMatrixRectAlgMatrixRectNew (size_t nR, size_t nC, AlgError *dstErr)
 Allocates a new rectangular matrix. More...
 
void AlgMatrixFree (AlgMatrix mat)
 Frees a matrix. More...
 
void AlgMatrixRectFree (AlgMatrixRect *mat)
 Frees a rectangular matrix. More...
 
AlgMatrixSymAlgMatrixSymNew (size_t nN, AlgError *dstErr)
 Allocates a new symmetric matrix. More...
 
void AlgMatrixSymFree (AlgMatrixSym *mat)
 Frees a symmetric matrix. More...
 
AlgMatrixLLRAlgMatrixLLRNew (size_t nR, size_t nC, size_t nE, double tol, AlgError *dstErr)
 Allocates a new linked list row matrix. More...
 
void AlgMatrixLLRFree (AlgMatrixLLR *mat)
 Frees a linked list row matrix. More...
 
AlgMatrixLLREAlgMatrixLLRENew (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(). More...
 
void AlgMatrixLLREFree (AlgMatrixLLR *mat, AlgMatrixLLRE *p)
 Returns a linked list row matrix entry to the free stack of the matrix. More...
 
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. More...
 
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. More...
 
AlgError AlgMatrixSet (AlgMatrix mat, size_t row, size_t col, double val)
 
AlgError AlgMatrixLLRCopyInPlace (AlgMatrixLLR *aM, AlgMatrixLLR *bM)
 Copy the second LLR matrix to the first. More...
 
AlgError AlgMatrixLLRSet (AlgMatrixLLR *mat, size_t row, size_t col, double val)
 This can have one of three actions: More...
 
double AlgMatrixValue (AlgMatrix mat, size_t row, size_t col)
 Returns the value in the matrix at the given coordinates. More...
 
double AlgMatrixLLRValue (AlgMatrixLLR *mat, size_t row, size_t col)
 Returns the value in the matrix at the given coordinates. More...
 
AlgError AlgMatrixLLRExpand (AlgMatrixLLR *mat, size_t nE)
 Ensures that there are at least the requested number of free linked list row matrix entries available. More...
 
void AlgMatrixZero (AlgMatrix mat)
 Sets all elements of the matrix to zero. More...
 
void AlgMatrixRectZero (AlgMatrixRect *mat)
 Sets all elements of the matrix to zero. More...
 
void AlgMatrixSymZero (AlgMatrixSym *mat)
 Sets all elements of the matrix to zero. More...
 
void AlgMatrixLLRZero (AlgMatrixLLR *mat)
 Sets all elements of the matrix to zero. More...
 
AlgError AlgMatrixSetAll (AlgMatrix mat, double val)
 Sets all elements of the given matrix to the given value. More...
 
void AlgMatrixRectSetAll (AlgMatrixRect *mat, double val)
 Sets all elements of the given rectangular matrix to the given value. More...
 
void AlgMatrixSymSetAll (AlgMatrixSym *mat, double val)
 Sets all elements of the given symmetric matrix to the given value. More...
 
AlgError AlgMatrixLLRSetAll (AlgMatrixLLR *mat, double val)
 Sets all elements of the given linked list row matrix to the given value. This is not an efficient use of a linked list row matrix since all values will be allocate and set. More...
 
void AlgMatrixLLRERemove (AlgMatrixLLR *mat, size_t row, size_t col)
 Removes the entry at the given coordinates. More...
 

Detailed Description

Matrix allocation and maintenance functions.

Author
Bill Hill
Date
October 2010
Version
Id
967f94f4874425287814eb2c7a1daaff439d70f7
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

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.

Function Documentation

◆ AlgMatrixFree()

◆ AlgMatrixRectFree()

void AlgMatrixRectFree ( AlgMatrixRect mat)

Frees a rectangular matrix.

Parameters
matRectangular matrix.

References AlcDouble2Free(), AlcFree(), and _AlgMatrixRect::array.

Referenced by AlgMatrixFree(), AlgMatrixSVSolve(), AlgPolynomialLSq(), and WlzFitPlaneSVD().

◆ AlgMatrixSymFree()

void AlgMatrixSymFree ( AlgMatrixSym mat)

Frees a symmetric matrix.

Parameters
matsymmetric matrix.

References AlcDouble2Free(), AlcFree(), and _AlgMatrixSym::array.

Referenced by AlgMatrixFree().

◆ AlgMatrixLLRFree()

void AlgMatrixLLRFree ( AlgMatrixLLR mat)

Frees a linked list row matrix.

Parameters
matLinked list row matrix.

References AlcFree(), AlcFreeStackFree(), _AlgMatrixLLR::blk, and _AlgMatrixLLR::tbl.

Referenced by AlgMatrixFree(), and AlgMatrixLLRNew().