OpenWalnut  1.5.0dev
Public Member Functions | Private Member Functions | List of all members
WTensorFunctionsTest Class Reference

Test class for some tensor functions. More...

#include <WTensorFunctions_test.h>

+ Inheritance diagram for WTensorFunctionsTest:
+ Collaboration diagram for WTensorFunctionsTest:

Public Member Functions

void testSpecialSymMatrixEigenvalueTestCaseNumericalStability (void)
 The eigenvalue of the symmetrical matrix: 0.000179516, 2.09569e-05, 2.76557e-06, 0.000170189, -5.52619e-07, 0.00015239 (0.000196397;0.000155074;0.000150625) More...
 
void testJacobiEigenvectors ()
 Test the jacobi eigenvector calculation. More...
 
void testCardanoEigenvalues ()
 Test the cardano eigenvalue calculation. More...
 
void testLogAndExp ()
 Test if tensor log and exp functions behave correctly. More...
 

Private Member Functions

template<std::size_t dim, typename Data_T >
WTensorSym< 2, dim, Data_T > similarity_rotate_givens (WTensorSym< 2, dim, Data_T > const &m, std::size_t i, std::size_t j, double angle)
 A helper function performing a similarity transform using a givens rotation. More...
 
template<std::size_t dim, typename Data_T >
void compare_results (WTensorSym< 2, dim, Data_T > const &m, RealEigenSystem const &sys)
 Test if the given vectors are eigenvectors to the given eigenvalues of a symmetric matrix. More...
 

Detailed Description

Test class for some tensor functions.

Definition at line 42 of file WTensorFunctions_test.h.

Member Function Documentation

◆ compare_results()

template<std::size_t dim, typename Data_T >
void WTensorFunctionsTest::compare_results ( WTensorSym< 2, dim, Data_T > const &  m,
RealEigenSystem const &  sys 
)
inlineprivate

Test if the given vectors are eigenvectors to the given eigenvalues of a symmetric matrix.

Parameters
mA symmetric matrix.
sysThe eigen system ( eigenvalues and eigenvectors )

Definition at line 552 of file WTensorFunctions_test.h.

Referenced by testJacobiEigenvectors().

+ Here is the caller graph for this function:

◆ similarity_rotate_givens()

template<std::size_t dim, typename Data_T >
WTensorSym< 2, dim, Data_T > WTensorFunctionsTest::similarity_rotate_givens ( WTensorSym< 2, dim, Data_T > const &  m,
std::size_t  i,
std::size_t  j,
double  angle 
)
inlineprivate

A helper function performing a similarity transform using a givens rotation.

Parameters
mThe symmetric tensor to transform.
iA row index.
jA column index.
angleThe rotation angle (in radians).
Note
i must not have the same values as j
Returns
The new tensor

Definition at line 506 of file WTensorFunctions_test.h.

Referenced by testCardanoEigenvalues(), and testJacobiEigenvectors().

+ Here is the caller graph for this function:

◆ testCardanoEigenvalues()

void WTensorFunctionsTest::testCardanoEigenvalues ( )
inline

Test the cardano eigenvalue calculation.

Definition at line 307 of file WTensorFunctions_test.h.

References similarity_rotate_givens().

+ Here is the call graph for this function:

◆ testJacobiEigenvectors()

void WTensorFunctionsTest::testJacobiEigenvectors ( )
inline

Test the jacobi eigenvector calculation.

Definition at line 70 of file WTensorFunctions_test.h.

References compare_results(), and similarity_rotate_givens().

+ Here is the call graph for this function:

◆ testLogAndExp()

void WTensorFunctionsTest::testLogAndExp ( )
inline

Test if tensor log and exp functions behave correctly.

Definition at line 471 of file WTensorFunctions_test.h.

◆ testSpecialSymMatrixEigenvalueTestCaseNumericalStability()

void WTensorFunctionsTest::testSpecialSymMatrixEigenvalueTestCaseNumericalStability ( void  )
inline

The eigenvalue of the symmetrical matrix: 0.000179516, 2.09569e-05, 2.76557e-06, 0.000170189, -5.52619e-07, 0.00015239 (0.000196397;0.000155074;0.000150625)

Definition at line 50 of file WTensorFunctions_test.h.


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