31template<
class MatrixType>
34 const MatrixType& matrix,
42 mRows_(0 <
m ?
m : disallow(
"row dim")),
43 nCols_(0 <
n ?
n : disallow(
"col dim")),
47 || mStart + mRows_ <= matrix.
m()
48 ? mStart : disallow(
"row start")
53 || nStart + nCols_ <= matrix.
n()
54 ? nStart : disallow(
"col start")
59template<
class MatrixType>
70 mRows_(0 < m ? m : disallow(
"row dim")),
71 nCols_(0 <
n ?
n : disallow(
"col dim")),
75 || mStart + mRows_ <= matrix.m()
76 ? mStart : disallow(
"row start")
81 || nStart + nCols_ <= matrix.
n()
82 ? nStart : disallow(
"col start")
89template<
class MatrixType>
92 return (mRows_ * nCols_);
96template<
class MatrixType>
99 return (mRows_ * nCols_);
103template<
class MatrixType>
111template<
class MatrixType>
121template<
class MatrixType>
122inline const typename MatrixType::cmptType&
133 return matrix_(i + rowStart_, j + colStart_);
137template<
class MatrixType>
138inline const typename MatrixType::cmptType&
149 return matrix_(i + rowStart_, j + colStart_);
153template<
class MatrixType>
154inline typename MatrixType::cmptType&
165 return matrix_(i + rowStart_, j + colStart_);
void checkIndex(const label i, const label j) const
Check if (i, j) is within range of row-column limits.
label m() const noexcept
Return the number of rows in the block.
labelPair sizes() const noexcept
Return row/column sizes of the block.
label size() const noexcept
The number of elements in the block (m*n).
label n() const noexcept
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.
A templated block of an (m x n) matrix of type <MatrixType>.
void checkIndex(const label i, const label j) const
Check if (i, j) is within range of row-column limits.
label m() const noexcept
Return the number of rows in the block.
labelPair sizes() const noexcept
Return row/column sizes of the block.
label size() const noexcept
The number of elements in the block (m*n).
label n() const noexcept
Return the number of columns in the block.
MatrixBlock(const MatrixBlock &)=default
Copy construct.
Pair< label > labelPair
A pair of labels.