|
IOLink
IOL_v1.6.1_release
|
5 #include <initializer_list>
9 #include <iolink/IOLinkAPI.h>
19 template <
typename ValueType,
size_t N>
56 Matrix(
const ValueType* values);
75 Matrix(
const ValueType* values,
bool isRowMajor);
94 explicit Matrix(std::initializer_list<ValueType> init);
96 bool operator==(
const Matrix& other)
const;
97 bool operator!=(
const Matrix& other)
const;
105 ValueType
at(
size_t row,
size_t column)
const;
113 ValueType
operator()(
size_t row,
size_t column)
const;
122 void setAt(
size_t row,
size_t column, ValueType value);
157 const ValueType*
data()
const;
176 Matrix& operator*=(ValueType value);
177 Matrix& operator/=(ValueType value);
179 inline Matrix operator*(ValueType v)
const {
return Matrix(*
this) *= v; }
180 inline Matrix operator/(ValueType v)
const {
return Matrix(*
this) /= v; }
183 std::array<ValueType, N * N> m_data;
189 template <
typename T,
size_t N>
201 extern template class IOLINK_API_IMPORT Matrix<float, 3>;
202 extern template class IOLINK_API_IMPORT Matrix<double, 3>;
204 extern template class IOLINK_API_IMPORT Matrix<float, 4>;
205 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:20
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.