MRPT  2.0.4
Typedefs | Functions
CSparseMatrix_unittest.cpp File Reference
#include <CTraitsTest.h>
#include <gtest/gtest.h>
#include <mrpt/math/CSparseMatrix.h>
#include <mrpt/random.h>
#include <Eigen/Dense>
Include dependency graph for CSparseMatrix_unittest.cpp:

Go to the source code of this file.

Typedefs

using TMatrixSMOperator = void(*)(const CSparseMatrix &M1, const CSparseMatrix &M2, CSparseMatrix &res)
 
using TMatrixDenseOperator = void(*)(const CMatrixDouble &M1, const CMatrixDouble &M2, CMatrixDouble &res)
 

Functions

void generateRandomSparseMatrix (size_t N, size_t M, size_t nEntries, CSparseMatrix &MAT)
 
void do_test_init_to_unit (size_t N)
 
 TEST (SparseMatrix, InitFromDenseUnit)
 
void do_test_init_random (size_t N)
 
 TEST (SparseMatrix, InitFromDenseRandom)
 
 TEST (SparseMatrix, InitFromTriplet)
 
 TEST (SparseMatrix, InitFromSparse)
 
 TEST (SparseMatrix, InitFromRandom)
 
void do_matrix_op_test (size_t nRows1, size_t nCols1, size_t nNonZeros1, size_t nRows2, size_t nCols2, size_t nNonZeros2, TMatrixSMOperator op1, TMatrixDenseOperator op2)
 
void op_sparse_add (const CSparseMatrix &M1, const CSparseMatrix &M2, CSparseMatrix &res)
 
void op_dense_add (const CMatrixDouble &M1, const CMatrixDouble &M2, CMatrixDouble &res)
 
 TEST (SparseMatrix, Op_Add)
 
void op_sparse_multiply_AB (const CSparseMatrix &M1, const CSparseMatrix &M2, CSparseMatrix &res)
 
void op_dense_multiply_AB (const CMatrixDouble &M1, const CMatrixDouble &M2, CMatrixDouble &res)
 
 TEST (SparseMatrix, Op_Multiply_AB)
 
 TEST (SparseMatrix, CholeskyDecomp)
 

Typedef Documentation

◆ TMatrixDenseOperator

using TMatrixDenseOperator = void (*)( const CMatrixDouble& M1, const CMatrixDouble& M2, CMatrixDouble& res)

Definition at line 131 of file CSparseMatrix_unittest.cpp.

◆ TMatrixSMOperator

using TMatrixSMOperator = void (*)( const CSparseMatrix& M1, const CSparseMatrix& M2, CSparseMatrix& res)

Definition at line 129 of file CSparseMatrix_unittest.cpp.

Function Documentation

◆ do_matrix_op_test()

void do_matrix_op_test ( size_t  nRows1,
size_t  nCols1,
size_t  nNonZeros1,
size_t  nRows2,
size_t  nCols2,
size_t  nNonZeros2,
TMatrixSMOperator  op1,
TMatrixDenseOperator  op2 
)

Definition at line 133 of file CSparseMatrix_unittest.cpp.

References EXPECT_TRUE(), generateRandomSparseMatrix(), mrpt::math::CSparseMatrix::get_dense(), and mrpt::math::MatrixVectorBase< Scalar, Derived >::maxCoeff().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_test_init_random()

void do_test_init_random ( size_t  N)

Definition at line 62 of file CSparseMatrix_unittest.cpp.

References mrpt::random::CRandomGenerator::drawGaussian1DMatrix(), EXPECT_TRUE(), mrpt::math::CSparseMatrix::get_dense(), and mrpt::random::getRandomGenerator().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_test_init_to_unit()

void do_test_init_to_unit ( size_t  N)

Definition at line 42 of file CSparseMatrix_unittest.cpp.

References EXPECT_TRUE(), mrpt::math::CSparseMatrix::get_dense(), and mrpt::math::MatrixBase< Scalar, Derived >::setIdentity().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateRandomSparseMatrix()

