vcg::ndim::Matrix< TYPE > Class Template Reference
[Math]

#include <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 (const Matrix< TYPE > &m)
 Matrix ()
 Matrix (unsigned int m, unsigned int n, TYPE *values)
 Matrix (unsigned int m, unsigned int n)
bool operator!= (const Matrix< TYPE > &m) const
Matrix< TYPE > operator* (const TYPE k) const
Point3< TYPE > operator* (Point3< TYPE > &p) const
Matrix< TYPE > operator* (const MatrixDiagBase &m) const
ScalarTypeoperator* (const ScalarType v[]) const
Matrix< TYPE > operator* (const Matrix< TYPE > &m) const
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)
Matrix< TYPE > operator- () 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 > &m)
bool operator== (const Matrix< TYPE > &m) const
const TYPE * operator[] (const unsigned int i) const
TYPE * operator[] (const unsigned int i)
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)
Matrix transpose ()
void 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 78 of file deprecated_matrix.h.


Member Typedef Documentation

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

Definition at line 82 of file 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:
m the number of matrix rows
n the number of matrix columns

Definition at line 90 of file 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:
m the number of matrix rows
n the number of matrix columns
values the values of the matrix elements

Definition at line 105 of file deprecated_matrix.h.

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

Empty constructor Just create the object

Definition at line 121 of file 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:
m the matrix to be copied

Definition at line 133 of file deprecated_matrix.h.

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

Default destructor

Definition at line 149 of file 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 256 of file deprecated_matrix.h.

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

Number of columns

Definition at line 157 of file 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 222 of file 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:
reference to the matrix to multiply by
Returns:
the matrix product

Definition at line 505 of file deprecated_matrix.h.

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

Print all matrix elements

Definition at line 734 of file 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:
i the row index
j the column index
Returns:
the element

Definition at line 211 of file 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:
j the column index.
Returns:
the reference to the column elements. This pointer must be deallocated by the caller.

Definition at line 308 of file 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:
i the column index.
Returns:
the reference to the row elements. This pointer must be deallocated by the caller.

Definition at line 323 of file 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 193 of file deprecated_matrix.h.

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

Scalar multiplication.

Parameters:
k value to multiply every member by
Returns:
the resultant matrix

Definition at line 608 of file deprecated_matrix.h.

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

Matrix-vector multiplication.

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

Definition at line 554 of file 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 518 of file 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:
v reference to the vector to multiply by
Returns:
the matrix-vector product. This pointer must be deallocated by the caller

Definition at line 487 of file 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:
m reference to the matrix to multiply by
Returns:
the matrix product

Definition at line 465 of file 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:
k the scalar constant
Returns:
the modified matrix

Definition at line 440 of file 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 570 of file 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:
k the scalar constant
Returns:
the modified matrix

Definition at line 416 of file 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:
m reference to matrix to add to this
Returns:
the matrix sum.

Definition at line 388 of file 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 595 of file 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 583 of file 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:
k the scalar constant
Returns:
the modified matrix

Definition at line 428 of file 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:
m reference to matrix to subtract
Returns:
the matrix difference.

Definition at line 402 of file deprecated_matrix.h.

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

Scalar division.

Parameters:
k value to divide every member by
Returns:
the resultant matrix

Definition at line 621 of file 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:
k the scalar constant
Returns:
the modified matrix

Definition at line 452 of file 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 371 of file 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 176 of file deprecated_matrix.h.

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

Const subscript operator

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

Definition at line 297 of file deprecated_matrix.h.

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

Subscript operator:

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

Definition at line 286 of file 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 535 of file 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:
m the number of matrix rows.
n the number of matrix columns.

Definition at line 692 of file deprecated_matrix.h.

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

Number of rows

Definition at line 166 of file 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:
j the column index
v ...

Definition at line 655 of file 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 680 of file deprecated_matrix.h.

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

Set the matrix to identity.

Definition at line 642 of file 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:
i the row index
v ...

Definition at line 668 of file deprecated_matrix.h.

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

Set all the matrix elements to zero.

Definition at line 633 of file 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:
i the index of the first column
j the index of the second column

Definition at line 338 of file 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:
i the index of the first row
j the index of the second row

Definition at line 355 of file deprecated_matrix.h.

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

Definition at line 722 of file 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 708 of file deprecated_matrix.h.

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

Definition at line 728 of file 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 753 of file deprecated_matrix.h.

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

the matrix elements

Definition at line 756 of file deprecated_matrix.h.

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

the number of matrix rows

Definition at line 746 of file deprecated_matrix.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:23:25 2013