MF_matrix MD_matrix ME_matrix
MCF_matrix MCD_matrix MCE_matrix
FunctionMemory allocation for a matrix
Syntax C/C++#include <MFstd.h>
fMatrix MF_matrix( ui ht, ui len );
Pascal/Delphiuses MFstd;
function MF_matrix( ht, len:UIntSize ): fMatrix;
CUDA function C/C++#include <cudaMFstd.h>
fMatrix cudaMF_matrix( ui ht, ui len );
CUDA function Pascal/Delphiuses MFstd;
function cudaMF_matrix( ht, len:UIntSize ): fMatrix;
DescriptionBased on memory model and environment, the most appropriate allocation procedure is chosen by these functions. Failure to allocate memory always leads to an error message and a subsequent program abort (similar to the error handling of the "new" operator). To release the memory thus allocated, M_free,  M_nfree, or V_freeAll should be used (M_nfree only in C/C++).
For matrices generated by cudaM?_matrix, use cudaM_free,  cudaM_nfree, or cudaV_freeAll.
Note: the declaration of a matrix (e.g., as fMatrix) reserves only a name, but no memory!
See chapter 4.1 if you are interested in details of the implementation.
Error handlingIf there is not enough memory available, or if size is zero, an error message "Not enough memory" is displayed and the program aborted.
If more than 4 GB of memory are requested, an error message "Vector > 4 GB not possible" is displayed and the program aborted. If already a single matrix dimensions exceeds this limit, an error message "Invalid matrix dimension(s)" is displayed and the program aborted.
Return valueC/C++: Pointer to the array of row pointers
Pascal/Delphi: Pointer to the allocated memory
See alsoMF_matrix0,   VF_vector,   cudaMF_pinnedMatrix,   chapter 2

MatrixLib Table of Contents  OptiVec home