MF_write MD_write ME_write
MCF_write MCD_write MCE_write
Functionwrite a matrix in ASCII format into a stream
Syntax C/C++#include <MFstd.h>
void MF_write( FILE *stream, fMatrix MA, ui ht, ui len );
C++ MatObj#include <OptiVec.h>
void matrix<T>::write( FILE *stream  );
Pascal/Delphiuses MFstd;
  procedure MF_write( var Stream:TextFile; MA:fMatrix; ht, len:UIntSize );
CUDA function C/C++#include <cudaMFstd.h>
int cudaMF_write( FILE *stream, fMatrix d_MA, ui ht, ui len );
int cudaMF_write_buf( FILE *stream, fMatrix d_MA, ui ht, ui len, fVector h_Wk );
CUDA function Pascal/Delphiuses MFstd;
function cudaMF_write( var Stream:TextFile; d_MA:fMatrix; ht, len:UIntSize ): IntBool;
function cudaMF_write_buf( var Stream:TextFile; d_MA:fMatrix; ht, len:UIntSize; h_Wk:fVector ): IntBool;
DescriptionThe matrix MA with len columns and ht rows is written to stream in ASCII format. stream must already be open for write operations in text format.

The number format and the separation between columns may be specified using MF_setWriteFormat (C/C++ only) and MF_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 MF_store / MF_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: cudaM?_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 d_MA, i.e. ht*len. By avoiding the need of cudaM?_write to allocate its own buffer memory, cudaM?_write_buf is slightly faster.

Error handlingnone
See alsoMF_setWriteFormat,   MF_setWriteSeparate,   MF_read,   MF_store,   MF_print,   chapter 14

MatrixLib Table of Contents  OptiVec home