OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
TestGSLLinalg.cpp File Reference

Unit tests for GSL linear algebra routines. More...

#include <gtest/gtest.h>
#include <cmath>
#include "Utilities/GSLComplex.h"
#include "Utilities/GSLLinalg.h"
#include "Utilities/GSLMatrix.h"
Include dependency graph for TestGSLLinalg.cpp:

Go to the source code of this file.

Classes

class  GSLLinalgTest
 

Functions

 TEST_F (GSLLinalgTest, LUDecomp)
 
 TEST_F (GSLLinalgTest, LUDet)
 
 TEST_F (GSLLinalgTest, LUInvert)
 
 TEST_F (GSLLinalgTest, LUInvertIdentity)
 
 TEST_F (GSLLinalgTest, ComplexLUDecomp)
 
 TEST_F (GSLLinalgTest, ComplexLUDet)
 
 TEST_F (GSLLinalgTest, ComplexLUInvert)
 

Detailed Description

Unit tests for GSL linear algebra routines.

This file contains unit tests for GSL-compatible linear algebra operations including LU decomposition, determinant computation, and matrix inversion for both real and complex matrices.

Test:
GSLLinalgTest::LUDecomp Tests LU decomposition with partial pivoting: \(\mathbf{P} \mathbf{A} = \mathbf{L} \mathbf{U}\), where \(\mathbf{P}\) is a permutation matrix, \(\mathbf{L}\) is lower triangular, and \(\mathbf{U}\) is upper triangular. Verifies that the decomposition completes successfully for a tridiagonal matrix.
Test:
GSLLinalgTest::LUDet Tests determinant computation using LU decomposition: \(\det(\mathbf{A}) = \det(\mathbf{P}) \det(\mathbf{L}) \det(\mathbf{U})\). Verifies correct computation of determinant for a 2×2 matrix with known determinant value.
Test:
GSLLinalgTest::LUInvert Tests matrix inversion using LU decomposition: \(\mathbf{A}^{-1}\). Verifies that the computed inverse satisfies \(\mathbf{A} \mathbf{A}^{-1} = \mathbf{I}\) by checking individual elements of the inverse matrix.
Test:
GSLLinalgTest::LUInvertIdentity Tests inversion of the identity matrix. Verifies that \(\mathbf{I}^{-1} = \mathbf{I}\), confirming that the inversion algorithm handles the special case correctly.
Test:
GSLLinalgTest::ComplexLUDecomp Tests LU decomposition for complex matrices. Verifies that the decomposition algorithm works correctly with complex-valued matrices, including the identity matrix case.
Test:
GSLLinalgTest::ComplexLUDet Tests determinant computation for complex matrices. Verifies that the determinant of the identity matrix is correctly computed as 1 (real part) with zero imaginary part.
Test:
GSLLinalgTest::ComplexLUInvert Tests matrix inversion for complex matrices. Verifies that complex matrix inversion works correctly, including the identity matrix case.

Definition in file TestGSLLinalg.cpp.

Function Documentation

◆ TEST_F() [1/7]

TEST_F ( GSLLinalgTest  ,
ComplexLUDecomp   
)

◆ TEST_F() [2/7]

◆ TEST_F() [3/7]

◆ TEST_F() [4/7]

TEST_F ( GSLLinalgTest  ,
LUDecomp   
)

Definition at line 58 of file TestGSLLinalg.cpp.

References gsl_linalg_LU_decomp(), gsl_matrix_alloc(), gsl_matrix_free(), gsl_matrix_set(), gsl_permutation_alloc(), and gsl_permutation_free().

Here is the call graph for this function:

◆ TEST_F() [5/7]

TEST_F ( GSLLinalgTest  ,
LUDet   
)

◆ TEST_F() [6/7]

TEST_F ( GSLLinalgTest  ,
LUInvert   
)

◆ TEST_F() [7/7]

TEST_F ( GSLLinalgTest  ,
LUInvertIdentity   
)