#include <Matrix.hpp>
Public Member Functions | |
Matrix () | |
Constructor to build a 0 size matrix. | |
Matrix (const Matrix< T > &m) | |
Copy constructor Create a matrix by copying the input matrix. | |
Matrix (const Matrix< T > *m) | |
Copy constructor Create a matrix by copying the input matrix. | |
Matrix (const size_t &n, const size_t &m) | |
Create a n*m matrix Create a n*m matrix. | |
Matrix (const size_t &n) | |
Create a n*n matrix Create a n*m matrix. | |
Matrix (const size_t &n, const size_t &m, const T &d) | |
Create a n*m matrix Create a n*m matrix and use the value d to set the data of the matrix. | |
Matrix (const size_t &n, const size_t &m, T *a) | |
create a n*m matrix create a n*m matrix and set data by using the values array d | |
Matrix (const size_t &n, T *a) | |
create a n*n matrix create a n*n matrix and use the value d to set the data of the matrix | |
Matrix (const size_t &n, const size_t &m, const Vector< T > &v, const bool &setasrows=true) | |
Create a n*(size of v) or (size of v)*n matrix Create a matrix using the vector v. | |
Matrix (const size_t &n, const Vector< T > *v, const bool &setasrows=true) | |
Create a n*(size of v) or (size of v)*n matrix Create a matrix using the pointer on the vector v. | |
virtual | ~Matrix (void) |
Destructor. | |
virtual T * | begin () const |
getting the raw data of the image | |
virtual T * | end () const |
getting the end of raw data of the image | |
T & | at (const unsigned int &i, const unsigned int &j) |
Access to an element of the matrix the function allows to reach a specific element of the matrix using m(i,j). | |
const T & | at (const unsigned int &i, const unsigned int &j) const |
Access to an element of the matrix the function allows to reach a specific element of the matrix using m(i,j). | |
bool | operator== (const Matrix< T > &m) const |
Test if the matrix is equal to another one. | |
bool | operator!= (const Matrix< T > &m) const |
Test if the matrix differ from another one. | |
Matrix< T > & | operator= (const Matrix< T > &m) |
Copy m matrix to this matrix if they have the same size; if this matrix has rows=columns=0, allocate the adequat memory before the copy. | |
Matrix< T > & | operator= (const T &value) |
Fill the matrix with a value. | |
Matrix< T > | operator+ (const Matrix< T > &m) const |
Adds two matrices. | |
Matrix< T > | operator- (const Matrix< T > &m) const |
Subtracts two matrices. | |
Matrix< T > | operator/ (const T &d) const |
Divides the matrix with a value. | |
Matrix< T > | operator* (const Matrix< T > &m) const |
Multiplies two matrices. | |
Vector< T > | operator* (const Vector< T > &v) const |
Multiplies the matrix with a vector. | |
Matrix< T > | operator* (const T &d) const |
Multiplies the matrix with a value. | |
void | times (const Matrix< T > &m1, const Matrix< T > &m2) |
Multiplies the matrix m1 with the matrix m2 in the current matrix. | |
Matrix< T > | operator- (void) const |
Compute opposite of the matrix. | |
Matrix< T > & | operator+= (const Matrix< T > &m) |
Adds the matrix with a matrix. | |
Matrix< T > & | operator+= (const T &d) |
Adds d to all the elements of the matrix. | |
Matrix< T > & | operator-= (const Matrix< T > &m) |
Subtracts the matrix with a matrix. | |
Matrix< T > & | operator-= (const T &d) |
Subtracts d to all the elements of the matrix. | |
Matrix< T > & | operator/= (const T &d) |
Divides the matrix with a value All values of the matrix are divided by d. | |
Matrix< T > & | operator*= (const Matrix< T > &m) |
Multiplies the matrix with a matrix. | |
Matrix< T > & | operator*= (const T &d) |
Multiplies the matrix with a value. | |
T * | operator[] (const unsigned int &i) const |
Access to a row of the matrix The function is used to reach a specific element of the matrix. | |
T & | operator() (const unsigned int &i, const unsigned int &j) |
Access to an element of the matrix the function allows to reach a specific element of the matrix using m(i,j). | |
const T & | operator() (const unsigned int &i, const unsigned int &j) const |
Access to an element of the matrix the function allows to reach a specific element of the matrix using m(i,j). | |
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. | |
double | getNorm (void) const |
Returns the norm of the matrix The norm is defined as follow : ![]() | |
const T * | getMatrixArray (void) const |
Returns data of the matrix as an array The size of the array is rows*columns. | |
Matrix< T > & | transpose (void) |
Transposes inplace the current matrix. | |
Matrix< T > | getTranspose (void) const |
Transposes a copy of the matrix Creates and transposes a copy of this matrix. | |
Matrix< T > & | power (const unsigned int &p) |
Computes inplace the power p of this matrix. | |
void | setIdentity (void) |
sets the matrix to identity | |
void | setZero (void) |
sets values of the matrix to zero | |
void | fill (const T &d) |
Sets the value d on every entry of the vector. | |
void | roundZero (const double &d=1.0e-14) |
sets values near 0 (d more or less) to 0 | |
void | setSubMatrix (const unsigned int &row, const unsigned int &column, const Matrix< T > &m) |
Copies the content of matrix m inside this matrix. | |
Matrix< T > | getSubMatrix (const unsigned int &firstrow, const unsigned int &row, const unsigned int &firstcolumn, const unsigned int &column) |
Return subMatrix of the current matrix. | |
void | setRow (const unsigned int &row, const Vector< T > &v) |
Defines a row of the matrix using a vector. | |
void | setRow (const unsigned int &row, T *a) |
Defines a row of the matrix using an array of data. | |
void | setRow (const unsigned int &row, const T &d) |
Defines a row of the matrix using the constant d. | |
void | setColumn (const unsigned int &column, const Vector< T > &v) |
Defines a column of the matrix using a vector. | |
void | setColumn (const unsigned int &column, const T *a) |
Defines a column of the matrix using an array of data. | |
void | setColumn (const unsigned int &column, const T &d) |
Defines a column of the matrix using the constant d. | |
Vector< T > | getRow (const unsigned int &row) const |
Returns a vector with values from a specific row. | |
Vector< T > | getColumn (const unsigned int &column) const |
Returns a vector with values from a specific column. | |
void | swapRows (const unsigned int &row1, const unsigned int &row2) |
Swaps two rows of this matrix The swap is not applied if row1=row2. | |
void | swapColumns (const unsigned int &column1, const unsigned int &column2) |
Swaps two columns of this matrix The swap is not applied if column1=column2. | |
void | setDiagonal (const Vector< T > &v) |
Sets diagonal of the matrix with values from a vector. | |
void | setDiagonal (const T *a) |
Sets diagonal of the matrix with values from an array. | |
void | setDiagonal (const T &d) |
Sets diagonal of the matrix with a constant. | |
Vector< T > | getDiagonal (void) const |
Return the diagonal of the matrix as a vector. | |
bool | isSquare (void) const |
Check if it is a square matrix or not. | |
T | trace (void) const |
Trace of the Matrix This represents the sum of each element on the diagonal. | |
void | cross3x3 (const kn::Vector< T > v) |
substitute of a vector3 cross product using 3x3 matrix. | |
Protected Member Functions | |
void | allocate (void) |
Allocates memory and initialize data. | |
Protected Attributes | |
size_t | rowsMatrix |
Number of rows in the matrix. | |
size_t | columnsMatrix |
Number of columns in the matrix. | |
T * | data |
Content of the matrix. | |
T * | begin_ |
Pointer on the beginning of the data. | |
T * | end_ |
Pointer on the end of the data. | |
T ** | accessor |
Pointers on the beginning of each rows. |
Definition at line 54 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | ) | [inline] |
kn::Matrix< T >::Matrix | ( | const Matrix< T > & | m | ) | [inline] |
Copy constructor Create a matrix by copying the input matrix.
m | the matrix to copy |
Definition at line 697 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | const Matrix< T > * | m | ) | [inline] |
Copy constructor Create a matrix by copying the input matrix.
m | the pointer to the matrix to copy |
MathException | pointer is null |
Definition at line 705 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | const size_t & | n, | |
const size_t & | m | |||
) | [inline] |
Create a n*m matrix Create a n*m matrix.
Data are not initialized.
n | number of rows | |
m | number of columns |
MathException | n or m are null |
Definition at line 715 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | const size_t & | n | ) | [inline, explicit] |
Create a n*n matrix Create a n*m matrix.
Data are not initialized.
n | number of rows |
MathException | n or m are null |
Definition at line 725 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | const size_t & | n, | |
const size_t & | m, | |||
const T & | d | |||
) | [inline] |
Create a n*m matrix Create a n*m matrix and use the value d to set the data of the matrix.
n | number of rows | |
m | number of columns | |
d | value used to set data of the matrix |
MathException | n or m are null |
Definition at line 734 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | const size_t & | n, | |
const size_t & | m, | |||
T * | a | |||
) | [inline] |
create a n*m matrix create a n*m matrix and set data by using the values array d
n | number of rows | |
m | number of columns | |
a | pointer to an array of data |
MathException | n or m or d are null |
Definition at line 746 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | const size_t & | n, | |
T * | a | |||
) | [inline] |
create a n*n matrix create a n*n matrix and use the value d to set the data of the matrix
n | number of rows and columns | |
a | pointer to an array of data |
MathException | n or d are null |
Definition at line 761 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | const size_t & | n, | |
const size_t & | m, | |||
const Vector< T > & | v, | |||
const bool & | setasrows = true | |||
) | [inline] |
Create a n*(size of v) or (size of v)*n 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
n | number of rows | |
m | number of columns | |
v | a vector | |
setasrows | defined if vector is used to fill columns or rows |
MathException | n or m or size of vector is null |
Definition at line 773 of file Matrix.hpp.
kn::Matrix< T >::Matrix | ( | const size_t & | n, | |
const Vector< T > * | v, | |||
const bool & | setasrows = true | |||
) | [inline] |
Create a n*(size of v) or (size of v)*n 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
n | number of rows or columns | |
v | a pointer on an array of vectors | |
setasrows | defined if vector is used to fill columns or rows |
MathException | n or v or *v size are null | |
MathException | if *v sizes are different |
Definition at line 795 of file Matrix.hpp.
virtual kn::Matrix< T >::~Matrix | ( | void | ) | [inline, virtual] |
void kn::Matrix< T >::allocate | ( | void | ) | [inline, protected] |
const T & kn::Matrix< T >::at | ( | const unsigned int & | i, | |
const unsigned int & | j | |||
) | const [inline] |
Access to an element of the matrix the function allows to reach a specific element of the matrix using m(i,j).
i | the number of the row | |
j | the number of the column |
MathException | i or j are out of bounds |
Definition at line 854 of file Matrix.hpp.
T & kn::Matrix< T >::at | ( | const unsigned int & | i, | |
const unsigned int & | j | |||
) | [inline] |
Access to an element of the matrix the function allows to reach a specific element of the matrix using m(i,j).
i | the number of the row | |
j | the number of the column |
MathException | i or j are out of bounds |
Definition at line 846 of file Matrix.hpp.
virtual T* kn::Matrix< T >::begin | ( | ) | const [inline, virtual] |
getting the raw data of the image
Definition at line 220 of file Matrix.hpp.
size_t kn::Matrix< T >::columns | ( | void | ) | const [inline] |
Returns the number of columns of the matrix.
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 445 of file Matrix.hpp.
void kn::Matrix< T >::cross3x3 | ( | const kn::Vector< 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.
v | : the vector3 used to fill the matrix |
MathException | matrix and vector dimension should be 3 |
Definition at line 1327 of file Matrix.hpp.
virtual T* kn::Matrix< T >::end | ( | ) | const [inline, virtual] |
getting the end of raw data of the image
Definition at line 225 of file Matrix.hpp.
void kn::Matrix< T >::fill | ( | const T & | d | ) | [inline] |
Vector< T > kn::Matrix< T >::getColumn | ( | const unsigned int & | column | ) | const [inline] |
Returns a vector with values from a specific column.
column | the number of the column |
MathException | column is out of bounds |
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1247 of file Matrix.hpp.
Vector< T > kn::Matrix< T >::getDiagonal | ( | void | ) | const [inline] |
Return the diagonal of the matrix as a vector.
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1309 of file Matrix.hpp.
const T* kn::Matrix< T >::getMatrixArray | ( | void | ) | const [inline] |
Returns data of the matrix as an array The size of the array is rows*columns.
Definition at line 462 of file Matrix.hpp.
double kn::Matrix< T >::getNorm | ( | void | ) | const [inline] |
Returns the norm of the matrix The norm is defined as follow : .
Definition at line 1078 of file Matrix.hpp.
Vector< T > kn::Matrix< T >::getRow | ( | const unsigned int & | row | ) | const [inline] |
Returns a vector with values from a specific row.
row | the number of the row |
MathException | row is out of bounds |
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1237 of file Matrix.hpp.
Matrix< T > kn::Matrix< T >::getSubMatrix | ( | const unsigned int & | firstrow, | |
const unsigned int & | row, | |||
const unsigned int & | firstcolumn, | |||
const unsigned int & | column | |||
) | [inline] |
Return subMatrix of the current matrix.
Data from the current matrix are duplicated from the position (firstrow,firstcolumn) and return in a new matrix of size (row,column).
firstrow | the row where start the copy | |
row | the number of row to copy | |
firstcolumn | the column where start the copy | |
column | the number of column to copy |
MathException | row or column are out of bounds |
Definition at line 1160 of file Matrix.hpp.
Matrix<T> kn::Matrix< T >::getTranspose | ( | void | ) | const [inline] |
Transposes a copy of the matrix Creates and transposes a copy of this matrix.
The current matrix is unchanged
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 478 of file Matrix.hpp.
bool kn::Matrix< T >::isSquare | ( | void | ) | const [inline] |
Check if it is a square matrix or not.
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 664 of file Matrix.hpp.
bool kn::Matrix< T >::operator!= | ( | const Matrix< T > & | m | ) | const [inline] |
Test if the matrix differ from another one.
m | the matrix which is compared this matrix |
Definition at line 264 of file Matrix.hpp.
const T & kn::Matrix< T >::operator() | ( | const unsigned int & | i, | |
const unsigned int & | j | |||
) | const [inline] |
Access to an element of the matrix the function allows to reach a specific element of the matrix using m(i,j).
i | the number of the row | |
j | the number of the column |
Definition at line 1070 of file Matrix.hpp.
T & kn::Matrix< T >::operator() | ( | const unsigned int & | i, | |
const unsigned int & | j | |||
) | [inline] |
Access to an element of the matrix the function allows to reach a specific element of the matrix using m(i,j).
i | the number of the row | |
j | the number of the column |
Definition at line 1065 of file Matrix.hpp.
Matrix< T > kn::Matrix< T >::operator* | ( | const T & | d | ) | const [inline] |
Multiplies the matrix with a value.
d | the value multiplied with this matrix |
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 974 of file Matrix.hpp.
Vector< T > kn::Matrix< T >::operator* | ( | const Vector< T > & | v | ) | const [inline] |
Multiplies the matrix with a vector.
v | the vector multiplied with this matrix |
MathException | vector size is incorrect |
Reimplemented in kn::Matrix3x3< T >.
Definition at line 956 of file Matrix.hpp.
Matrix< T > kn::Matrix< T >::operator* | ( | const Matrix< T > & | m | ) | const [inline] |
Multiplies two matrices.
m | the matrix multiplied with this matrix |
MathException | matrice size is incorrect |
Definition at line 920 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator*= | ( | const T & | d | ) | [inline] |
Multiplies the matrix with a value.
d | the value multiplied with this matrix |
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1053 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator*= | ( | const Matrix< T > & | m | ) | [inline] |
Multiplies the matrix with a matrix.
m | the matrix multiplied with this matrix |
MathException | matrix size is incorrect |
Definition at line 1027 of file Matrix.hpp.
Matrix< T > kn::Matrix< T >::operator+ | ( | const Matrix< T > & | m | ) | const [inline] |
Adds two matrices.
m | the matrix added to this matrix |
MathException | matrix size is incorrect |
Definition at line 896 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator+= | ( | const T & | d | ) | [inline] |
Adds d to all the elements of the matrix.
d | the value to add |
Definition at line 1015 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator+= | ( | const Matrix< T > & | m | ) | [inline] |
Adds the matrix with a matrix.
m | the matrix added with this matrix |
MathException | matrix size is incorrect |
Definition at line 990 of file Matrix.hpp.
Matrix< T > kn::Matrix< T >::operator- | ( | void | ) | const [inline] |
Compute opposite of the matrix.
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 982 of file Matrix.hpp.
Matrix< T > kn::Matrix< T >::operator- | ( | const Matrix< T > & | m | ) | const [inline] |
Subtracts two matrices.
m | the matrix subtracted to this matrix |
MathException | matrix size is incorrect |
Definition at line 904 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator-= | ( | const T & | d | ) | [inline] |
Subtracts d to all the elements of the matrix.
d | the value to subtracts |
Definition at line 1021 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator-= | ( | const Matrix< T > & | m | ) | [inline] |
Subtracts the matrix with a matrix.
m | the matrix subtracted with this matrix |
MathException | matrix size is incorrect |
Definition at line 999 of file Matrix.hpp.
Matrix< T > kn::Matrix< T >::operator/ | ( | const T & | d | ) | const [inline] |
Divides the matrix with a value.
d | the value divided with this matrix |
MathException | d is null |
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 912 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator/= | ( | const T & | d | ) | [inline] |
Divides the matrix with a value All values of the matrix are divided by d.
d | the value divided with this matrix |
MathException | d is null |
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1007 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator= | ( | const T & | value | ) | [inline] |
Fill the matrix with a value.
value | Value to set the matrix with |
Definition at line 888 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::operator= | ( | const Matrix< T > & | m | ) | [inline] |
Copy m matrix to this matrix if they have the same size; if this matrix has rows=columns=0, allocate the adequat memory before the copy.
m | the matrix used to defined this matrix |
MathException | matrix size is incorrect |
Definition at line 870 of file Matrix.hpp.
bool kn::Matrix< T >::operator== | ( | const Matrix< T > & | m | ) | const [inline] |
Test if the matrix is equal to another one.
m | the matrix which is compared this matrix |
Definition at line 863 of file Matrix.hpp.
T * kn::Matrix< T >::operator[] | ( | const unsigned int & | i | ) | const [inline] |
Access to a row of the matrix The function is used to reach a specific element of the matrix.
The function returns a pointer to a row of the matrix. Thus, the access to an element can be achieved as follow : m[i][j] There is no checking on column value access thus use this function at your own risk.
i | the number of the row |
Definition at line 1060 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::power | ( | const unsigned int & | p | ) | [inline] |
Computes inplace the power p of this matrix.
MathException | not a square matrix |
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1110 of file Matrix.hpp.
void kn::Matrix< T >::roundZero | ( | const double & | d = 1.0e-14 |
) | [inline] |
sets values near 0 (d more or less) to 0
d | the limit around which values are set to 0 |
Definition at line 1137 of file Matrix.hpp.
size_t kn::Matrix< T >::rows | ( | void | ) | const [inline] |
Returns the number of rows of the matrix.
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 437 of file Matrix.hpp.
void kn::Matrix< T >::setColumn | ( | const unsigned int & | column, | |
const T & | d | |||
) | [inline] |
Defines a column of the matrix using the constant d.
column | the number of the column where the constant is copied | |
d | the constant |
MathException | column is out of bounds |
Definition at line 1227 of file Matrix.hpp.
void kn::Matrix< T >::setColumn | ( | const unsigned int & | column, | |
const T * | a | |||
) | [inline] |
Defines a column of the matrix using an array of data.
column | the number of the column where the array is copied | |
a | the array |
MathException | a is null | |
MathException | column is out of bounds |
Definition at line 1216 of file Matrix.hpp.
void kn::Matrix< T >::setColumn | ( | const unsigned int & | column, | |
const Vector< T > & | v | |||
) | [inline] |
Defines a column of the matrix using a vector.
column | the number of the column where the vector is copied | |
v | the vector |
MathException | v size is null | |
MathException | column is out of bounds |
Definition at line 1204 of file Matrix.hpp.
void kn::Matrix< T >::setDiagonal | ( | const T & | d | ) | [inline] |
Sets diagonal of the matrix with a constant.
d | a value |
Definition at line 1299 of file Matrix.hpp.
void kn::Matrix< T >::setDiagonal | ( | const T * | a | ) | [inline] |
Sets diagonal of the matrix with values from an array.
a | an array of values |
MathException | pointer is null |
Definition at line 1291 of file Matrix.hpp.
void kn::Matrix< T >::setDiagonal | ( | const Vector< T > & | v | ) | [inline] |
Sets diagonal of the matrix with values from a vector.
v | the vector of values |
MathException | vector size is incorrect |
Definition at line 1279 of file Matrix.hpp.
void kn::Matrix< T >::setIdentity | ( | void | ) | [inline] |
sets the matrix to identity
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1130 of file Matrix.hpp.
void kn::Matrix< T >::setRow | ( | const unsigned int & | row, | |
const T & | d | |||
) | [inline] |
Defines a row of the matrix using the constant d.
row | the number of the row where the constant is copied | |
d | the constant |
MathException | out of bounds |
Definition at line 1195 of file Matrix.hpp.
void kn::Matrix< T >::setRow | ( | const unsigned int & | row, | |
T * | a | |||
) | [inline] |
Defines a row of the matrix using an array of data.
row | the number of the row where the array is copied | |
a | the array |
MathException | a is null | |
MathException | row is out of bounds |
Definition at line 1187 of file Matrix.hpp.
void kn::Matrix< T >::setRow | ( | const unsigned int & | row, | |
const Vector< T > & | v | |||
) | [inline] |
Defines a row of the matrix using a vector.
row | the number of the row where the vector is copied | |
v | the vector |
MathException | v size is null | |
MathException | row is out of bounds |
Definition at line 1175 of file Matrix.hpp.
void kn::Matrix< T >::setSubMatrix | ( | const unsigned int & | row, | |
const unsigned int & | column, | |||
const Matrix< T > & | m | |||
) | [inline] |
Copies the content of matrix m inside this matrix.
Data from the matrix m are duplicated inside this matrix at the position row and column.
row | the row where start the copy | |
column | the column where start the copy | |
m | matrix duplicated inside this matrix |
MathException | m cannot be duplicated inside this matrix | |
MathException | row and column are out of bounds |
Definition at line 1147 of file Matrix.hpp.
void kn::Matrix< T >::setZero | ( | void | ) | [inline] |
void kn::Matrix< T >::swapColumns | ( | const unsigned int & | column1, | |
const unsigned int & | column2 | |||
) | [inline] |
Swaps two columns of this matrix The swap is not applied if column1=column2.
column1 | number of the first column | |
column2 | number of the second column |
MathException | column1 or column2 are out of bounds |
Definition at line 1268 of file Matrix.hpp.
void kn::Matrix< T >::swapRows | ( | const unsigned int & | row1, | |
const unsigned int & | row2 | |||
) | [inline] |
Swaps two rows of this matrix The swap is not applied if row1=row2.
row1 | number of the first row | |
row2 | number of the second row |
MathException | row1 or row2 are out of bounds |
Definition at line 1258 of file Matrix.hpp.
void kn::Matrix< T >::times | ( | const Matrix< T > & | m1, | |
const Matrix< T > & | m2 | |||
) | [inline] |
Multiplies the matrix m1 with the matrix m2 in the current matrix.
m1 | the first matrix of this multiplication | |
m2 | the second matrix of this multiplication |
Definition at line 931 of file Matrix.hpp.
T kn::Matrix< T >::trace | ( | void | ) | const [inline] |
Trace of the Matrix This represents the sum of each element on the diagonal.
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1318 of file Matrix.hpp.
Matrix< T > & kn::Matrix< T >::transpose | ( | void | ) | [inline] |
Transposes inplace the current matrix.
Reimplemented in kn::Matrix3x3< T >, and kn::Matrix4x4< T >.
Definition at line 1092 of file Matrix.hpp.
T** kn::Matrix< T >::accessor [protected] |
T* kn::Matrix< T >::begin_ [protected] |
size_t kn::Matrix< T >::columnsMatrix [protected] |
T* kn::Matrix< T >::data [protected] |
T* kn::Matrix< T >::end_ [protected] |
size_t kn::Matrix< T >::rowsMatrix [protected] |