MCPcopy Create free account
hub / github.com/PX4/eigen / diagonal_assert

Function diagonal_assert

test/diagonal.cpp:71–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71template<typename MatrixType> void diagonal_assert(const MatrixType& m) {
72 Index rows = m.rows();
73 Index cols = m.cols();
74
75 MatrixType m1 = MatrixType::Random(rows, cols);
76
77 if (rows>=2 && cols>=2)
78 {
79 VERIFY_RAISES_ASSERT( m1 += m1.diagonal() );
80 VERIFY_RAISES_ASSERT( m1 -= m1.diagonal() );
81 VERIFY_RAISES_ASSERT( m1.array() *= m1.diagonal().array() );
82 VERIFY_RAISES_ASSERT( m1.array() /= m1.diagonal().array() );
83 }
84}
85
86void test_diagonal()
87{

Callers 1

test_diagonalFunction · 0.85

Calls 4

rowsMethod · 0.45
colsMethod · 0.45
diagonalMethod · 0.45
arrayMethod · 0.45

Tested by 1

test_diagonalFunction · 0.68