Public Types | Public Member Functions | Protected Attributes
vcg::ndim::Matrix< TYPE > Class Template Reference

#include <old_deprecated_matrix.h>

List of all members.

Public Types

typedef TYPE ScalarType

Public Member Functions

TYPE Cofactor (unsigned int i, unsigned int j) const
unsigned int ColumnsNumber () const
TYPE Determinant () const
template<int N, int M>
void DotProduct (Point< N, TYPE > &m, Point< M, TYPE > &result)
void Dump ()
TYPE ElementAt (unsigned int i, unsigned int j)
TYPE * GetColumn (const unsigned int j)
TYPE * GetRow (const unsigned int i)
 Matrix (unsigned int m, unsigned int n)
 Matrix (unsigned int m, unsigned int n, TYPE *values)
 Matrix ()
 Matrix (const Matrix< TYPE > &m)
bool operator!= (const Matrix< TYPE > &m) const
Matrix< TYPE > operator* (const Matrix< TYPE > &m) const
ScalarTypeoperator* (const ScalarType v[]) const
Matrix< TYPE > operator* (const MatrixDiagBase &m) const
Point3< TYPE > operator* (Point3< TYPE > &p) const
Matrix< TYPE > operator* (const TYPE k) const
Matrix< TYPE > & operator*= (const TYPE k)
Matrix< TYPE > operator+ (const TYPE k)
Matrix< TYPE > & operator+= (const Matrix< TYPE > &m)
Matrix< TYPE > & operator+= (const TYPE k)
Matrix< TYPE > operator- (const TYPE k)
Matrix< TYPE > operator- () const
Matrix< TYPE > & operator-= (const Matrix< TYPE > &m)
Matrix< TYPE > & operator-= (const TYPE k)
Matrix< TYPE > operator/ (const TYPE k)
Matrix< TYPE > & operator/= (const TYPE k)
Matrix< TYPE > & operator= (const Matrix< TYPE > &m)
bool operator== (const Matrix< TYPE > &m) const
TYPE * operator[] (const unsigned int i)
const TYPE * operator[] (const unsigned int i) const
template<int N, int M>
void OuterProduct (const Point< N, TYPE > a, const Point< M, TYPE > b)
void Resize (const unsigned int m, const unsigned int n)
unsigned int RowsNumber () const
void SetColumn (const unsigned int j, TYPE *v)
void SetDiagonal (TYPE *v)
void SetIdentity ()
void SetRow (const unsigned int i, TYPE *v)
void SetZero ()
void SwapColumns (const unsigned int i, const unsigned int j)
void SwapRows (const unsigned int i, const unsigned int j)
void Transpose ()
Matrix transpose ()
void transposeInPlace ()
 ~Matrix ()

Protected Attributes

unsigned int _columns
 the number of matrix rows
ScalarType_data
 the matrix elements
unsigned int _rows
 the number of matrix rows

Detailed Description

template<class TYPE>
class vcg::ndim::Matrix< TYPE >

This class represent a generic mn matrix. The class is templated over the scalar type field.

Parameters:
TYPE(Templete Parameter) Specifies the ScalarType field.

Definition at line 80 of file old_deprecated_matrix.h.


Member Typedef Documentation

template<class TYPE>
typedef TYPE vcg::ndim::Matrix< TYPE >::ScalarType

Definition at line 84 of file old_deprecated_matrix.h.


Constructor & Destructor Documentation

template<class TYPE>
vcg::ndim::Matrix< TYPE >::Matrix ( unsigned int  m,
unsigned int  n 
) [inline]

Default constructor All the elements are initialized to zero.

Parameters:
mthe number of matrix rows
nthe number of matrix columns

Definition at line 92 of file old_deprecated_matrix.h.

template<class TYPE>
vcg::ndim::Matrix< TYPE >::Matrix ( unsigned int  m,
unsigned int  n,
TYPE *  values 
) [inline]

Constructor The matrix elements are initialized with the values of the elements in values.

Parameters:
mthe number of matrix rows
nthe number of matrix columns
valuesthe values of the matrix elements

Definition at line 107 of file old_deprecated_matrix.h.

template<class TYPE>
vcg::ndim::Matrix< TYPE >::Matrix ( ) [inline]

Empty constructor Just create the object

Definition at line 123 of file old_deprecated_matrix.h.

template<class TYPE>
vcg::ndim::Matrix< TYPE >::Matrix ( const Matrix< TYPE > &  m) [inline]

Copy constructor The matrix elements are initialized with the value of the corresponding element in m

Parameters:
mthe matrix to be copied

Definition at line 135 of file old_deprecated_matrix.h.

template<class TYPE>
vcg::ndim::Matrix< TYPE >::~Matrix ( ) [inline]

Default destructor

Definition at line 151 of file old_deprecated_matrix.h.


Member Function Documentation

template<class TYPE>
TYPE vcg::ndim::Matrix< TYPE >::Cofactor ( unsigned int  i,
unsigned int  j 
) const [inline]

Return the cofactor Ai,j of the ai,j element

