Lines Matching refs:diagonal
12 template<typename MatrixType> void diagonal(const MatrixType& m) in diagonal() function
26 VERIFY_IS_APPROX(m1.diagonal(), m1.transpose().diagonal()); in diagonal()
27 m2.diagonal() = 2 * m1.diagonal(); in diagonal()
28 m2.diagonal()[0] *= 3; in diagonal()
40 VERIFY(m1.template diagonal<N1>().RowsAtCompileTime == m1.diagonal(N1).size()); in diagonal()
41 VERIFY(m1.template diagonal<N2>().RowsAtCompileTime == m1.diagonal(N2).size()); in diagonal()
44 m2.template diagonal<N1>() = 2 * m1.template diagonal<N1>(); in diagonal()
45 VERIFY_IS_APPROX(m2.template diagonal<N1>(), static_cast<Scalar>(2) * m1.diagonal(N1)); in diagonal()
46 m2.template diagonal<N1>()[0] *= 3; in diagonal()
47 …VERIFY_IS_APPROX(m2.template diagonal<N1>()[0], static_cast<Scalar>(6) * m1.template diagonal<N1>(… in diagonal()
50 m2.template diagonal<N2>() = 2 * m1.template diagonal<N2>(); in diagonal()
51 m2.template diagonal<N2>()[0] *= 3; in diagonal()
52 …VERIFY_IS_APPROX(m2.template diagonal<N2>()[0], static_cast<Scalar>(6) * m1.template diagonal<N2>(… in diagonal()
54 m2.diagonal(N1) = 2 * m1.diagonal(N1); in diagonal()
55 VERIFY_IS_APPROX(m2.template diagonal<N1>(), static_cast<Scalar>(2) * m1.diagonal(N1)); in diagonal()
56 m2.diagonal(N1)[0] *= 3; in diagonal()
57 VERIFY_IS_APPROX(m2.diagonal(N1)[0], static_cast<Scalar>(6) * m1.diagonal(N1)[0]); in diagonal()
59 m2.diagonal(N2) = 2 * m1.diagonal(N2); in diagonal()
60 VERIFY_IS_APPROX(m2.template diagonal<N2>(), static_cast<Scalar>(2) * m1.diagonal(N2)); in diagonal()
61 m2.diagonal(N2)[0] *= 3; in diagonal()
62 VERIFY_IS_APPROX(m2.diagonal(N2)[0], static_cast<Scalar>(6) * m1.diagonal(N2)[0]); in diagonal()
64 m2.diagonal(N2).x() = s1; in diagonal()
65 VERIFY_IS_APPROX(m2.diagonal(N2).x(), s1); in diagonal()
66 m2.diagonal(N2).coeffRef(0) = Scalar(2)*s1; in diagonal()
67 VERIFY_IS_APPROX(m2.diagonal(N2).coeff(0), Scalar(2)*s1); in diagonal()
79 VERIFY_RAISES_ASSERT( m1 += m1.diagonal() ); in diagonal_assert()
80 VERIFY_RAISES_ASSERT( m1 -= m1.diagonal() ); in diagonal_assert()
81 VERIFY_RAISES_ASSERT( m1.array() *= m1.diagonal().array() ); in diagonal_assert()
82 VERIFY_RAISES_ASSERT( m1.array() /= m1.diagonal().array() ); in diagonal_assert()
89 CALL_SUBTEST_1( diagonal(Matrix<float, 1, 1>()) ); in test_diagonal()
90 CALL_SUBTEST_1( diagonal(Matrix<float, 4, 9>()) ); in test_diagonal()
91 CALL_SUBTEST_1( diagonal(Matrix<float, 7, 3>()) ); in test_diagonal()
92 CALL_SUBTEST_2( diagonal(Matrix4d()) ); in test_diagonal()
93 …CALL_SUBTEST_2( diagonal(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<… in test_diagonal()
94 …CALL_SUBTEST_2( diagonal(MatrixXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<i… in test_diagonal()
95 …CALL_SUBTEST_2( diagonal(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<… in test_diagonal()
96 …CALL_SUBTEST_1( diagonal(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<i… in test_diagonal()
97 CALL_SUBTEST_1( diagonal(Matrix<float,Dynamic,4>(3, 4)) ); in test_diagonal()