SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
List of all members
TooN::Matrix< Rows, Cols, Precision, Layout > Struct Template Reference

#include <matrix.hh>

Inheritance diagram for TooN::Matrix< Rows, Cols, Precision, Layout >:

Public Member Functions

Construction and destruction
 Matrix ()
 Construction of static matrices. Values are not initialized. More...
 
 Matrix (int rows, int cols)
 Construction of dynamic matrices. Values are not initialized. More...
 
 Matrix (Precision *p)
 Construction of statically sized slice matrices. More...
 
 Matrix (Precision *p, int r, int c)
 Construction of dynamically sized slice matrices. More...
 
 Matrix (Precision *data, int rows, int cols, int rowstride, int colstride, Internal::Slicing)
 
template<class Op >
 Matrix (const Operator< Op > &op)
 Construction from an operator. More...
 
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
 Matrix (const Matrix< Rows2, Cols2, Precision2, Base2 > &from)
 constructor from arbitrary matrix More...
 
Assignment

operator = from copy

Matrixoperator= (const Matrix &from)
 
template<class Op >
Matrixoperator= (const Operator< Op > &op)
 
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
Matrixoperator= (const Matrix< Rows2, Cols2, Precision2, Base2 > &from)
 
operations on the matrix
Matrixoperator*= (const Precision &rhs)
 
Matrixoperator/= (const Precision &rhs)
 
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
Matrixoperator+= (const Matrix< Rows2, Cols2, Precision2, Base2 > &from)
 
template<class Op >
Matrixoperator+= (const Operator< Op > &op)
 
template<class Op >
Matrixoperator-= (const Operator< Op > &op)
 
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
Matrixoperator-= (const Matrix< Rows2, Cols2, Precision2, Base2 > &from)
 
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
bool operator== (const Matrix< Rows2, Cols2, Precision2, Base2 > &rhs) const
 
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
bool operator!= (const Matrix< Rows2, Cols2, Precision2, Base2 > &rhs) const
 
Misc
Matrixref ()
 return me as a non const reference - useful for temporaries More...
 

Detailed Description

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
struct TooN::Matrix< Rows, Cols, Precision, Layout >

A matrix. Support is provided for all the usual matrix operations:

See individual member function documentation for examples of usage.

Statically-sized matrices

The library provides classes for statically and dynamically sized matrices. As with Vectors, statically sized matrices are more efficient, since their size is determined at compile-time, not run-time. To create a $3\times4$ matrix, use:

Matrix<3,4> M;

or replace 3 and 4 with the dimensions of your choice. If the matrix is square, it can be declared as:

Matrix<3> M;

which just is a synonym for Matrix<3,3>. Matrices can also be constructed from pointers or static 1D or 2D arrays of doubles:

double dvals1[9]={1,2,3,4,5,6};
Matrix<2,3, Reference::RowMajor> M2 (dvals1);
Dynamically-sized matrices

To create a dynamically sized matrix, use:

Matrix<> M(num_rows, num_cols);

where num_rows and num_cols are integers which will be evaluated at run time.

Half-dynamic matriced can be constructed in either dimension:

Matrix<Dynamic, 2> M(num_rows, 2);

note that the static dimension must be provided, but it is ignored.

Matrix<> is a synonym for Matrix<Dynamic, Dynamic> which is Matrix<-1,-1>

Row-major and column-major

The library supports both row major (the default - but you can change this if you prefer) and column major layout ordering. Row major implies that the matrix is laid out in memory in raster scan order:

\[\begin{matrix}\text{Row major} & \text {Column major}\\ \begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix} & \begin{bmatrix}1&4&7\\2&5&8\\3&6&9\end{bmatrix} \end{matrix}\]

You can override the default for a specific matrix by specifying the layout when you construct it:

Matrix<3,3,double,ColMajor> M1;
Matrix<-1,-1,double,RowMajor> M2(nrows, ncols);

In this case the precision template argument must be given as it precedes the layout argument

Definition at line 110 of file matrix.hh.

Constructor & Destructor Documentation

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
TooN::Matrix< Rows, Cols, Precision, Layout >::Matrix ( )
inline

Construction of static matrices. Values are not initialized.

Definition at line 124 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
TooN::Matrix< Rows, Cols, Precision, Layout >::Matrix ( int  rows,
int  cols 
)
inline

Construction of dynamic matrices. Values are not initialized.

Definition at line 127 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
TooN::Matrix< Rows, Cols, Precision, Layout >::Matrix ( Precision *  p)
inline

Construction of statically sized slice matrices.

Definition at line 132 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
TooN::Matrix< Rows, Cols, Precision, Layout >::Matrix ( Precision *  p,
int  r,
int  c 
)
inline

Construction of dynamically sized slice matrices.

Definition at line 137 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
TooN::Matrix< Rows, Cols, Precision, Layout >::Matrix ( Precision *  data,
int  rows,
int  cols,
int  rowstride,
int  colstride,
Internal::Slicing   
)
inline

Advanced construction of dynamically sized slice matrices. Internal constructor used by GenericMBase::slice(...).

Definition at line 143 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<class Op >
TooN::Matrix< Rows, Cols, Precision, Layout >::Matrix ( const Operator< Op > &  op)
inline

Construction from an operator.

Definition at line 151 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
TooN::Matrix< Rows, Cols, Precision, Layout >::Matrix ( const Matrix< Rows2, Cols2, Precision2, Base2 > &  from)
inline

constructor from arbitrary matrix

Definition at line 159 of file matrix.hh.

Member Function Documentation

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
bool TooN::Matrix< Rows, Cols, Precision, Layout >::operator!= ( const Matrix< Rows2, Cols2, Precision2, Base2 > &  rhs) const
inline

Definition at line 278 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator*= ( const Precision &  rhs)
inline

Definition at line 206 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator+= ( const Matrix< Rows2, Cols2, Precision2, Base2 > &  from)
inline

Definition at line 225 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<class Op >
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator+= ( const Operator< Op > &  op)
inline

Definition at line 238 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<class Op >
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator-= ( const Operator< Op > &  op)
inline

Definition at line 245 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator-= ( const Matrix< Rows2, Cols2, Precision2, Base2 > &  from)
inline

Definition at line 252 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator/= ( const Precision &  rhs)
inline

Definition at line 215 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator= ( const Matrix< Rows, Cols, Precision, Layout > &  from)
inline

Definition at line 169 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<class Op >
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator= ( const Operator< Op > &  op)
inline

Definition at line 182 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::operator= ( const Matrix< Rows2, Cols2, Precision2, Base2 > &  from)
inline

Definition at line 190 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
template<int Rows2, int Cols2, typename Precision2 , typename Base2 >
bool TooN::Matrix< Rows, Cols, Precision, Layout >::operator== ( const Matrix< Rows2, Cols2, Precision2, Base2 > &  rhs) const
inline

Definition at line 265 of file matrix.hh.

template<int Rows = -1, int Cols = Rows, class Precision = DefaultPrecision, class Layout = RowMajor>
Matrix& TooN::Matrix< Rows, Cols, Precision, Layout >::ref ( )
inline

return me as a non const reference - useful for temporaries

Definition at line 296 of file matrix.hh.


The documentation for this struct was generated from the following file: