34 template<
class Form,
class Type>
45 template<
class Form,
class Type>
53 template<
class Form,
class Type>
59 is.fatalCheck(
"operator>>(Istream&, Matrix<Form, Type>&)");
65 "operator>>(Istream&, Matrix<Form, Type>&) : reading first token"
68 if (firstToken.isCompound())
74 firstToken.transferCompoundToken(is)
78 else if (firstToken.isLabel())
80 M.mRows_ = firstToken.labelToken();
89 char listDelimiter = is.readBeginList(
"Matrix");
101 for (
label i=0; i<
M.m(); i++)
103 listDelimiter = is.readBeginList(
"MatrixRow");
105 for (
label j=0; j<
M.n(); j++)
111 "operator>>(Istream&, Matrix<Form, Type>&) : "
116 is.readEndList(
"MatrixRow");
126 "operator>>(Istream&, Matrix<Form, Type>&) : "
127 "reading the single entry"
130 for (
label i=0; i<mn; i++)
138 is.readEndList(
"Matrix");
147 is.read(
reinterpret_cast<char*
>(v), mn*
sizeof(Type));
151 "operator>>(Istream&, Matrix<Form, Type>&) : "
152 "reading the binary block"
160 <<
"incorrect first token, expected <int>, found "
169 template<
class Form,
class Type>
181 bool uniform =
false;
183 const Type* v =
M.v_;
185 if (mn > 1 && contiguous<Type>())
189 for (
label i=0; i<mn; i++)
210 else if (mn < 10 && contiguous<Type>())
218 for (
label i=0; i<
M.m(); i++)
223 for (
label j=0; j<
M.n(); j++)
243 for (
label i=0; i<
M.m(); i++)
248 for (
label j=0; j<
M.n(); j++)
269 os.write(
reinterpret_cast<const char*
>(
M.v_), mn*
sizeof(Type));
274 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,...
virtual Ostream & writeCompoundTag(const word &typeName)
Write the compound token tag if the name is a compound token.
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)
Istream & operator>>(Istream &, pointEdgeDist &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
To & dynamicCast(From &r)
Reference type cast template function,.
label readLabel(Istream &is)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)