Functionprint a vector to a stream
Syntax C/C++#include <VFstd.h>
void VF_fprint( FILE *stream, fVector X, ui size, unsigned nperline, unsigned linewidth );
C++ VecObj#include <OptiVec.h>
void vector<T>::fprint( FILE *stream, unsigned nperline, unsigned linewidth );
Pascal/Delphiuses VFstd;
procedure VF_fprint( var Stream:Text; X:fVector; size:UIntSize; nperline, linewidth:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_fprint( FILE *stream, fVector d_X, ui size, unsigned nperline, unsigned linewidth );
int cudaVF_fprint_buf( FILE *stream, fVector d_X, ui size, unsigned nperline, unsigned linewidth, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_fprint( var Stream:Text; d_X:fVector; size:UIntSize; nperline, linewidth:UInt ): IntBool;
function cudaVF_fprint_buf( var Stream:Text; d_X:fVector; size:UIntSize; nperline, linewidth:UInt; h_Wk:fVector ): IntBool;
Descriptionsize elements of X are written to stream, nperline in each line of linewidth characters.

Printing starts always with a new line. This may lead to an empty line at the beginning. Especially the first line of a file is reserved for a possible headline.

Each line begins with the index of the first element printed into that line. The index is followed by a colon and by the requested nperline elements.
Cartesian complex numbers are printed in braces, with the real and imaginary parts separated by a komma: {Re, Im}. Polar complex numbers are also written in braces, with the Mag and Arg parts separated by an at-sign: {Mag @ Arg}.

In contrast to VF_write and VF_nwrite, it is not possible to override the automatic choice of the format used for printing. The number of digits per element is determined by the available space, which depends in turn on the parameters nperline and linewidth.

CUDA versions only:cudaV?_fprint_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?_fprint to allocate its own buffer memory, cudaV?_fprint_buf is slightly faster.
GCC Windows specific:In principle, the Windows port of GCC supports the 80-bit floating point type long double. However, the I/O routines rely on the runtime libraries of Visual C++, where 80-bit reals have disappeared a long time ago. This means that VE_fprint, VCE_fprint, and VPE_fprint work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX.
Error handlingif nperline exceeds the maximum number of entries possible for the linewidth chosen, an error message "Cannot use requested format (too many entries per line)!" is generated; in this case, the program chooses the maximum possible number nperline.
Return valuenone
See alsoVF_cprint,   VF_print,   VF_write,   VF_store,   fprintf

VectorLib Table of Contents  OptiVec home