File matrix.hpp
Core API objects - matrix.
Typedefs
Functions
-
template<int Rows, int Cols>
static void checkSize(const int rows, const int cols)
Variables
-
constexpr int Dynamic = -1
-
namespace slamcore
Helper conversion methods
slamcore::ImageFormat \(\leftrightarrow\) BytesPerChannel
Get information about the client library
Typedefs
Functions
Variables
-
constexpr int Dynamic = -1
-
template<typename ScalarT = double, int RowsT = Dynamic, int ColsT = Dynamic>
class Matrix : public Dimensions<Dynamic, Dynamic> - #include <matrix.hpp>
A column Major data representation of a matrix.
- Template Parameters
ScalarT –
RowsT –
ColsT –
Public Functions
-
Matrix() = default
-
template<bool _IsDynamic = IsDynamic, typename std::enable_if<_IsDynamic, int>::type = 0>
inline Matrix(int rows, int cols)
-
template<int _RowsT, int _ColsT>
inline explicit Matrix(const Matrix<Scalar, _RowsT, _ColsT> &other) Construct a new Matrix object from another.
Note
This is only valid for dynamic matrices as they need to be resized
- Template Parameters
_RowsT – Compile-time rows of other matrix
_ColsT – Compile-time columns of other matrix
- Parameters
other – matrix to construct from
-
inline Matrix(std::initializer_list<std::initializer_list<ScalarT>> initList)
Construct a new Matrix object and initialise it with the values in the given initializer_list.
The inner list generally represents a row, so a 2x3 matrix can be constructed as follows: Matrix<double, Dynamic, Dynamic> matrix{{1, 2, 3}, {4, 5, 6}};
Column vectors are special cased so that they can be constructed with the transpose: Matrix<double, Dynamic, 1> vector{{1, 2, 3}}; // a 3 element column vector
- Parameters
initList – The elements to use to construct the matrix.
-
inline Scalar *begin()
Iterator to beginning of the sequence.
Note
Only valid for matrices with a dimension of 1 at compile time
-
inline Scalar *end()
Iterator to one-past-the-end of the sequence.
Note
Only valid for matrices with a dimension of 1 at compile time
-
inline const Scalar *begin() const
Const iterator to beginning of the sequence.
Note
Only valid for matrices with a dimension of 1 at compile time
-
inline const Scalar *end() const
Const iterator to one-past-the-end of the sequence.
Note
Only valid for matrices with a dimension of 1 at compile time
-
inline IndexT size() const
The number of elements in the matrix.
-
inline const ScalarT *data() const
Pointer to the underlying buffer.
-
inline ScalarT *data()
Pointer to the underlying buffer.
-
inline ScalarT x() const
-
inline ScalarT y() const
-
inline ScalarT z() const
-
inline ScalarT w() const
-
inline ScalarT &x()
-
inline ScalarT &y()
-
inline ScalarT &z()
-
inline ScalarT &w()
-
inline void resize(IndexT size)
Vector resize.
- Parameters
size – The new size of the vector.
Public Static Attributes
-
static constexpr bool IsCompileTimeColumnVector = (ColsT == 1)
-
static constexpr bool IsCompileTimeRowVector = (RowsT == 1)
-
static constexpr bool IsVector = (IsCompileTimeColumnVector || IsCompileTimeRowVector)
-
static constexpr auto CompileTimeRows = RowsT
-
static constexpr auto CompileTimeCols = ColsT
- static constexpr auto CompileTimeSize = IsDynamic ? Dynamic : RowsT * ColsT
Private Static Functions
-
template<int _RowsT, int _ColsT>
static inline void checkSize()
-
namespace detail
Slamcore API internal namespace
Functions
-
template<int Rows, int Cols>
static void checkSize(const int rows, const int cols)
-
template<int Rows, int Cols>
-
constexpr int Dynamic = -1