Functionprint a vector to the screen. Only for console applications
Syntax C/C++#include <VFstd.h>
void VF_cprint( fVector X, ui size, unsigned nperline );
C++ VecObj#include <OptiVec.h>
void vector<T>::cprint( unsigned nperline );
Pascal/Delphiuses VFstd;
procedure VF_cprint( X:fVector; size:UIntSize; nperline:UInt );
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_cprint( fVector d_X, ui size, unsigned nperline );
int cudaVF_cprint_buf( fVector d_X, ui size, unsigned nperline, fVector h_Wk );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_cprint( d_X:fVector; size:UIntSize; nperline:UInt ): IntBool;
function cudaVF_cprint_buf( d_X:fVector; size:UIntSize; nperline:UInt; h_Wk:fVector ): IntBool;
DescriptionWindows with Borland / Embarcadero compilers or MS Visual C++, DLL runtime:
size elements of X are printed to the screen (or "console"), into the actual text window, nperline elements in each line.
The display starts always with a new line. Please note that this may lead to an empty line at the beginning.
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}.
The display pauses every screenful. The user is prompted after each page to continue or to stop printing.
The number of digits per element is determined by the available space, which depends in turn on the line width and on the parameter nperline.

This family of functions is available only for console applications.

CUDA versions only:cudaV?_cprint_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?_cprint to allocate its own buffer memory, cudaV?_cprint_buf is slightly faster.
Other Windows compilers as well as Linux: As here the width and height of the text window are not easily available, calls to V?_cprint are redirected to VF_print.
The same is true for Visual C++ with static runtime (here for the reason of version-to-version incompatibilities).
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_cprint, VCE_cprint, and VPE_cprint work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX. There is, however, a possibility to get a full-accuracy readout at least in hexadecimal format. To this end, call VE_chexprint etc.
Error handlingIf nperline exceeds the maximum number of entries possible in the current text mode, 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_fprint,   VF_print,   VF_write,   VF_store,   cprintf

VectorLib Table of Contents  OptiVec home