|
cgv
|
A matrix type (full column major storage) The matrix can be loaded directly into OpenGL without need for transposing! More...
#include <mat.h>
Public Types | |
| typedef vec< T >::value_type | value_type |
| typedef vec< T >::reference | reference |
| typedef vec< T >::const_reference | const_reference |
| typedef vec< T >::pointer | pointer |
| typedef vec< T >::const_pointer | const_pointer |
| typedef vec< T >::iterator | iterator |
| typedef vec< T >::const_iterator | const_iterator |
| typedef vec< T >::reverse_iterator | reverse_iterator |
| typedef vec< T >::const_reverse_iterator | const_reverse_iterator |
| typedef iterator | col_iterator |
| typedef const col_iterator | const_col_iterator |
| typedef std::reverse_iterator< col_iterator > | reverse_col_iterator |
| typedef std::reverse_iterator< const_col_iterator > | const_reverse_col_iterator |
| typedef step_iterator< iterator > | row_iterator |
| typedef const row_iterator | const_row_iterator |
| typedef std::reverse_iterator< row_iterator > | reverse_row_iterator |
| typedef std::reverse_iterator< const_row_iterator > | const_reverse_row_iterator |
| typedef step_iterator< iterator > | diag_iterator |
| typedef const diag_iterator | const_diag_iterator |
| typedef std::reverse_iterator< diag_iterator > | reverse_diag_iterator |
| typedef std::reverse_iterator< const_diag_iterator > | const_reverse_diag_iterator |
| typedef step_iterator< iterator > | anti_diag_iterator |
| typedef const anti_diag_iterator | const_anti_diag_iterator |
| typedef std::reverse_iterator< anti_diag_iterator > | reverse_anti_diag_iterator |
| typedef std::reverse_iterator< const_anti_diag_iterator > | const_reverse_anti_diag_iterator |
Public Member Functions | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| reverse_iterator | rbegin () |
| reverse_iterator | rend () |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
| col_iterator | col_begin (int c) |
| col_iterator | col_end (int c) |
| const_col_iterator | col_begin (int c) const |
| const_col_iterator | col_end (int c) const |
| reverse_col_iterator | col_rbegin (int c) |
| reverse_col_iterator | col_rend (int c) |
| const_reverse_col_iterator | col_rbegin (int c) const |
| const_reverse_col_iterator | col_rend (int c) const |
| row_iterator | row_begin (int r) |
| row_iterator | row_end (int r) |
| const_row_iterator | row_begin (int r) const |
| const_row_iterator | row_end (int r) const |
| reverse_row_iterator | row_rbegin (int r) |
| reverse_row_iterator | row_rend (int r) |
| const_reverse_row_iterator | row_rbegin (int r) const |
| const_reverse_row_iterator | row_rend (int r) const |
| diag_iterator | diag_begin (int d=0) |
| diag_iterator | diag_end (int d=0) |
| const_diag_iterator | diag_begin (int d=0) const |
| const_diag_iterator | diag_end (int d=0) const |
| reverse_diag_iterator | diag_rbegin (int d=0) |
| reverse_diag_iterator | diag_rend (int d=0) |
| const_reverse_diag_iterator | diag_rbegin (int d=0) const |
| const_reverse_diag_iterator | diag_rend (int d=0) const |
| anti_diag_iterator | anti_diag_begin (int d=0) |
| anti_diag_iterator | anti_diag_end (int d=0) |
| const_anti_diag_iterator | anti_diag_begin (int d=0) const |
| const_anti_diag_iterator | anti_diag_end (int d=0) const |
| reverse_anti_diag_iterator | anti_diag_rbegin (int d=0) |
| reverse_anti_diag_iterator | anti_diag_rend (int d=0) |
| const_reverse_anti_diag_iterator | anti_diag_rbegin (int d=0) const |
| const_reverse_anti_diag_iterator | anti_diag_rend (int d=0) const |
| mat () | |
| standard constructor | |
| mat (unsigned nrows, unsigned ncols) | |
| constructor creates a nrows x ncols full matrix | |
| mat (unsigned nrows, unsigned ncols, const T &c) | |
| construct a matrix with all elements set to c | |
| mat (unsigned nrows, unsigned ncols, const T *marray, bool column_major=true) | |
| creates a matrix from an array if the matrix data is stored in a row major fashion set column_major to false | |
| template<typename S> | |
| mat (const mat< S > &m) | |
| copy constructor for matrix with different element type | |
| void | set_extern_data (unsigned nrows, unsigned ncols, T *data) |
| set data pointer to an external data array | |
| void | destruct () |
| unsigned | size () const |
| number of stored elements | |
| unsigned | nrows () const |
| number of rows | |
| unsigned | ncols () const |
| number of columns | |
| template<typename S> | |
| mat< T > & | operator= (const mat< S > &m) |
| assignment of a matrix with a different element type | |
| mat< T > & | operator= (const T &s) |
| assignment of a scalar s to each element of the matrix | |
| void | resize (unsigned rows, unsigned cols) |
| resize the matrix, the content of the matrix will be destroyed | |
| operator T* () | |
| cast operator for non const array | |
| operator const T * () const | |
| cast operator const array | |
| bool | is_square () const |
| returns true if matrix is a square matrix | |
| template<typename S> | |
| void | fill (const S &v) |
| fills all elements of the matrix with v | |
| T & | operator() (unsigned i, unsigned j) |
| access to the element in the ith row in column j | |
| const T & | operator() (unsigned i, unsigned j) const |
| const access to the element in the ith row on column j | |
| template<typename S> | |
| bool | operator== (const mat< S > &m) const |
| test for equality | |
| template<typename S> | |
| bool | operator!= (const mat< S > &m) const |
| test for inequality | |
| mat< T > & | operator*= (const T &s) |
| const mat< T > | operator* (const T &s) const |
| scalar multiplication | |
| mat< T > & | operator/= (const T &s) |
| in place division by a scalar | |
| const mat< T > | operator/ (const T &s) const |
| division by a scalar | |
| mat< T > & | operator+= (const T &s) |
| in place addition by a scalar | |
| const mat< T > | operator+ (const T &s) |
| componentwise addition of a scalar | |
| mat< T > & | operator-= (const T &s) |
| in place substraction of a scalar | |
| const mat< T > | operator- (const T &s) |
| componentwise subtraction of a scalar | |
| const mat< T > | operator- () const |
| negation operator | |
| template<typename S> | |
| mat< T > & | operator+= (const mat< S > &m) |
| in place addition of matrix | |
| template<typename S> | |
| mat< T > & | operator-= (const mat< S > &m) |
| in place subtraction of matrix | |
| template<typename S> | |
| const mat< T > | operator+ (const mat< S > m2) const |
| matrix addition | |
| template<typename S> | |
| const mat< T > | operator- (const mat< S > m2) const |
| matrix subtraction | |
| template<typename S> | |
| const mat< T > | operator*= (const mat< S > &m2) |
| in place matrix multiplication with a ncols x ncols matrix m2 | |
| template<typename S> | |
| const mat< T > | operator* (const mat< S > &m2) const |
| multiplication with a ncols x M matrix m2 | |
| template<typename S> | |
| const vec< T > | operator* (const vec< S > &v) const |
| matrix vector multiplication | |
| mat< T > | sub_mat (unsigned top, unsigned left, unsigned rows, unsigned cols) const |
| create submatrix m(top,left)...m(top+rows,left+cols) | |
| const vec< T > | row (unsigned i) const |
| extract a row from the matrix as a vector | |
| void | set_row (unsigned i, const vec< T > &v) |
| set row i of the matrix to vector v | |
| const vec< T > | col (unsigned j) const |
| extract a column of the matrix as a vector | |
| void | set_col (unsigned j, const vec< T > &v) |
| set column j of the matrix to vector v | |
| void | copy (unsigned top, unsigned left, unsigned rows, unsigned cols, mat< T > &submat) const |
| copy submatrix m(top,left)...m(top+rows,left+cols) into submat | |
| void | paste (int top, int left, const mat< T > &m) |
| paste matrix m at position: top, left | |
| void | swap_rows (unsigned i, unsigned j) |
| exchange row i with row j | |
| void | swap_columns (unsigned i, unsigned j) |
| exchange column i with column j | |
| void | swap_diagonal_elements (unsigned i, unsigned j) |
| exchange diagonal elements (i,i) (j,j) | |
| T | trace () const |
| returns the trace | |
| T | maxcoeff () const |
| T | mincoeff () const |
| void | transpose () |
| transpose matrix | |
| void | fliplr () |
| void | flipud () |
| void | ceil () |
| ceil all components of the matrix | |
| void | floor () |
| floor all components of the matrix | |
| void | round () |
| round to integer | |
| T | frobenius_norm () const |
| returns the frobenius norm of matrix m | |
| void | identity () |
| set identity matrix | |
| void | identity (unsigned dim) |
| set dim x dim identity matrix | |
| void | zeros () |
| set zero matrix | |
| void | zeros (unsigned rows, unsigned cols) |
| resize and fill matrix with zeros | |
| void | ones (unsigned rows, unsigned cols) |
| resize and fill matrix with ones | |
Protected Attributes | |
| vec< T > | _data |
| pointer to data storage | |
| unsigned | _ncols |
| number of columns | |
| unsigned | _nrows |
| number of rows | |
A matrix type (full column major storage) The matrix can be loaded directly into OpenGL without need for transposing!
| typedef step_iterator<iterator > cgv::math::mat< T >::anti_diag_iterator |
| typedef iterator cgv::math::mat< T >::col_iterator |
| typedef const anti_diag_iterator cgv::math::mat< T >::const_anti_diag_iterator |
| typedef const col_iterator cgv::math::mat< T >::const_col_iterator |
| typedef const diag_iterator cgv::math::mat< T >::const_diag_iterator |
| typedef vec<T>::const_iterator cgv::math::mat< T >::const_iterator |
| typedef vec<T>::const_pointer cgv::math::mat< T >::const_pointer |
| typedef vec<T>::const_reference cgv::math::mat< T >::const_reference |
| typedef std::reverse_iterator<const_anti_diag_iterator> cgv::math::mat< T >::const_reverse_anti_diag_iterator |
| typedef std::reverse_iterator<const_col_iterator> cgv::math::mat< T >::const_reverse_col_iterator |
| typedef std::reverse_iterator<const_diag_iterator> cgv::math::mat< T >::const_reverse_diag_iterator |
| typedef vec<T>::const_reverse_iterator cgv::math::mat< T >::const_reverse_iterator |
| typedef std::reverse_iterator<const_row_iterator> cgv::math::mat< T >::const_reverse_row_iterator |
| typedef const row_iterator cgv::math::mat< T >::const_row_iterator |
| typedef step_iterator<iterator > cgv::math::mat< T >::diag_iterator |
| typedef vec<T>::iterator cgv::math::mat< T >::iterator |
| typedef vec<T>::pointer cgv::math::mat< T >::pointer |
| typedef vec<T>::reference cgv::math::mat< T >::reference |
| typedef std::reverse_iterator<anti_diag_iterator> cgv::math::mat< T >::reverse_anti_diag_iterator |
| typedef std::reverse_iterator<col_iterator> cgv::math::mat< T >::reverse_col_iterator |
| typedef std::reverse_iterator<diag_iterator> cgv::math::mat< T >::reverse_diag_iterator |
| typedef vec<T>::reverse_iterator cgv::math::mat< T >::reverse_iterator |
| typedef std::reverse_iterator<row_iterator> cgv::math::mat< T >::reverse_row_iterator |
| typedef step_iterator<iterator> cgv::math::mat< T >::row_iterator |
| typedef vec<T>::value_type cgv::math::mat< T >::value_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
extract a column of the matrix as a vector
Definition at line 833 of file mat.h.
Referenced by cgv::math::thin_hyper_plate_spline< T >::map_positions(), and cgv::math::thin_plate_spline< T >::map_positions().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
fills all elements of the matrix with v
Definition at line 603 of file mat.h.
Referenced by cgv::math::mat< float >::ones(), cgv::math::mat< float >::operator=(), cgv::math::mat< float >::zeros(), and cgv::math::mat< float >::zeros().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
number of columns
Definition at line 546 of file mat.h.
Referenced by cgv::math::mat< float >::copy(), cgv::math::diag_mat< T >::diag_mat(), cgv::math::thin_hyper_plate_spline< T >::map_positions(), cgv::math::thin_plate_spline< T >::map_positions(), cgv::math::mat< float >::mat(), cgv::math::mat< float >::operator!=(), cgv::math::mat< float >::operator*(), cgv::math::mat< float >::operator*=(), cgv::math::mat< float >::operator+=(), cgv::math::mat< float >::operator-=(), cgv::math::mat< float >::operator=(), cgv::math::mat< float >::operator==(), cgv::math::mat< float >::paste(), cgv::math::random::uniform(), cgv::math::random::uniform(), cgv::math::random::uniform(), and cgv::math::random::uniform().
|
inline |
number of rows
Definition at line 540 of file mat.h.
Referenced by cgv::math::mat< float >::copy(), cgv::math::diag_mat< T >::diag_mat(), cgv::math::thin_hyper_plate_spline< T >::map_positions(), cgv::math::thin_plate_spline< T >::map_positions(), cgv::math::mat< float >::mat(), cgv::math::mat< float >::operator!=(), cgv::math::mat< float >::operator*(), cgv::math::mat< float >::operator*=(), cgv::math::mat< float >::operator+=(), cgv::math::mat< float >::operator-=(), cgv::math::mat< float >::operator=(), cgv::math::mat< float >::operator==(), cgv::math::mat< float >::paste(), cgv::math::random::uniform(), cgv::math::random::uniform(), cgv::math::random::uniform(), and cgv::math::random::uniform().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
access to the element in the ith row in column j
Definition at line 609 of file mat.h.
Referenced by cgv::math::mat< float >::col(), cgv::math::mat< float >::copy(), cgv::math::mat< float >::mat(), cgv::math::mat< float >::mat(), cgv::math::mat< float >::operator*(), cgv::math::mat< float >::operator*(), cgv::math::mat< float >::operator*=(), cgv::math::mat< float >::operator=(), cgv::math::mat< float >::row(), cgv::math::mat< float >::sub_mat(), and cgv::math::mat< float >::transpose().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
resize the matrix, the content of the matrix will be destroyed
Definition at line 574 of file mat.h.
Referenced by cgv::math::mat< float >::ones(), cgv::math::mat< float >::operator=(), and cgv::math::mat< float >::zeros().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
set column j of the matrix to vector v
Definition at line 846 of file mat.h.
Referenced by cgv::math::thin_hyper_plate_spline< T >::map_positions(), and cgv::math::thin_plate_spline< T >::map_positions().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
set zero matrix
Definition at line 1030 of file mat.h.
Referenced by cgv::math::mat< float >::identity(), cgv::math::mat< float >::identity(), cgv::math::diag_mat< T >::operator const mat< T >(), and cgv::math::tri_diag_mat< T >::operator const mat< T >().
|
inline |
|
protected |
pointer to data storage
Definition at line 211 of file mat.h.
Referenced by cgv::math::mat< float >::operator!=(), cgv::math::mat< float >::operator+=(), cgv::math::mat< float >::operator-=(), and cgv::math::mat< float >::operator==().
|
protected |
|
protected |