M?_write: C/C++ only! (OptiVec matrix function)">M?_write:, C/C++, only!">
MF_setWriteFormat MD_setWriteFormat ME_setWriteFormat
MCF_setWriteFormat MCD_setWriteFormat MCE_setWriteFormat
FunctionDefinition of the format to be used by M?_write: C/C++ only!
Syntax C/C++#include <MFstd.h>
void MF_setWriteFormat( char *FormatString );
C++ MatObj#include <OptiVec.h>
void matrix<T>::setWriteFormat( char *FormatString );
Pascal/DelphiThis function does not exist.
DescriptionThese functions are identical to the VF_setWriteFormat family.
The number format with which the M?_write functions print matrix elements into a stream can be adjusted by means of this function. When defining a write format, one should always be aware of the restrictions imposed by the read functions (not all formats you can write will be read correcly, see MF_read).

MF_setWriteFormat should not be used for the definition of whitespace between the columns. This is the task of MF_setWriteSeparate.

For details about the formats used for each of the various data types, please refer to the following table. The last column of this table gives the maximum length of the format string.

VersionStandard FormatAlternative Examplemax. length
MF_"% 11.8e""% 8.4f"16
MD_"% 19.16le""% 16.8lf"16
ME_"% 22.19Le""% 22.19LG"16
MCF_"% 11.8e, % 11.8e""{% 8.4f, % 8.4f}"32
MCD_"% 19.16le, % 19.16le""{% 19.16lE % 19.16lE}"32
MCE_"% 22.19Le, % 22.19Le""{% 22.19Lg % 22.19Lg}"32

Error handlingFormat strings longer than the maximum length specified in the above table lead to a program abort with the error message "Invalid Parameter(s)".
The contents of the format string is not checked. So you have to be very careful to specify a format which is valid for the respective data type.
See alsoMF_setWriteSeparate,   MF_write,   VF_write,   MF_read,   chapter 14

MatrixLib Table of Contents  OptiVec home