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

Function dontalign

test/dontalign.cpp:20–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19template<typename MatrixType>
20void dontalign(const MatrixType& m)
21{
22 typedef typename MatrixType::Index Index;
23 typedef typename MatrixType::Scalar Scalar;
24 typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
25 typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
26
27 Index rows = m.rows();
28 Index cols = m.cols();
29
30 MatrixType a = MatrixType::Random(rows,cols);
31 SquareMatrixType square = SquareMatrixType::Random(rows,rows);
32 VectorType v = VectorType::Random(rows);
33
34 VERIFY_IS_APPROX(v, square * square.colPivHouseholderQr().solve(v));
35 square = square.inverse().eval();
36 a = square * a;
37 square = square*square;
38 v = square * v;
39 v = a.adjoint() * v;
40 VERIFY(square.determinant() != Scalar(0));
41
42 // bug 219: MapAligned() was giving an assert with EIGEN_DONT_ALIGN, because Map Flags were miscomputed
43 Scalar* array = internal::aligned_new<Scalar>(rows);
44 v = VectorType::MapAligned(array, rows);
45 internal::aligned_delete(array, rows);
46}
47
48void test_dontalign()
49{

Callers 1

test_dontalignFunction · 0.85

Calls 8

colPivHouseholderQrMethod · 0.80
rowsMethod · 0.45
colsMethod · 0.45
solveMethod · 0.45
evalMethod · 0.45
inverseMethod · 0.45
adjointMethod · 0.45
determinantMethod · 0.45

Tested by 1

test_dontalignFunction · 0.68