Nektar++
Typedefs | Functions
Nektar::LowerTriangularMatrixUnitTests Namespace Reference

Typedefs

typedef LowerTriangularMatrixFuncs Policy
 

Functions

 BOOST_AUTO_TEST_CASE (TestMatrixVectorMultiplyLower)
 
 BOOST_AUTO_TEST_CASE (Test3x3MatrixVectorMultiplyLower)
 

Typedef Documentation

◆ Policy

Definition at line 43 of file TestLowerTriangularMatrix.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

Nektar::LowerTriangularMatrixUnitTests::BOOST_AUTO_TEST_CASE ( Test3x3MatrixVectorMultiplyLower  )

Definition at line 63 of file TestLowerTriangularMatrix.cpp.

64{
65 {
66 // double matrix_buf[] = {1,
67 // 2, 3,
68 // 4, 5, 6};
69 double matrix_buf[] = {1, 2, 4, 3, 5, 6};
70 NekMatrix<double> matrix(3, 3, matrix_buf, eLOWER_TRIANGULAR);
71
72 double vector_buf[] = {10, 11, 12};
73 NekVector<double> vector(3, vector_buf);
74
75 NekVector<double> result = matrix * vector;
76
77 double expected_buf[] = {10, 53, 167};
78 NekVector<double> expected_result(3, expected_buf);
79
80 BOOST_CHECK_EQUAL(expected_result, result);
81 }
82}

References Nektar::eLOWER_TRIANGULAR.

◆ BOOST_AUTO_TEST_CASE() [2/2]

Nektar::LowerTriangularMatrixUnitTests::BOOST_AUTO_TEST_CASE ( TestMatrixVectorMultiplyLower  )

Definition at line 45 of file TestLowerTriangularMatrix.cpp.

46{
47 {
48 double matrix_buf[] = {1, 2, 3};
49 NekMatrix<double> matrix(2, 2, matrix_buf, eLOWER_TRIANGULAR);
50
51 double vector_buf[] = {10, 11};
52 NekVector<double> vector(2, vector_buf);
53
54 NekVector<double> result = matrix * vector;
55
56 double expected_buf[] = {10, 53};
57 NekVector<double> expected_result(2, expected_buf);
58
59 BOOST_CHECK_EQUAL(expected_result, result);
60 }
61}

References Nektar::eLOWER_TRIANGULAR.