|
IOLink
IOL_v1.1.0_release
|
5 #include <initializer_list>
7 #include <iolink/IOLinkAPI.h>
17 template <
typename ValueType,
size_t N>
54 Matrix(
const ValueType* values);
73 Matrix(
const ValueType* values,
bool isRowMajor);
92 explicit Matrix(std::initializer_list<ValueType> init);
94 bool operator==(
const Matrix& other)
const;
95 bool operator!=(
const Matrix& other)
const;
103 ValueType
at(
size_t row,
size_t column)
const;
111 ValueType
operator()(
size_t row,
size_t column)
const;
120 void setAt(
size_t row,
size_t column, ValueType value);
155 const ValueType*
data()
const;
174 Matrix& operator*=(ValueType value);
175 Matrix& operator/=(ValueType value);
177 inline Matrix operator*(ValueType v)
const {
return Matrix(*
this) *= v; }
178 inline Matrix operator/(ValueType v)
const {
return Matrix(*
this) /= v; }
181 std::array<ValueType, N * N> m_data;
187 template <
typename T,
size_t N>
199 extern template class IOLINK_API_IMPORT Matrix<float, 3>;
200 extern template class IOLINK_API_IMPORT Matrix<double, 3>;
202 extern template class IOLINK_API_IMPORT Matrix<float, 4>;
203 extern template class IOLINK_API_IMPORT Matrix<double, 4>;
std::string toString() const
Return a string representation of the matrix.
void setAt(size_t row, size_t column, ValueType value)
Set an element of the matrix.
An arithmetic square matrix.
Definition: Matrix.h:18
All IOLink symbols are enclosed in this namespace.
Definition: ArrayX.h:7
Matrix()
Default constructor.
ValueType at(size_t row, size_t column) const
Access an element of the matrix.
Matrix transpose() const
Return the transposed matrix.
void transposeInPlace()
Transpose the matrix in place.
ValueType operator()(size_t row, size_t column) const
Access an element of the matrix.
static Matrix identity()
Return an identity matrix.
ValueType * data()
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.