kn::Matrix3x3< T > Class Template Reference

#include <Matrix3x3.hpp>

Inherits Matrix< T >.

Collaboration diagram for kn::Matrix3x3< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Matrix3x3 (void)
 Default constructor Create a 3*3 matrix set to identity.
 Matrix3x3 (const Matrix3x3< T > &m)
 Copy constructor Create a matrix by copying the input matrix.
 Matrix3x3 (const Matrix< T > &m)
 Constructor form Matrix Create a matrix by copying the input matrix.
 Matrix3x3 (const Matrix3x3< T > *m)
 Copy constructor Create a matrix by copying the input matrix.
 Matrix3x3 (const T &d)
 Create a 3*3 matrix Create a 3*3 matrix and use the value d to set the data of the matrix.
 Matrix3x3 (const T *d)
 create a 3*3 matrix create a 3*3 matrix and set data by using the values array d
 Matrix3x3 (const Vector< T > &v, const bool &setasrows=true)
 Create a 3*3 or matrix Create a matrix using the vector v.
 Matrix3x3 (const Vector3< T > *v, const bool &setasrows=true)
 Create a 3*3 matrix Create a matrix using the pointer on the vector v.
 ~Matrix3x3 (void)
 Destructor.
Vector< T > operator* (const Vector< T > &v) const
 Multiplies the matrix with a vector.
size_t rows (void) const
 Returns the number of rows of the matrix.
size_t columns (void) const
 Returns the number of columns of the matrix.
Matrix3x3< T > & transpose (void)
 Transposes inplace the current matrix.
Matrix3x3< T > getTranspose (void) const
 Transposes a copy of the matrix Creates and transposes a copy of this matrix.
void setIdentity (void)
 sets the matrix to identity
bool isSquare (void) const
 Check if it is a square matrix or not.
void cross3x3 (const kn::Vector3< T > v)
 substitute of a vector3 cross product using 3x3 matrix.
Matrix3x3< T > & operator= (const Matrix3x3< T > &m)
 Allocate the matrix m to this matrix.
Matrix3x3< T > operator+ (const Matrix3x3< T > &m) const
 Adds two matrices.
Matrix3x3< T > operator- (const Matrix3x3< T > &m) const
 Subtracts two matrices.
Matrix3x3< T > operator/ (const T &d) const
 Divides the matrix with a value.
Matrix3x3< T > operator* (const Matrix3x3< T > &m) const
 Multiplies two matrices.
Matrix3x3< T > operator* (const T &d) const
 Multiplies the matrix with a value.
Matrix3x3< T > operator- (void) const
 Compute opposite of the matrix.
Matrix3x3< T > & operator+= (const Matrix3x3< T > &m)
 Adds the matrix with a matrix.
Matrix3x3< T > & operator-= (const Matrix3x3< T > &m)
 Subtracts the matrix with a matrix.
Matrix3x3< T > & operator/= (const T &d)
 Divides the matrix with a value All values of the matrix are divided by d.
Matrix3x3< T > & operator*= (const Matrix3x3< T > &m)
 Multiplies the matrix with a matrix.
Matrix3x3< T > & operator*= (const T &d)
 Multiplies the matrix with a value.
Vector3< T > getRow (const unsigned int &row) const
 Returns a vector with values from a specific row.
Vector3< T > getColumn (const unsigned int &column) const
 Returns a vector with values from a specific column.
Vector3< T > getDiagonal (void) const
 Return the diagonal of the matrix as a vector.
Matrix3x3< T > & power (const unsigned int &p)
 Computes inplace the power p of this matrix.
trace (void) const
 Trace of the Matrix.


Detailed Description

template<class T>
class kn::Matrix3x3< T >

Definition at line 38 of file Matrix3x3.hpp.


Constructor & Destructor Documentation

template<class T>
kn::Matrix3x3< T >::Matrix3x3 ( void   )  [inline]

Default constructor Create a 3*3 matrix set to identity.

Definition at line 49 of file Matrix3x3.hpp.

template<class T>
kn::Matrix3x3< T >::Matrix3x3 ( const Matrix3x3< T > &  m  )  [inline]

Copy constructor Create a matrix by copying the input matrix.

Parameters:
m the matrix to copy

Definition at line 60 of file Matrix3x3.hpp.

template<class T >
kn::Matrix3x3< T >::Matrix3x3 ( const Matrix< T > &  m  )  [inline]

Constructor form Matrix Create a matrix by copying the input matrix.

Parameters:
m the matrix to copy
Exceptions:
MathException if m dimensions are differents

Definition at line 397 of file Matrix3x3.hpp.

template<class T >
kn::Matrix3x3< T >::Matrix3x3 ( const Matrix3x3< T > *  m  )  [inline]

Copy constructor Create a matrix by copying the input matrix.

Parameters:
m the pointer to the matrix to copy
Exceptions:
MathException pointer is null