void generateRandomSparseMatrix ( size_t  N,
size_t  M,
size_t  nEntries,
CSparseMatrix MAT 
)

Definition at line 22 of file CSparseMatrix_unittest.cpp.

References mrpt::math::CSparseMatrix::clear(), mrpt::math::CSparseMatrix::compressFromTriplet(), mrpt::random::getRandomGenerator(), mrpt::math::CSparseMatrix::insert_entry(), mrpt::math::CSparseMatrix::setColCount(), and mrpt::math::CSparseMatrix::setRowCount().

Referenced by do_matrix_op_test(), and TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ op_dense_add()

void op_dense_add ( const CMatrixDouble M1,
const CMatrixDouble M2,
CMatrixDouble res 
)

Definition at line 169 of file CSparseMatrix_unittest.cpp.

Referenced by TEST().

Here is the caller graph for this function:

◆ op_dense_multiply_AB()

void op_dense_multiply_AB ( const CMatrixDouble M1,
const CMatrixDouble M2,
CMatrixDouble res 
)

Definition at line 189 of file CSparseMatrix_unittest.cpp.

References mrpt::math::CMatrixDynamic< T >::asEigen(), and mrpt::math::MatrixVectorBase< Scalar, Derived >::isSquare().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ op_sparse_add()

void op_sparse_add ( const CSparseMatrix M1,
const CSparseMatrix M2,
CSparseMatrix res 
)

Definition at line 164 of file CSparseMatrix_unittest.cpp.

Referenced by TEST().

Here is the caller graph for this function:

◆ op_sparse_multiply_AB()

void op_sparse_multiply_AB ( const CSparseMatrix M1,
const CSparseMatrix M2,
CSparseMatrix res 
)

Definition at line 184 of file CSparseMatrix_unittest.cpp.

Referenced by TEST().

Here is the caller graph for this function:

◆ TEST() [1/8]

TEST ( SparseMatrix  ,
InitFromDenseUnit   
)

Definition at line 55 of file CSparseMatrix_unittest.cpp.

References do_test_init_to_unit().

Here is the call graph for this function:

◆ TEST() [2/8]

TEST ( SparseMatrix  ,
InitFromDenseRandom   
)

Definition at line 72 of file CSparseMatrix_unittest.cpp.

References do_test_init_random().

Here is the call graph for this function:

◆ TEST() [3/8]

TEST ( SparseMatrix  ,
InitFromTriplet   
)

Definition at line 79 of file CSparseMatrix_unittest.cpp.

References mrpt::math::CSparseMatrix::compressFromTriplet(), EXPECT_TRUE(), mrpt::math::CSparseMatrix::get_dense(), mrpt::math::CSparseMatrix::insert_entry(), mrpt::math::CSparseMatrix::setColCount(), and mrpt::math::CSparseMatrix::setRowCount().

Here is the call graph for this function:

◆ TEST() [4/8]

TEST ( SparseMatrix  ,
InitFromSparse   
)

Definition at line 103 of file CSparseMatrix_unittest.cpp.

References EXPECT_TRUE(), and mrpt::math::CSparseMatrix::get_dense().

Here is the call graph for this function:

◆ TEST() [5/8]

TEST ( SparseMatrix  ,
InitFromRandom   
)

Definition at line 121 of file CSparseMatrix_unittest.cpp.

References generateRandomSparseMatrix().

Here is the call graph for this function:

◆ TEST() [6/8]

TEST ( SparseMatrix  ,
Op_Add   
)

Definition at line 175 of file CSparseMatrix_unittest.cpp.

References do_matrix_op_test(), op_dense_add(), and op_sparse_add().

Here is the call graph for this function:

◆ TEST() [7/8]

TEST ( SparseMatrix  ,
Op_Multiply_AB   
)

Definition at line 198 of file CSparseMatrix_unittest.cpp.

References do_matrix_op_test(), op_dense_multiply_AB(), and op_sparse_multiply_AB().

Here is the call graph for this function:

◆ TEST() [8/8]

TEST ( SparseMatrix  ,
CholeskyDecomp   
)



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020