34 template<
class Form,
class Type>
45 template<
class Form,
class Type>
50 os << Form::typeName() <<
" ";
57 template<
class Form,
class Type>
63 is.fatalCheck(
"operator>>(Istream&, Matrix<Form, Type>&)");
69 "operator>>(Istream&, Matrix<Form, Type>&) : reading first token"
72 if (firstToken.isCompound())
78 firstToken.transferCompoundToken(is)
82 else if (firstToken.isLabel())
84 M.mRows_ = firstToken.labelToken();
93 char listDelimiter = is.readBeginList(
"Matrix");
105 for (
label i=0; i<
M.m(); i++)
107 listDelimiter = is.readBeginList(
"MatrixRow");
109 for (
label j=0; j<
M.n(); j++)
115 "operator>>(Istream&, Matrix<Form, Type>&) : "
120 is.readEndList(
"MatrixRow");
130 "operator>>(Istream&, Matrix<Form, Type>&) : "
131 "reading the single entry"
134 for (
label i=0; i<mn; i++)
142 is.readEndList(
"Matrix");
151 is.read(
reinterpret_cast<char*
>(v), mn*
sizeof(Type));
155 "operator>>(Istream&, Matrix<Form, Type>&) : "
156 "reading the binary block"
164 <<
"incorrect first token, expected <int>, found "
173 template<
class Form,
class Type>
185 bool uniform =
false;
187 const Type* v =
M.v_;
189 if (mn > 1 && contiguous<Type>())
193 for (
label i=0; i<mn; i++)
214 else if (mn < 10 && contiguous<Type>())
222 for (
label i=0; i<
M.m(); i++)
227 for (
label j=0; j<
M.n(); j++)
247 for (
label i=0; i<
M.m(); i++)
252 for (
label j=0; j<
M.n(); j++)
273 os.write(
reinterpret_cast<const char*
>(
M.v_), mn*
sizeof(Type));
278 os.check(
"Ostream& operator<<(Ostream&, const Matrix&)");
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A templated (m x n) matrix of objects of <T>.
Matrix()
Null constructor.
friend Istream & operator>>(Istream &, mType &)
Read Matrix from Istream, discarding contents of existing Matrix.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static bool isCompound(const word &name)
Return true if name is a compound type.
Template function to specify if the data of a type are contiguous.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
To & dynamicCast(From &r)
Reference type cast template function,.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Istream & operator>>(Istream &, pistonPointEdgeData &)
label readLabel(Istream &is)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)