Definition at line 339 of file Matrix3x3.hpp.

template<class T>
kn::Matrix3x3< T >::Matrix3x3 ( const T &  d  )  [inline]

Create a 3*3 matrix Create a 3*3 matrix and use the value d to set the data of the matrix.

Parameters:
d value used to set data of the matrix

Definition at line 87 of file Matrix3x3.hpp.

template<class T >
kn::Matrix3x3< T >::Matrix3x3 ( const T *  d  )  [inline]

create a 3*3 matrix create a 3*3 matrix and set data by using the values array d

Parameters:
d pointer to an array of data
Exceptions:
MathException d is null

Definition at line 349 of file Matrix3x3.hpp.

template<class T >
kn::Matrix3x3< T >::Matrix3x3 ( const Vector< T > &  v,
const bool &  setasrows = true 
) [inline]

Create a 3*3 or matrix Create a matrix using the vector v.

if setasrows is set to true, v is used to fill rows of the matrix, v is used to fill columns otherwise

Parameters:
v a vector
setasrows defined if vector is used to fill columns or rows
Exceptions:
MathException size of vector is different of 3

Definition at line 359 of file Matrix3x3.hpp.

template<class T >
kn::Matrix3x3< T >::Matrix3x3 ( const Vector3< T > *  v,
const bool &  setasrows = true 
) [inline]

Create a 3*3 matrix Create a matrix using the pointer on the vector v.

If setasrows is set to true, v is used to fill rows of the matrix, v is used to fill columns otherwise

Parameters:
v a pointer on an array of vectors
setasrows defined if vector is used to fill columns or rows
Exceptions:
MathException v is null
MathException if *v size are different of 3

Definition at line 377 of file Matrix3x3.hpp.

template<class T>
kn::Matrix3x3< T >::~Matrix3x3 ( void   )  [inline]

Destructor.

Definition at line 127 of file Matrix3x3.hpp.


Member Function Documentation

template<class T>
size_t kn::Matrix3x3< T >::columns ( void   )  const [inline]

Returns the number of columns of the matrix.

Returns:
the number of columns

Reimplemented from kn::Matrix< T >.

Definition at line 159 of file Matrix3x3.hpp.

template<typename T >
void kn::Matrix3x3< T >::cross3x3 ( const kn::Vector3< T >  v  )  [inline]

substitute of a vector3 cross product using 3x3 matrix.

Given two vector3 x and y, we have z = x^y This equation can be linearized as z = A.y with A : 3x3 matrix. This method fills the A 3x3 matrix from the vector x.

Parameters:
v : the vector3 used to fill the matrix

Definition at line 617 of file Matrix3x3.hpp.

template<typename T >
Vector3< T > kn::Matrix3x3< T >::getColumn ( const unsigned int &  column  )  const [inline]

Returns a vector with values from a specific column.

Parameters:
column the number of the column
Returns:
a vector of values
Exceptions:
MathException column is out of bounds

Reimplemented from kn::Matrix< T >.

Definition at line 607 of file Matrix3x3.hpp.

template<typename T >
Vector3< T > kn::Matrix3x3< T >::getDiagonal ( void   )  const [inline]

Return the diagonal of the matrix as a vector.

Returns:
a vector

Reimplemented from kn::Matrix< T >.

Definition at line 589 of file Matrix3x3.hpp.

template<typename T >
Vector3< T > kn::Matrix3x3< T >::getRow ( const unsigned int &  row  )  const [inline]

Returns a vector with values from a specific row.

Parameters:
row the number of the row
Returns:
a vector of values
Exceptions:
MathException row is out of bounds

Reimplemented from kn::Matrix< T >.

Definition at line 597 of file Matrix3x3.hpp.

template<class T>
Matrix3x3<T> kn::Matrix3x3< T >::getTranspose ( void   )  const [inline]

Transposes a copy of the matrix Creates and transposes a copy of this matrix.

The current matrix is unchanged

Returns:
the transposed copy of the matrix

Reimplemented from kn::Matrix< T >.

Definition at line 175 of file Matrix3x3.hpp.

template<class T>
bool kn::Matrix3x3< T >::isSquare ( void   )  const [inline]

Check if it is a square matrix or not.

Returns:
if the matrix is square

Reimplemented from kn::Matrix< T >.

Definition at line 189 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > kn::Matrix3x3< T >::operator* ( const T &  d  )  const [inline]

Multiplies the matrix with a value.

Parameters:
d the value multiplied with this matrix
Returns:
a copy of the matrix

Reimplemented from kn::Matrix< T >.

Definition at line 512 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > kn::Matrix3x3< T >::operator* ( const Matrix3x3< T > &  m  )  const [inline]

Multiplies two matrices.

Parameters:
m the matrix multiplied with this matrix
Returns:
a copy of the matrix
Exceptions:
MathException matrice size is incorrect

