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 41 of file TestLowerTriangularMatrix.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

Nektar::LowerTriangularMatrixUnitTests::BOOST_AUTO_TEST_CASE ( Test3x3MatrixVectorMultiplyLower  )

Definition at line 61 of file TestLowerTriangularMatrix.cpp.

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

References Nektar::eLOWER_TRIANGULAR.

◆ BOOST_AUTO_TEST_CASE() [2/2]

Nektar::LowerTriangularMatrixUnitTests::BOOST_AUTO_TEST_CASE ( TestMatrixVectorMultiplyLower  )

Definition at line 43 of file TestLowerTriangularMatrix.cpp.

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

References Nektar::eLOWER_TRIANGULAR.