19 constexpr Matrix() noexcept = default;
23 data_.resize( size_ );
27 constexpr T&
operator ()(
size_t row,
size_t col )
noexcept {
return data_[
toIndex( { (int)col, (
int)row } )]; }
28 constexpr T&
operator ()(
size_t i )
noexcept {
return data_[i]; }
29 constexpr const T&
operator ()(
size_t row,
size_t col )
const noexcept {
return data_[
toIndex( { (int)col, (
int)row } )]; }
30 constexpr const T&
operator ()(
size_t i )
const noexcept {
return data_[i]; }
35 for(
size_t r = 0; r < nRow; r++ )
37 for(
size_t c = 0; c < nCol; c++ )
39 res(r, c) = data_[(startRow + r) *
size_t(dims_.x) + startCol + c];
48 Matrix res( dims_.x, dims_.y );
49 for(
size_t r = 0; r < dims_.y; r++ )
51 for(
size_t c = 0; c < dims_.x; c++ )
53 res(c, r) = (*this)(r, c);
61 for(
auto& elem : data_ )
83 const std::vector<T> &
data()
const
Definition MRRectIndexer.h:38
unsafe void resize(in MR.Vector2i dims)
size_t toIndex(const Vector2i &pos) const
Definition MRRectIndexer.h:79
Definition MRCameraOrientationPlugin.h:8
constexpr Matrix() noexcept=default
constexpr Matrix transposed() const
computes transposed matrix
Definition MRMatrix.h:46
const std::vector< T > & data() const
Definition MRMatrix.h:83
constexpr Matrix getSubMatrix(size_t startRow, size_t nRow, size_t startCol, size_t nCol)
Definition MRMatrix.h:32
T ValueType
Definition MRMatrix.h:18
constexpr T & operator()(size_t row, size_t col) noexcept
main access method
Definition MRMatrix.h:27
void clear()
Definition MRMatrix.h:67
size_t getColsNum() const
Definition MRMatrix.h:78
size_t getRowsNum() const
Definition MRMatrix.h:73
void fill(T val)
Definition MRMatrix.h:59