|Function||Write a vector in ASCII format to a stream.|
|Syntax C/C++||#include <VFstd.h>
void VF_write( FILE *stream, fVector X, ui size );
|C++ VecObj||#include <OptiVec.h>
void vector<T>::write( FILE *stream );
procedure VF_write( var Stream:Text; X:fVector; size:UIntSize );
|CUDA function C/C++||#include <cudaVFstd.h>
int cudaVF_write( FILE *stream, fVector d_X, ui size );
int cudaVF_write_buf( FILE *stream, fVector d_X, ui size, fVector h_Wk );
|CUDA function Pascal/Delphi||uses VFstd;
function cudaVF_write( var Stream:Text; d_X:fVector; size:UIntSize ): IntBool;
function cudaVF_write_buf( var Stream:Text; d_X:fVector; size:UIntSize; h_Wk:fVector ): IntBool;
|Description||size elements of X are written to stream in ASCII format. By default, one element is written per line. To use these functions, stream must already be open for write operations in text format.
The number format and the separation of consecutive elements may be specified using VF_setWriteFormat (C/C++ only) and VF_setWriteSeparate, respectively. See these functions for details.
Storing data in ASCII format is useful if the data have to be readable by human eyes, or if they are to be exported into other programs which are not able to read machine-format numbers. If avoidable, these functions should not be used for the storage of intermediate results that later have again to be read in. Instead, the function pairs of the VF_store / VF_recall family are recommended for the following reasons: conversion into ASCII format is slow, may lead to round-off errors, and requires much more disk memory than storage in machine format.
|CUDA versions only:||cudaV?_write_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?_write to allocate its own buffer memory, cudaV?_write_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_write, VCE_write, and VPE_write work only with double precision and, more importantly, within double range. Input numbers outside double range are treated as ±DBL_MAX.|
VectorLib Table of Contents OptiVec home