MyraMath
bounds_LowerMatrix


Source: tests/dense/bounds_LowerMatrix.cpp

1 // ========================================================================= //
2 // This file is part of MyraMath, copyright (c) 2014-2019 by Ryan A Chilton //
3 // and distributed by MyraCore, LLC. See LICENSE.txt for license terms. //
4 // ========================================================================= //
5 
11 // Containers.
13 
14 // Reporting.
15 #include <tests/myratest.h>
16 
17 using namespace myra;
18 
19 ADD_TEST("bounds_LowerMatrix","[dense]")
20  {
21  // Make random L, access it out of bounds in a variety of ways.
22  auto L = LowerMatrix<double>::random(5);
23  // Scalar access using at()
24  REQUIRE_EXCEPTION( auto l = L.at(5,0); );
25  REQUIRE_EXCEPTION( auto l = L.at(0,5); );
26  REQUIRE_EXCEPTION( auto l = L.at(-1,0); );
27  REQUIRE_EXCEPTION( auto l = L.at(0,-1); );
28  REQUIRE_EXCEPTION( auto l = L.at(0,1); );
29  }
30 
Definition: syntax.dox:1
Specialized container for a lower triangular matrix, O(N^2/2) storage. Used by symmetry exploiting ma...
static LowerMatrix< Number > random(int N)
Generates a random LowerMatrix of specified size.
Definition: LowerMatrix.cpp:249


Results: [PASS]


Go back to Summary of /test programs.