5#include <initializer_list>
9#include <iolink/IOLinkAPI.h>
10#include <iolink/Vector.h>
20template <
typename ValueType,
size_t N>
57 explicit Matrix(
const ValueType* values);
76 Matrix(
const ValueType* values,
bool isRowMajor);
95 explicit Matrix(std::initializer_list<ValueType> init);
97 bool operator==(
const Matrix& other)
const;
98 bool operator!=(
const Matrix& other)
const;
106 ValueType
at(
size_t row,
size_t column)
const;
123 void setAt(
size_t row,
size_t column, ValueType value);
185 Matrix& operator*=(ValueType value);
186 Matrix& operator/=(ValueType value);
188 inline Matrix operator*(ValueType v)
const {
return Matrix(*
this) *= v; }
189 inline Matrix operator/(ValueType v)
const {
return Matrix(*
this) /= v; }
191 Vector<ValueType, N> operator*(
const Vector<ValueType, N>& v)
const;
195 std::array<ValueType, N * N> m_data;
201template <
typename T,
size_t N>
213extern template class IOLINK_API_IMPORT Matrix<float, 3>;
214extern template class IOLINK_API_IMPORT Matrix<double, 3>;
216extern template class IOLINK_API_IMPORT Matrix<float, 4>;
217extern template class IOLINK_API_IMPORT Matrix<double, 4>;
An arithmetic square matrix.
Definition Matrix.h:22
Matrix(std::initializer_list< ValueType > init)
Create a matrix giving initialization values.
ValueType operator()(size_t row, size_t column) const
Access an element of the matrix.
void transposeInPlace()
Transpose the matrix in place.
const ValueType * data() const
Exposes the internal data of the matrix, use it only if you know what you do.
static Matrix uniform(ValueType value)
Initialize an uniform matrix with an unique value.
Matrix()
Default constructor.
void setAt(size_t row, size_t column, ValueType value)
Set an element of the matrix.
ValueType at(size_t row, size_t column) const
Access an element of the matrix.
std::string toString() const
Return a string representation of the matrix.
ValueType * data()
Exposes the internal data of the matrix, use it only if you know what you do.
Matrix(const ValueType *values)
Constructor with C-array parameter.
Matrix inverse() const
Return the inverse matrix.
Matrix(const ValueType *values, bool isRowMajor)
Constructor with C-array parameter.
static Matrix identity()
Return an identity matrix.
Matrix transpose() const
Return the transposed matrix.
All IOLink symbols are enclosed in this namespace.
Definition ArrayX.h:8