15 typedef unsigned int uint;
20 template <u
int Rows, u
int Cols>
28 template <u
int VecDim> constexpr
uint vecRangeDim(
uint from,
uint to);
32 template <u
int Rows, u
int Cols>
55 template <u
int Rows, u
int Cols>
62 explicit MatrixBase(
const double (&initArray)[Rows * Cols]);
63 template <
typename... Doubles>
64 MatrixBase(
double firstElement, Doubles... matrixElements);
75 double&
at(
uint row,
uint column) noexcept(
false);
76 double at(
uint row,
uint column)
const noexcept(
false);
78 template <u
int row, u
int column>
79 double&
get() noexcept;
80 template <u
int row, u
int column>
81 double get()
const noexcept;
92 double&
get() noexcept;
94 double get()
const noexcept;
98 const double*
data()
const;
101 const double*
begin()
const;
104 const double*
end()
const;
108 constexpr
size_t size()
const;
112 std::string
info(
const char* lineModifier =
"")
const;
123 double _m[Rows * Cols];
127 template <u
int Rows, u
int Cols>
132 explicit Matrix(
double fillValue);
133 explicit Matrix(
const double (&initArray)[Rows * Cols]);
134 template <
typename... Doubles,
135 typename =
typename std::enable_if<
sizeof...(Doubles) + 1u == Rows * Cols>::type>
136 Matrix(
double firstElement, Doubles... matrixElements);
140 template <
class Container>
142 fromContainer(
const Container& vector,
size_t NthMat,
bool* ok =
nullptr);
145 template <u
int fromRow, u
int toRow, u
int fromCol, u
int toCol>
146 auto subMat()
const ->
Matrix<details::rangeDim(fromRow, toRow),
147 details::rangeDim(fromCol, toCol)>;
149 template <u
int from, u
int to>
151 details::vecRangeDim<Cols>(from, to)>;
160 void fill(
double fillValue);
163 double trace()
const;
165 template <u
int NewRows, u
int NewCols>
182 template <u
int Cols2>
199 double value()
const;
201 const double& ref()
const;
204 operator double()
const;
214 template <u
int Rows, u
int Cols>
232 template <u
int Rows, u
int Cols>
236 template <u
int Rows, u
int Cols>
243 template <u
int Rows, u
int Cols>
247 template <u
int Rows, u
int Cols1, u
int Cols2>
250 template <u
int Rows1, u
int Rows2, u
int Cols>
256 #include "matrix.tpp" 258 #endif // CTL_MATRIX_H double & at(uint row, uint column) noexcept(false)
Definition: matrix.tpp:134
double trace() const
Definition: matrix.tpp:723
Matrix< Rows, Cols > normalized() const
Definition: matrix.tpp:714
Helper base class that provides an access interface to the Matrix template class and its scalar speci...
Definition: matrix.h:56
double norm() const
Definition: matrix.tpp:430
Matrix< Rows, Cols > & operator%=(const Matrix< Rows, Cols > &rhs)
Definition: matrix.tpp:842
double & get() noexcept
Definition: matrix.tpp:164
Matrix< 1, Cols > row() const
Definition: matrix.tpp:652
const double * constData() const
Definition: matrix.tpp:286
double * operator[](uint row)
Definition: matrix.tpp:95
Matrix< Rows, Cols > & operator|=(const Matrix< Rows, Cols > &rhs)
Definition: matrix.tpp:853
static Matrix< Rows, Cols > fromContainer(const Container &vector, size_t NthMat, bool *ok=nullptr)
Definition: matrix.tpp:533
double & operator()(uint row, uint column)
Definition: matrix.tpp:114
bool operator==(const MatrixBase< Rows, Cols > &rhs) const
Definition: matrix.tpp:448
std::string info(const char *lineModifier="") const
Definition: matrix.tpp:376
double * end()
Definition: matrix.tpp:321
Matrix< Rows, Cols > operator|(const Matrix< Rows, Cols > &rhs) const
Definition: matrix.tpp:956
Matrix< NewRows, NewCols > reshaped() const
Definition: matrix.tpp:762
static char & SEPARATOR_CHARACTER_FOR_INFO_STRING
global separator character for formatting
Definition: matrix.h:111
double _m[Rows *Cols]
array with matrix elements
Definition: matrix.h:123
Matrix< Rows, 1 > column() const
Definition: matrix.tpp:667
Matrix< Rows, Cols > operator%(const Matrix< Rows, Cols > &rhs) const
Definition: matrix.tpp:943
const double * constBegin() const
Definition: matrix.tpp:313
Matrix< Rows *Cols, 1 > reshapedAsVector() const
Definition: matrix.tpp:779
bool operator!=(const MatrixBase< Rows, Cols > &rhs) const
Definition: matrix.tpp:467
unsigned int uint
Qt style alias for unsigned int.
Definition: modulelayout.h:6
void normalize()
Definition: matrix.tpp:699
double * begin()
Definition: matrix.tpp:294
const double * constEnd() const
Definition: matrix.tpp:339
auto subMat() const -> Matrix< details::rangeDim(fromRow, toRow), details::rangeDim(fromCol, toCol)>
Definition: matrix.tpp:577
This template class is an abstraction of a small matrix with a size known at compile time.
Definition: matrix.h:21
constexpr size_t size() const
Definition: matrix.tpp:345
void fill(double fillValue)
Definition: matrix.tpp:686
double * data()
Definition: matrix.tpp:267
Matrix< Cols, Rows > transposed() const
Definition: matrix.tpp:737