MyraMath
bounds_DiagonalMatrix


Source: tests/dense/bounds_DiagonalMatrix.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_DiagonalMatrix","[dense]")
20  {
21  // Make random D, access it out of bounds in a variety of ways.
23  // Scalar access using at()
24  REQUIRE_EXCEPTION( auto d = D.at(3); );
25  REQUIRE_EXCEPTION( auto d = D.at(-1); );
26  // Window access.
27  REQUIRE_EXCEPTION( auto d = D.window(-1,0); );
28  REQUIRE_EXCEPTION( auto d = D.window(0,-1); );
29  REQUIRE_EXCEPTION( auto d = D.window(2,4); );
30  REQUIRE_EXCEPTION( auto d = D.window(4,5); );
31  REQUIRE_EXCEPTION( auto d = D.window(2,1); );
32  }
33 
Definition: syntax.dox:1
static DiagonalMatrix< Number > random(int N)
Generates a random DiagonalMatrix of specified size.
Definition: DiagonalMatrix.cpp:217
Container for a diagonal matrix, O(n) storage. Used by SVD, row/column scaling, etc.


Results: [PASS]


Go back to Summary of /test programs.