39template<
class Form,
class Type>
52template<
class Form,
class Type>
62 is.
fatalCheck(
"readMatrix : reading first token");
71 const label len = size();
79 Detail::readContiguous<Type>
86 is.
fatalCheck(
"readMatrix : reading the binary block");
102 for (label i = 0; i < mRows_; ++i)
106 for (label j = 0; j < nCols_; ++j)
120 is.
fatalCheck(
"readMatrix : reading the single entry");
122 std::fill(begin(), end(), element);
134 <<
"incorrect first token, expected <int>, found "
135 << firstToken.
info() <<
nl
142template<
class Form,
class Type>
152 const label len = mat.
size();
171 const Type* v = mat.
cdata();
187 for (label i = 0; i < mat.
nRows(); ++i)
192 for (label j = 0; j < mat.
nCols(); ++j)
212 for (label i=0; i < mat.
nRows(); ++i)
217 for (label j = 0; j < mat.
nCols(); ++j)
219 os <<
nl << v[idx++];
streamFormat format() const noexcept
Get the current stream format.
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
char readEndList(const char *funcName)
End read of list data, ends with ')' or '}'.
char readBeginList(const char *funcName)
Begin read of list data, starts with '(' or '{'.
A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:
const Type * cdata() const noexcept
bool readMatrix(Istream &is)
Read Matrix from Istream, discarding existing contents.
Ostream & writeMatrix(Ostream &os, const label shortLen=0) const
label size() const
The number of elements in Matrix (m*n)
label nCols() const noexcept
The number of columns - same as n()
label nRows() const noexcept
The number of rows - same as m()
bool uniform() const
True if all entries have identical values, and Matrix is non-empty.
const char * cdata_bytes() const noexcept
Matrix() noexcept
Default construct (empty matrix)
std::streamsize size_bytes() const noexcept
virtual Ostream & write(const char c)
Write character.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A token holds an item read from Istream.
@ BEGIN_BLOCK
Begin block [isseparator].
@ END_BLOCK
End block [isseparator].
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
bool isLabel() const noexcept
Token is LABEL.
label labelToken() const
Return label value.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
A template class to specify that a data type can be considered as being contiguous in memory.