Go to the documentation of this file.
65 template<
class Form,
class Type>
class Matrix;
69 template<
class Form,
class Type>
72 template<
class Form,
class Type>
80 template<
class Form,
class Type>
89 Type* __restrict__ v_;
95 inline void doAlloc();
98 template<
class ListType>
102 template<
class ListType>
136 Matrix(const label
m, const label
n);
144 Matrix(const label
m, const label
n, const Type& val);
164 template<class Form2>
168 template<class MatrixType>
172 template<class MatrixType>
191 inline label
m() const noexcept;
194 inline label
n() const noexcept;
197 inline label
size() const;
203 inline
bool empty() const noexcept;
207 inline const Type*
cdata() const noexcept;
211 inline Type*
data() noexcept;
226 inline std::streamsize
size_bytes() const noexcept;
234 inline const Type*
rowData(const label irow) const;
238 inline Type*
rowData(const label irow);
242 inline const Type&
at(const label idx) const;
246 inline Type&
at(const label idx);
257 const label colIndex,
258 const label rowIndex = 0,
269 const label rowIndex,
270 const label colIndex = 0,
278 const label rowIndex,
279 const label colIndex,
288 const label rowIndex,
297 const label colIndex,
298 const label rowIndex = 0,
305 const label rowIndex,
306 const label colIndex = 0,
313 const label rowIndex,
314 const label colIndex,
323 const label rowIndex,
330 inline
void checki(const label irow) const;
333 inline
void checkj(const label jcol) const;
358 void resize(const label
m, const label
n);
364 inline
void setSize(const label
m, const label
n);
370 void round(const scalar tol = SMALL);
409 scalar
columnNorm(const label colIndex, const
bool noSqrt=false) const;
413 scalar
norm(const
bool noSqrt=false) const;
420 inline const Type* operator[](const label irow) const;
424 inline Type* operator[](const label irow);
428 inline const Type& operator()(const label irow, const label jcol) const;
432 inline Type& operator()(const label irow, const label jcol);
435 void operator=(const
Matrix<Form, Type>& mat);
438 void operator=(
Matrix<Form, Type>&& mat);
441 template<class MatrixType>
445 template<class MatrixType>
452 void operator=(const Type& val);
455 void operator+=(const
Matrix<Form, Type>& other);
458 void operator-=(const
Matrix<Form, Type>& other);
461 void operator+=(const Type&
s);
464 void operator-=(const Type&
s);
467 void operator*=(const Type&
s);
470 void operator/=(const Type&
s);
511 inline label
mRows() const noexcept
517 inline label
nRows() const noexcept
523 inline label
nCols() const noexcept
532 const Type*
v()
const
602 void col(
const label
m,
const label rowStart)
const =
delete;
606 void col(
const label
m,
const label rowStart) =
delete;
613 template<
class Form,
class Type>
623 template<
class Form,
class Type>
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const typedef Type * const_iterator
A class for managing temporary objects.
autoPtr< mType > clone() const
tmp< Field< Type > > Tmul(const UList< Type > &x) const
Ostream & writeMatrix(Ostream &os, const label shortLen=0) const
label mRows() const noexcept
char * data_bytes() noexcept
void checkj(const label jcol) const
Istream & operator>>(Istream &, directionInfo &)
ConstMatrixBlock< mType > subColumn(const label colIndex, const label rowIndex=0, label len=-1) const
Matrix< Form, Type > mType
A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:
label nCols() const noexcept
void transfer(Matrix< Form, Type > &mat)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
void round(const scalar tol=SMALL)
void resize(const label m, const label n)
std::streamsize byteSize() const
Generic templated field type.
const Type & at(const label idx) const
A templated block of an (m x n) matrix of type <MatrixType>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
scalar columnNorm(const label colIndex, const bool noSqrt=false) const
bool empty() const noexcept
ConstMatrixBlock< mType > subMatrix(const label rowIndex, const label colIndex, label szRows=-1, label szCols=-1) const
ConstMatrixBlock< mType > subRow(const label rowIndex, const label colIndex=0, label len=-1) const
const_iterator cend() const noexcept
std::streamsize size_bytes() const noexcept
bool readMatrix(Istream &is)
const Type * rowData(const label irow) const
label nRows() const noexcept
void resize_nocopy(const label mrow, const label ncol)
ConstMatrixBlock< mType > col(const label m, const label mStart, const label nStart) const
void shallowResize(const label m, const label n)
OBJstream os(runTime.globalPath()/outputName)
void swap(Matrix< Form, Type > &mat)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
tmp< Field< Type > > Amul(const UList< Type > &x) const
An ordered pair of two objects of type <T> with first() and second() elements.
void checki(const label irow) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label m, const label n)
scalar norm(const bool noSqrt=false) const
const Type * cdata() const noexcept
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const char * cdata_bytes() const noexcept
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
const_iterator cbegin() const noexcept
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
iterator begin() noexcept
Database for solution data, solver performance and other reduced data.
List< Type > diag() const
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...