Definition at line 494 of file Matrix3x3.hpp.

template<class T >
Vector< T > kn::Matrix3x3< T >::operator* ( const Vector< T > &  v  )  const [inline]

Multiplies the matrix with a vector.

Parameters:
v the vector multiplied with this matrix
Returns:
a vector
Exceptions:
MathException vector size is incorrect

Reimplemented from kn::Matrix< T >.

Definition at line 405 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > & kn::Matrix3x3< T >::operator*= ( const T &  d  )  [inline]

Multiplies the matrix with a value.

Parameters:
d the value multiplied with this matrix
Returns:
the matrix

Reimplemented from kn::Matrix< T >.

Definition at line 567 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > & kn::Matrix3x3< T >::operator*= ( const Matrix3x3< T > &  m  )  [inline]

Multiplies the matrix with a matrix.

Parameters:
m the matrix multiplied with this matrix
Returns:
the matrix
Exceptions:
MathException matrix size is incorrect

Definition at line 550 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > kn::Matrix3x3< T >::operator+ ( const Matrix3x3< T > &  m  )  const [inline]

Adds two matrices.

Parameters:
m the matrix added to this matrix
Returns:
a copy of the matrix
Exceptions:
MathException matrix size is incorrect

Definition at line 470 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > & kn::Matrix3x3< T >::operator+= ( const Matrix3x3< T > &  m  )  [inline]

Adds the matrix with a matrix.

Parameters:
m the matrix added with this matrix
Returns:
the matrix
Exceptions:
MathException matrix size is incorrect

Definition at line 528 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > kn::Matrix3x3< T >::operator- ( void   )  const [inline]

Compute opposite of the matrix.

Returns:
a copy of the matrix

Reimplemented from kn::Matrix< T >.

Definition at line 520 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > kn::Matrix3x3< T >::operator- ( const Matrix3x3< T > &  m  )  const [inline]

Subtracts two matrices.

Parameters:
m the matrix subtracted to this matrix
Returns:
a copy of the matrix
Exceptions:
MathException matrix size is incorrect

Definition at line 478 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > & kn::Matrix3x3< T >::operator-= ( const Matrix3x3< T > &  m  )  [inline]

Subtracts the matrix with a matrix.

Parameters:
m the matrix subtracted with this matrix
Returns:
the matrix
Exceptions:
MathException matrix size is incorrect

Definition at line 535 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > kn::Matrix3x3< T >::operator/ ( const T &  d  )  const [inline]

Divides the matrix with a value.

Parameters:
d the value divided with this matrix
Returns:
a copy of the matrix
Exceptions:
MathException d is null

Reimplemented from kn::Matrix< T >.

Definition at line 486 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > & kn::Matrix3x3< T >::operator/= ( const T &  d  )  [inline]

Divides the matrix with a value All values of the matrix are divided by d.

Parameters:
d the value divided with this matrix
Returns:
the matrix
Exceptions:
MathException d is null

Reimplemented from kn::Matrix< T >.

Definition at line 541 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > & kn::Matrix3x3< T >::operator= ( const Matrix3x3< T > &  m  )  [inline]

Allocate the matrix m to this matrix.

Parameters:
m the matrix used to defined this matrix
Returns:
the matrix
Exceptions:
MathException matrix size is incorrect

Definition at line 461 of file Matrix3x3.hpp.

template<typename T >
Matrix3x3< T > & kn::Matrix3x3< T >::power ( const unsigned int &  p  )  [inline]

Computes inplace the power p of this matrix.

Returns:
this matrix
Exceptions:
MathException not a square matrix

Reimplemented from kn::Matrix< T >.

Definition at line 574 of file Matrix3x3.hpp.

template<class T>
size_t kn::Matrix3x3< T >::rows ( void   )  const [inline]

Returns the number of rows of the matrix.

Returns:
the number of rows

Reimplemented from kn::Matrix< T >.

Definition at line 150 of file Matrix3x3.hpp.

template<class T >
void kn::Matrix3x3< T >::setIdentity ( void   )  [inline]

sets the matrix to identity

Reimplemented from kn::Matrix< T >.

Definition at line 431 of file Matrix3x3.hpp.

template<typename T >
T kn::Matrix3x3< T >::trace ( void   )  const [inline]

Trace of the Matrix.

This represents the sum of each element on the diagonal

Returns:
the trace

Reimplemented from kn::Matrix< T >.

Definition at line 632 of file Matrix3x3.hpp.

template<class T >
Matrix3x3< T > & kn::Matrix3x3< T >::transpose ( void   )  [inline]

Transposes inplace the current matrix.

Returns:
this transposed matrix

Reimplemented from kn::Matrix< T >.

Definition at line 419 of file Matrix3x3.hpp.


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

Generated on Thu Nov 12 16:06:35 2009 for OpenKN-math by  doxygen 1.5.8