28 template<
class MatrixType>
31 const MatrixType& matrix,
47 rowStart_ + mRows_ > matrix.m()
48 || colStart_ + nCols_ > matrix.n()
52 <<
"Block addresses outside matrix" 59 template<
class MatrixType>
78 rowStart_ + mRows_ > matrix.m()
79 || colStart_ + nCols_ > matrix.n()
83 <<
"Block addresses outside matrix" 92 template<
class MatrixType>
99 template<
class MatrixType>
106 template<
class MatrixType>
113 template<
class MatrixType>
122 template<
class MatrixType>
123 inline const typename MatrixType::cmptType&
131 if (i<0 || i>=mRows_)
134 <<
"Index " << i <<
" out of range 0 ... " << mRows_-1
137 if (j<0 || j>=nCols_)
140 <<
"Index " << j <<
" out of range 0 ... " << nCols_-1
145 return matrix_(i + rowStart_, j + colStart_);
149 template<
class MatrixType>
150 inline const typename MatrixType::cmptType&
158 if (i<0 || i>=mRows_)
161 <<
"Index " << i <<
" out of range 0 ... " << mRows_-1
164 if (j<0 || j>=nCols_)
167 <<
"Index " << j <<
" out of range 0 ... " << nCols_-1
172 return matrix_(i + rowStart_, j + colStart_);
176 template<
class MatrixType>
177 inline typename MatrixType::cmptType&
185 if (i<0 || i>=mRows_)
188 <<
"Index " << i <<
" out of range 0 ... " << mRows_-1
191 if (j<0 || j>=nCols_)
194 <<
"Index " << j <<
" out of range 0 ... " << nCols_-1
199 return matrix_(i + rowStart_, j + colStart_);
label m() const
Return the number of rows in the block.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label m() const
Return the number of rows in the block.
A templated block of an (m x n) matrix of type <MatrixType>.
label n() const
Return the number of columns in the block.
ConstMatrixBlock(const MatrixType &matrix, const label m, const label n, const label mStart, const label nStart)
Construct block for matrix, size and location.
errorManip< error > abort(error &err)
label n() const
Return the number of columns in the block.
MatrixBlock(MatrixType &matrix, const label m, const label n, const label mStart, const label nStart)
Construct block for matrix, size and location.