Returns:
...

Definition at line 258 of file old_deprecated_matrix.h.

template<class TYPE>
unsigned int vcg::ndim::Matrix< TYPE >::ColumnsNumber ( ) const [inline]

Number of columns

Definition at line 159 of file old_deprecated_matrix.h.

template<class TYPE>
TYPE vcg::ndim::Matrix< TYPE >::Determinant ( ) const [inline]

Calculate and return the matrix determinant (Laplace)

Returns:
the matrix determinant

Definition at line 224 of file old_deprecated_matrix.h.

template<class TYPE>
template<int N, int M>
void vcg::ndim::Matrix< TYPE >::DotProduct ( Point< N, TYPE > &  m,
Point< M, TYPE > &  result 
) [inline]

Matrix multiplication: calculates the cross product.

Parameters:
referenceto the matrix to multiply by
Returns:
the matrix product

Definition at line 507 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::Dump ( ) [inline]

Print all matrix elements

Definition at line 736 of file old_deprecated_matrix.h.

template<class TYPE>
TYPE vcg::ndim::Matrix< TYPE >::ElementAt ( unsigned int  i,
unsigned int  j 
) [inline]

Return the element stored in the i-th rows at the j-th column

Parameters:
ithe row index
jthe column index
Returns:
the element

Definition at line 213 of file old_deprecated_matrix.h.

template<class TYPE>
TYPE* vcg::ndim::Matrix< TYPE >::GetColumn ( const unsigned int  j) [inline]

Get the j-th column on the matrix.

Parameters:
jthe column index.
Returns:
the reference to the column elements. This pointer must be deallocated by the caller.

Definition at line 310 of file old_deprecated_matrix.h.

template<class TYPE>
TYPE* vcg::ndim::Matrix< TYPE >::GetRow ( const unsigned int  i) [inline]

Get the i-th row on the matrix.

Parameters:
ithe column index.
Returns:
the reference to the row elements. This pointer must be deallocated by the caller.

Definition at line 325 of file old_deprecated_matrix.h.

template<class TYPE>
bool vcg::ndim::Matrix< TYPE >::operator!= ( const Matrix< TYPE > &  m) const [inline]

Inequality operator

Parameters:
m
Returns:
true iff the matrices have different size or if their elements have different values.

Definition at line 195 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE> vcg::ndim::Matrix< TYPE >::operator* ( const Matrix< TYPE > &  m) const [inline]

Matrix multiplication: calculates the cross product.

Parameters:
mreference to the matrix to multiply by
Returns:
the matrix product

Definition at line 467 of file old_deprecated_matrix.h.

template<class TYPE>
ScalarType* vcg::ndim::Matrix< TYPE >::operator* ( const ScalarType  v[]) const [inline]

Matrix-Vector product. Computes the product of the matrix by the vector v.

Parameters:
vreference to the vector to multiply by
Returns:
the matrix-vector product. This pointer must be deallocated by the caller

Definition at line 489 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE> vcg::ndim::Matrix< TYPE >::operator* ( const MatrixDiagBase m) const [inline]

Matrix multiplication by a diagonal matrix

Definition at line 520 of file old_deprecated_matrix.h.

template<class TYPE>
Point3<TYPE> vcg::ndim::Matrix< TYPE >::operator* ( Point3< TYPE > &  p) const [inline]

Matrix-vector multiplication.

Parameters:
referenceto the 3-dimensional vector to multiply by
Returns:
the resulting vector

Definition at line 556 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE> vcg::ndim::Matrix< TYPE >::operator* ( const TYPE  k) const [inline]

Scalar multiplication.

Parameters:
kvalue to multiply every member by
Returns:
the resultant matrix

Definition at line 610 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE>& vcg::ndim::Matrix< TYPE >::operator*= ( const TYPE  k) [inline]

(Modifier) Multiplies each element of this matrix by the scalar constant k.

Parameters:
kthe scalar constant
Returns:
the modified matrix

Definition at line 442 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE> vcg::ndim::Matrix< TYPE >::operator+ ( const TYPE  k) [inline]

Scalar sum.

Parameters:
k
Returns:
the resultant matrix

Definition at line 572 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE>& vcg::ndim::Matrix< TYPE >::operator+= ( const Matrix< TYPE > &  m) [inline]

Adds a matrix m to this matrix.

Parameters:
mreference to matrix to add to this
Returns:
the matrix sum.

Definition at line 390 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE>& vcg::ndim::Matrix< TYPE >::operator+= ( const TYPE  k) [inline]

(Modifier) Add to each element of this matrix the scalar constant k.

Parameters:
kthe scalar constant
Returns:
the modified matrix

Definition at line 418 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE> vcg::ndim::Matrix< TYPE >::operator- ( const TYPE  k) [inline]

Scalar difference.

Parameters:
k
Returns:
the resultant matrix

Definition at line 585 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE> vcg::ndim::Matrix< TYPE >::operator- ( ) const [inline]

Negate all matrix elements

Returns:
the modified matrix

