10 #define EIGEN_NO_STATIC_ASSERT 14 template <
typename Scalar>
22 for (
int i = 0;
i < 6; ++
i) {
23 raw[
i] = internal::random<Scalar>();
31 {raw[0], raw[1], raw[2]},
32 {raw[3], raw[4], raw[5]}
36 #define VERIFY_IMPLICIT_CONVERSION_3(DIAGTYPE, V0, V1, V2) \ 37 DIAGTYPE d(V0, V1, V2); \ 38 DIAGTYPE::DenseMatrixType Dense = d.toDenseMatrix(); \ 39 VERIFY_IS_APPROX(Dense(0, 0), (Scalar)V0); \ 40 VERIFY_IS_APPROX(Dense(1, 1), (Scalar)V1); \ 41 VERIFY_IS_APPROX(Dense(2, 2), (Scalar)V2); 43 #define VERIFY_IMPLICIT_CONVERSION_4(DIAGTYPE, V0, V1, V2, V3) \ 44 DIAGTYPE d(V0, V1, V2, V3); \ 45 DIAGTYPE::DenseMatrixType Dense = d.toDenseMatrix(); \ 46 VERIFY_IS_APPROX(Dense(0, 0), (Scalar)V0); \ 47 VERIFY_IS_APPROX(Dense(1, 1), (Scalar)V1); \ 48 VERIFY_IS_APPROX(Dense(2, 2), (Scalar)V2); \ 49 VERIFY_IS_APPROX(Dense(3, 3), (Scalar)V3); 51 #define VERIFY_IMPLICIT_CONVERSION_5(DIAGTYPE, V0, V1, V2, V3, V4) \ 52 DIAGTYPE d(V0, V1, V2, V3, V4); \ 53 DIAGTYPE::DenseMatrixType Dense = d.toDenseMatrix(); \ 54 VERIFY_IS_APPROX(Dense(0, 0), (Scalar)V0); \ 55 VERIFY_IS_APPROX(Dense(1, 1), (Scalar)V1); \ 56 VERIFY_IS_APPROX(Dense(2, 2), (Scalar)V2); \ 57 VERIFY_IS_APPROX(Dense(3, 3), (Scalar)V3); \ 58 VERIFY_IS_APPROX(Dense(4, 4), (Scalar)V4); 60 template<
typename Scalar>
69 for (
int k = 0; k < 7; ++k) raw[k] = internal::random<Scalar>();
73 DiagonalMatrix0
a {{}};
76 typename DiagonalMatrix0::DenseMatrixType
m =
a.toDenseMatrix();
77 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
80 DiagonalMatrix3
a {{raw[0], raw[1], raw[2]}};
83 typename DiagonalMatrix3::DenseMatrixType
m =
a.toDenseMatrix();
84 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
87 DiagonalMatrix4
a {{raw[0], raw[1], raw[2], raw[3]}};
90 typename DiagonalMatrix4::DenseMatrixType
m =
a.toDenseMatrix();
91 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
96 DiagonalMatrixX
a{{}};
99 typename DiagonalMatrixX::DenseMatrixType
m =
a.toDenseMatrix();
100 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
103 DiagonalMatrixX
a{{raw[0], raw[1], raw[2], raw[3], raw[4], raw[5], raw[6]}};
106 typename DiagonalMatrixX::DenseMatrixType
m =
a.toDenseMatrix();
107 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
123 for (
int k = 0; k < 7; ++k) raw[k] = internal::random<Scalar>();
127 DiagonalMatrix0
a {{}};
130 typename DiagonalMatrix0::DenseMatrixType
m =
a.toDenseMatrix();
131 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
134 DiagonalMatrix3
a {{raw[0], raw[1], raw[2]}};
137 typename DiagonalMatrix3::DenseMatrixType
m =
a.toDenseMatrix();
138 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
141 DiagonalMatrix4
a {{raw[0], raw[1], raw[2], raw[3]}};
144 typename DiagonalMatrix4::DenseMatrixType
m =
a.toDenseMatrix();
145 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
150 DiagonalMatrixX
a{{}};
153 typename DiagonalMatrixX::DenseMatrixType
m =
a.toDenseMatrix();
154 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
157 DiagonalMatrixX
a{{raw[0], raw[1], raw[2], raw[3], raw[4], raw[5], raw[6]}};
160 typename DiagonalMatrixX::DenseMatrixType
m =
a.toDenseMatrix();
161 for (
Index k = 0; k <
a.rows(); ++k)
VERIFY(
m(k, k) == raw[k]);
#define VERIFY_RAISES_ASSERT(a)
Represents a diagonal matrix with its storage.
void constructorTest< float >()
#define CALL_SUBTEST_1(FUNC)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
#define VERIFY_IMPLICIT_CONVERSION_3(DIAGTYPE, V0, V1, V2)
#define VERIFY_IMPLICIT_CONVERSION_5(DIAGTYPE, V0, V1, V2, V3, V4)
EIGEN_DECLARE_TEST(diagonal_matrix_variadic_ctor)
#define CALL_SUBTEST_2(FUNC)
#define VERIFY_IMPLICIT_CONVERSION_4(DIAGTYPE, V0, V1, V2, V3)