Matrix template class with variable number of rows and columns. More...
#include <WMatrix.h>
Public Member Functions | |
WMatrix (size_t n) | |
Produces a square matrix with the given number of components. | |
WMatrix (size_t nbRows, size_t nbCols) | |
Produces a matrix with the given number of components. | |
WMatrix (const WMatrix &newMatrix) | |
Produces a matrix as copy of the one given as parameter. | |
WMatrix (const WMatrix4d &newMatrix) | |
Copies the specified 4x4 matrix. | |
WMatrix (const Eigen::MatrixXd &newMatrix) | |
Copies the specified Eigen::MatrixXd. | |
WMatrix & | makeIdentity () |
Makes the matrix contain the identity matrix, i.e. | |
size_t | getNbRows () const |
Get number of rows. | |
size_t | getNbCols () const |
Get number of columns. | |
T & | operator() (size_t i, size_t j) |
Returns a reference to the component an row i, columns j in order to provide access to the component. | |
const T & | operator() (size_t i, size_t j) const |
Returns a const reference to the component an row i, columns j in order to provide read-only access to the component. | |
operator WMatrix4d () const | |
Cast this matrix to an 4x matrix if it is a 4x4 matrix. | |
operator osg::Matrixd () const | |
Cast this matrix to an 4x4 osg matrix if it is a 4x4 matrix. | |
operator Eigen::MatrixXd () const | |
Cast this matrix to an Eigen::MatrixXd matrix. | |
bool | operator== (const WMatrix &rhs) const |
Compares two matrices and returns true if they are equal. | |
bool | operator!= (const WMatrix &rhs) const |
Compares two matrices and returns true if they are not equal. | |
WMatrix & | operator= (const WMatrix &rhs) |
Assigns the argument WMatrix to this WMatrix. | |
WMatrix | operator* (const WMatrix &rhs) const |
Multiplication of the current matrix with andother matrix. | |
WValue< T > | operator* (const WValue< T > &rhs) const |
Multiplication with a vector. | |
WVector3d | operator* (const WVector3d &rhs) const |
Multiplication with a vector. | |
WMatrix | transposed () const |
Returns the transposed matrix. | |
void | setZero () |
Resets the matrix components to zero. | |
Private Attributes | |
size_t | m_nbCols |
Number of columns of the matrix. The number of rows will be computed by (size/m_nbCols). |
Matrix template class with variable number of rows and columns.
The access function are row-major, which means that the rows are the first parameter or index.
Definition at line 42 of file WMatrix.h.
Produces a square matrix with the given number of components.
The components will be set to zero if T is a type representing numbers.
n | Number of cols and rows in the matrix |
Definition at line 203 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
Produces a matrix with the given number of components.
The components will be set to zero if T is a type representing numbers.
nbRows | number of rows in the matrix | |
nbCols | number of columns in the matrix |
Definition at line 209 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
Produces a matrix as copy of the one given as parameter.
newMatrix | The matrix to be copied. |
Definition at line 219 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
Copies the specified 4x4 matrix.
newMatrix | the matrix to copy |
Definition at line 225 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
Copies the specified Eigen::MatrixXd.
newMatrix | the Eigen::MatrixXd matrix to copy |
Definition at line 238 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
size_t WMatrix< T >::getNbCols | ( | ) | const |
Get number of columns.
Definition at line 338 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
Referenced by WSymmetricSphericalHarmonic::applyFunkRadonTransformation(), WSymmetricSphericalHarmonic::calcGFA(), WMatrix< T >::operator Eigen::MatrixXd(), WMatrix< T >::operator osg::Matrixd(), WMatrix< T >::operator*(), WTensorTypesTest::testCastTensorToMatrix(), WLinearAlgebraFunctionsTest::testComputeSVD(), WMatrixTest::testGetNbRowsAndCols(), WLinearAlgebraFunctionsTest::testPseudoInverse(), WMatrixTest::testTransposed(), and WGridTransformOrtho::WGridTransformOrtho().
size_t WMatrix< T >::getNbRows | ( | ) | const |
Get number of rows.
Definition at line 330 of file WMatrix.h.
References WMatrix< T >::m_nbCols, and WValue< T >::size().
Referenced by WSymmetricSphericalHarmonic::applyFunkRadonTransformation(), WSymmetricSphericalHarmonic::calcGFA(), WMatrix< T >::operator Eigen::MatrixXd(), WMatrix< T >::operator osg::Matrixd(), WMatrix< T >::operator*(), WTensorTypesTest::testCastTensorToMatrix(), WLinearAlgebraFunctionsTest::testComputeSVD(), WMatrixTest::testGetNbRowsAndCols(), WLinearAlgebraFunctionsTest::testPseudoInverse(), WMatrixTest::testTransposed(), WMatrix< T >::transposed(), and WGridTransformOrtho::WGridTransformOrtho().
Makes the matrix contain the identity matrix, i.e.
1 on the diagonal.
1 on the diagonal.
Definition at line 307 of file WMatrix.h.
References WMatrix< T >::m_nbCols, and WValue< T >::size().
Referenced by WThreadedTrackingFunctionTest::buildTestData(), WTrackingUtilityTest::buildTestData(), WDataSetTimeSeriesTest::createData(), WGridTransformOrtho::getTransformationMatrix(), WGridTransformTest::testCompareConstructors(), WDataSetTimeSeriesTest::testConstruction(), WGridRegular3DTest::testEnclosesRotated(), WGridRegular3DTest::testGetPositionScalarOffset(), WGridRegular3DTest::testGetVectorOffset(), WGridRegular3DTest::testGetVoxelNumberOfGeneralPosition(), WGridTransformTest::testInstantiation(), WGridRegular3DTest::testOrientation(), WGridRegular3DTest::testRotatedVoxelNum(), WGridRegular3DTest::testRotatedVoxelOutOfGrid(), WGridTransformTest::testTransformationToGridSpace(), and WGridTransformTest::testTransformationToWorldSpace().
WMatrix< T >::operator Eigen::MatrixXd | ( | ) | const |
Cast this matrix to an Eigen::MatrixXd matrix.
Definition at line 291 of file WMatrix.h.
References WMatrix< T >::getNbCols(), and WMatrix< T >::getNbRows().
WMatrix< T >::operator osg::Matrixd | ( | ) | const |
Cast this matrix to an 4x4 osg matrix if it is a 4x4 matrix.
Definition at line 267 of file WMatrix.h.
References WMatrix< T >::getNbCols(), and WMatrix< T >::getNbRows().
Cast this matrix to an 4x matrix if it is a 4x4 matrix.
Definition at line 252 of file WMatrix.h.
References WMatrix< T >::m_nbCols, and WValue< T >::size().
Compares two matrices and returns true if they are not equal.
rhs | The right hand side of the comparison |
rhs | The right hand side of the comparison |
Definition at line 380 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
T & WMatrix< T >::operator() | ( | size_t | i, | |
size_t | j | |||
) |
Returns a reference to the component an row i, columns j in order to provide access to the component.
i | row | |
j | column |
i | row | |
j | column |
Definition at line 349 of file WMatrix.h.
References WMatrix< T >::m_nbCols, and WValue< T >::size().
const T & WMatrix< T >::operator() | ( | size_t | i, | |
size_t | j | |||
) | const |
Returns a const reference to the component an row i, columns j in order to provide read-only access to the component.
i | row | |
j | column |
i | row | |
j | column |
Definition at line 361 of file WMatrix.h.
References WMatrix< T >::m_nbCols, and WValue< T >::size().
Multiplication of the current matrix with andother matrix.
rhs | The right hand side of the multiplication |
Definition at line 409 of file WMatrix.h.
References WMatrix< T >::getNbCols(), and WMatrix< T >::getNbRows().
Multiplication with a vector.
rhs | The right hand side of the multiplication |
Definition at line 442 of file WMatrix.h.
References WMatrix< T >::getNbCols(), WMatrix< T >::getNbRows(), and WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::getRows().
Multiplication with a vector.
rhs | The right hand side of the multiplication |
Reimplemented from WValue< T >.
Definition at line 427 of file WMatrix.h.
References WMatrix< T >::getNbCols(), WMatrix< T >::getNbRows(), and WValue< T >::size().
Assigns the argument WMatrix to this WMatrix.
rhs | The right hand side of the assignment |
rhs | The right hand side of the assignment |
Definition at line 389 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
Compares two matrices and returns true if they are equal.
rhs | The right hand side of the comparison |
rhs | The right hand side of the comparison |
Definition at line 371 of file WMatrix.h.
References WMatrix< T >::m_nbCols.
void WMatrix< T >::setZero | ( | ) | [inline] |
Resets the matrix components to zero.
Definition at line 190 of file WMatrix.h.
Referenced by WSymmetricSphericalHarmonicTest::testCalcFRTMatrix(), and WSymmetricSphericalHarmonicTest::testCalcSmoothingMatrix().
Returns the transposed matrix.
Definition at line 399 of file WMatrix.h.
References WMatrix< T >::getNbRows(), and WMatrix< T >::m_nbCols.
Referenced by WSymmetricSphericalHarmonic::getSHFittingMatrix(), WOSSIMHelperTest::testComputeSVD(), and WMatrixTest::testTransposed().
Number of columns of the matrix. The number of rows will be computed by (size/m_nbCols).
Definition at line 200 of file WMatrix.h.
Referenced by WMatrix< T >::getNbCols(), WMatrix< T >::getNbRows(), WMatrix< T >::makeIdentity(), WMatrix< T >::operator WMatrix4d(), WMatrix< T >::operator!=(), WMatrix< T >::operator()(), WMatrix< T >::operator=(), WMatrix< T >::operator==(), WMatrix< T >::transposed(), and WMatrix< T >::WMatrix().