Definition at line 597 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE>& vcg::ndim::Matrix< TYPE >::operator-= ( const Matrix< TYPE > &  m) [inline]

Subtracts a matrix m to this matrix.

Parameters:
mreference to matrix to subtract
Returns:
the matrix difference.

Definition at line 404 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE>& vcg::ndim::Matrix< TYPE >::operator-= ( const TYPE  k) [inline]

(Modifier) Subtract from each element of this matrix the scalar constant k.

Parameters:
kthe scalar constant
Returns:
the modified matrix

Definition at line 430 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE> vcg::ndim::Matrix< TYPE >::operator/ ( const TYPE  k) [inline]

Scalar division.

Parameters:
kvalue to divide every member by
Returns:
the resultant matrix

Definition at line 623 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE>& vcg::ndim::Matrix< TYPE >::operator/= ( const TYPE  k) [inline]

(Modifier) Divides each element of this matrix by the scalar constant k.

Parameters:
kthe scalar constant
Returns:
the modified matrix

Definition at line 454 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix<TYPE>& vcg::ndim::Matrix< TYPE >::operator= ( const Matrix< TYPE > &  m) [inline]

Assignment operator

Parameters:
m...

Definition at line 373 of file old_deprecated_matrix.h.

template<class TYPE>
bool vcg::ndim::Matrix< TYPE >::operator== ( const Matrix< TYPE > &  m) const [inline]

Equality operator.

Parameters:
m
Returns:
true iff the matrices have same size and its elements have same values.

Definition at line 178 of file old_deprecated_matrix.h.

template<class TYPE>
TYPE* vcg::ndim::Matrix< TYPE >::operator[] ( const unsigned int  i) [inline]

Subscript operator:

Parameters:
ithe index of the row
Returns:
a reference to the i-th matrix row

Definition at line 288 of file old_deprecated_matrix.h.

template<class TYPE>
const TYPE* vcg::ndim::Matrix< TYPE >::operator[] ( const unsigned int  i) const [inline]

Const subscript operator

Parameters:
ithe index of the row
Returns:
a reference to the i-th matrix row

Definition at line 299 of file old_deprecated_matrix.h.

template<class TYPE>
template<int N, int M>
void vcg::ndim::Matrix< TYPE >::OuterProduct ( const Point< N, TYPE >  a,
const Point< M, TYPE >  b 
) [inline]

Matrix from outer product.

Definition at line 537 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::Resize ( const unsigned int  m,
const unsigned int  n 
) [inline]

Resize the current matrix.

Parameters:
mthe number of matrix rows.
nthe number of matrix columns.

Definition at line 694 of file old_deprecated_matrix.h.

template<class TYPE>
unsigned int vcg::ndim::Matrix< TYPE >::RowsNumber ( ) const [inline]

Number of rows

Definition at line 168 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::SetColumn ( const unsigned int  j,
TYPE *  v 
) [inline]

Set the values of j-th column to v[j]

Parameters:
jthe column index
v...

Definition at line 657 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::SetDiagonal ( TYPE *  v) [inline]

Set the diagonal elements vi,i to v[i]

Parameters:
v

Definition at line 682 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::SetIdentity ( ) [inline]

Set the matrix to identity.

Definition at line 644 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::SetRow ( const unsigned int  i,
TYPE *  v 
) [inline]

Set the elements of the i-th row to v[j]

Parameters:
ithe row index
v...

Definition at line 670 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::SetZero ( ) [inline]

Set all the matrix elements to zero.

Definition at line 635 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::SwapColumns ( const unsigned int  i,
const unsigned int  j 
) [inline]

Swaps the values of the elements between the i-th and the j-th column.

Parameters:
ithe index of the first column
jthe index of the second column

Definition at line 340 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::SwapRows ( const unsigned int  i,
const unsigned int  j 
) [inline]

Swaps the values of the elements between the i-th and the j-th row.

Parameters:
ithe index of the first row
jthe index of the second row

Definition at line 357 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::Transpose ( ) [inline]

Matrix transposition operation: set the current matrix to its transpose

Definition at line 710 of file old_deprecated_matrix.h.

template<class TYPE>
Matrix vcg::ndim::Matrix< TYPE >::transpose ( ) [inline]

Definition at line 724 of file old_deprecated_matrix.h.

template<class TYPE>
void vcg::ndim::Matrix< TYPE >::transposeInPlace ( ) [inline]

Definition at line 730 of file old_deprecated_matrix.h.


Member Data Documentation

template<class TYPE>
unsigned int vcg::ndim::Matrix< TYPE >::_columns [protected]

the number of matrix rows

Definition at line 755 of file old_deprecated_matrix.h.

template<class TYPE>
ScalarType* vcg::ndim::Matrix< TYPE >::_data [protected]

the matrix elements

Definition at line 758 of file old_deprecated_matrix.h.

template<class TYPE>
unsigned int vcg::ndim::Matrix< TYPE >::_rows [protected]

the number of matrix rows

Definition at line 748 of file old_deprecated_matrix.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:50