FunctionRead a vector in binary format from a stream
Syntax C/C++#include <VFstd.h>
int VF_recall( fVector X, ui size, FILE *stream );
C++ VecObj#include <OptiVec.h>
int vector<T>::recall( FILE *stream );
Pascal/Delphiuses VFstd;
function VF_recall( X:fVector; size:UIntSize; var Stream:FILE );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_recall( fVector d_X, ui size, FILE *stream );
int cudaVF_recall_buf( fVector d_X, ui size, FILE *stream, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_recall( X:fVector; size:UIntSize; var Stream:FILE ): IntBool;
function cudaVF_recall_buf( X:fVector; size:UIntSize; var Stream:FILE; h_Wk:fVector ): IntBool;
Descriptionsize elements of X are read from stream in binary format. Normally, these functions are used to retrieve data stored by the respective function of the VF_store family. The data type for reading and writing has to be the same. It is not possible to, e.g., store data by VF_store and recall them by VD_recall (in contrast to the corresponding write/read functions in ASCII format, see VF_read).

The VecObj version differs from the "normal" C/C++ version in that it reads vector objects, not only the vector elements. It first reads a ui, giving the size of the vector, and then size elements, whereas the V?_recall functions assume size as known and take it as an argument. Therefore, the VecObj function recall can be used only to read vector objects previously stored with the VecObj function store, but not vectors stored with one of the V?_store functions.

CUDA versions only: cudaV?_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 X. By avoiding the need of cudaV?_recall to allocate its own buffer memory, cudaV?_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 VE_store / VE_recall, VCE_store / VCE_recall, and VPE_store / VPE_recall pairs always use 10-byte storage on disk.

Thread safetyDifferent 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 handlingError handling is performed by the C function fread or the Delphi function BlockRead, on which VF_recall etc. are based.
Return value0, if successful; otherwise 1. In order to obtain more information, inspect errno (C/C++) or IOResult (Delphi).
See alsoVF_store,   VF_write,   VF_print,   fwrite,   fread

VectorLib Table of Contents  OptiVec home