MF_recall
| MD_recall |
ME_recall |
MCF_recall |
MCD_recall |
MCE_recall |
MI_recall | MBI_recall | MSI_recall | MLI_recall | MQI_recall |
MU_recall | MUB_recall | MUS_recall | MUL_recall | MUQ_recall |
|
Function | Read a matrix in binary format from a stream |
|
Syntax C/C++ | #include <MFstd.h>
int MF_recall( fMatrix MA, ui ht, ui len, FILE *stream); |
C++ MatObj | #include <OptiVec.h>
int matrix<T>::recall( FILE *stream ); |
Pascal/Delphi | uses MFstd;
function MF_recall( MA:fMatrix; ht, len:UIntSize; var Stream:FILE ): Integer; |
|
CUDA function C/C++ | #include <cudaMFstd.h>
int cudaMF_recall( fMatrix d_MA, ui ht, ui len, FILE *stream );
int cudaMF_recall_buf( fMatrix d_MA, ui ht, ui len, FILE *stream, fVector h_Wk );
|
CUDA function Pascal/Delphi | uses MFstd;
function cudaMF_recall( d_MA:fMatrix; ht, len:UIntSize; var Stream:File ): IntBool;
function cudaMF_recall_buf( d_MA:fMatrix; ht, len:UIntSize; var Stream:File; h_Wk:fVector ): IntBool;
|
|
Description | The matrix MA of ht*len elements is read from stream in binary format. Normally, these functions are used to retrieve data stored by the respective function of the MF_store family.
In C/C++, matrices are stored by rows, where as Pascal/Delphi and Fortran work with matrices stored by columns. This means that you will get the transpose of a matrix stored by a C/C++ program, if you read it with a Pascal/Delphi program, and vice versa. In this case, simply call
MF_transpose( MA, MA, ht, len );.
CUDA versions only: cudaM?_recall_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as d_MA, i.e. ht*len. By avoiding the need of cudaM?_recall to allocate its own buffer memory, cudaM?_recall_buf is slightly faster.
GCC and CLang only: GCC and CLang (including BCC32C) pad the 10-byte data type long double to 12 or 16 bytes in memory (12 byte in 32-bit, 16 byte in 64 bit). In order to maintain compatibility of the generated data files between compilers, the ME_store / ME_recall and MCE_store / MCE_recall pairs always use 10-byte storage on disk. |
|
Thread safety | Different threads may safely call any functions of the VF_ / MF_store and VF_ / MF_recall families simultaneously, as long as the refer to different streams. If they have to access one and the same stream, however, the user must take appropriate measures (critical sections, mutexes), in order to prevent race conditions. |
|
Error handling | Error handling is performed by the C function fread or the Delphi function BlockRead, on which MF_recall etc. are based. |
|
Return value | 0, if successful; otherwise 1. In order to obtain more information, inspect errno (C/C++) or IOResult (Delphi). |
|
|