34 template<
class Form,
class Type>
45 template<
class Form,
class Type>
51 is.
fatalCheck(
"operator>>(Istream&, Matrix<Form, Type>&)");
57 "operator>>(Istream&, Matrix<Form, Type>&) : reading first token" 65 label mn = M.mRows_*M.nCols_;
83 for (
label i=0; i<M.
m(); i++)
87 for (
label j=0; j<M.
n(); j++)
93 "operator>>(Istream&, Matrix<Form, Type>&) : " 108 "operator>>(Istream&, Matrix<Form, Type>&) : " 109 "reading the single entry" 112 for (
label i=0; i<mn; i++)
129 is.
read(reinterpret_cast<char*>(v), mn*
sizeof(Type));
133 "operator>>(Istream&, Matrix<Form, Type>&) : " 134 "reading the binary block" 142 <<
"incorrect first token, expected <int>, found " 151 template<
class Form,
class Type>
152 Foam::Ostream& Foam::operator<<(Ostream& os, const Matrix<Form, Type>&
M)
154 label mn = M.mRows_*M.nCols_;
165 const Type*
v = M.v_;
167 if (mn > 1 && contiguous<Type>())
171 for (
label i=0; i<mn; i++)
192 else if (mn < 10 && contiguous<Type>())
200 for (
label i=0; i<M.
m(); i++)
205 for (
label j=0; j< M.
n(); j++)
225 for (
label i=0; i<M.
m(); i++)
230 for (
label j=0; j< M.
n(); j++)
251 os.write(reinterpret_cast<const char*>(M.v_), mn*
sizeof(Type));
256 os.check(
"Ostream& operator<<(Ostream&, const Matrix&)");
streamFormat format() const
Return current stream format.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
char readEndList(const char *funcName)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds items read from Istream.
Template function to specify if the data of a type are contiguous.
label m() const
Return the number of rows.
label k
Boltzmann constant.
Matrix()
Null constructor.
label n() const
Return the number of columns.
virtual Istream & read(token &)=0
Return next token from stream.
Istream & operator>>(Istream &, directionInfo &)
char readBeginList(const char *funcName)
void clear()
Clear the Matrix, i.e. set sizes to zero.
label readLabel(Istream &is)
const Type * v() const
Return element vector of the constant Matrix.
A templated (m x n) matrix of objects of <T>.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
InfoProxy< token > info() const
Return info proxy.
friend Istream & operator>>(Istream &, mType &)
Read Matrix from Istream, discarding contents of existing Matrix.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.