Nektar++
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Typedefs | Functions
Nektar::UpperTriangularMatrixUnitTests Namespace Reference

Typedefs

typedef UpperTriangularMatrixFuncs Policy
 

Functions

 BOOST_AUTO_TEST_CASE (TestMatrixVectorMultiplyUpper)
 
 BOOST_AUTO_TEST_CASE (Test3x3MatrixVectorMultiplyUpper)
 

Typedef Documentation

◆ Policy

Definition at line 44 of file TestUpperTriangularMatrix.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

Nektar::UpperTriangularMatrixUnitTests::BOOST_AUTO_TEST_CASE ( Test3x3MatrixVectorMultiplyUpper  )

Definition at line 64 of file TestUpperTriangularMatrix.cpp.

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

References Nektar::eUPPER_TRIANGULAR.

◆ BOOST_AUTO_TEST_CASE() [2/2]

Nektar::UpperTriangularMatrixUnitTests::BOOST_AUTO_TEST_CASE ( TestMatrixVectorMultiplyUpper  )

Definition at line 46 of file TestUpperTriangularMatrix.cpp.

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

References Nektar::eUPPER_TRIANGULAR.