10 #define EIGEN_NO_STATIC_ASSERT 14 template<typename Scalar, bool is_integer = NumTraits<Scalar>::IsInteger>
19 template<
typename Scalar>
53 Vec4
ref = Vec4::Random();
54 Vec4
v{ ref[0], ref[1], ref[2], ref[3] };
59 Vec4
v2 = { ref[0], ref[1], ref[2], ref[3] };
63 Vec5
ref = Vec5::Random();
64 Vec5
v{ ref[0], ref[1], ref[2], ref[3], ref[4] };
69 Vec5
v2 = { ref[0], ref[1], ref[2], ref[3], ref[4] };
74 #define CHECK_MIXSCALAR_V5_APPROX(V, A0, A1, A2, A3, A4) { \ 75 VERIFY_IS_APPROX(V[0], Scalar(A0) ); \ 76 VERIFY_IS_APPROX(V[1], Scalar(A1) ); \ 77 VERIFY_IS_APPROX(V[2], Scalar(A2) ); \ 78 VERIFY_IS_APPROX(V[3], Scalar(A3) ); \ 79 VERIFY_IS_APPROX(V[4], Scalar(A4) ); \ 82 #define CHECK_MIXSCALAR_V5(VEC5, A0, A1, A2, A3, A4) { \ 83 typedef VEC5::Scalar Scalar; \ 84 VEC5 v = { A0 , A1 , A2 , A3 , A4 }; \ 85 CHECK_MIXSCALAR_V5_APPROX(v, A0 , A1 , A2 , A3 , A4); \ 108 for(
int k = 0; k < 4; ++k) {
109 raw[k] = internal::random<Scalar>();
114 for(
int k = 0; k < 4; ++k) {
117 for(
int k = 0; k < 4; ++k) {
126 for(
int k = 0; k < 4; ++k) {
129 for(
int k = 0; k < 4; ++k) {
138 for(
int k=0; k < 4; ++k) {
141 for(
int k=0; k < 4; ++k) {
150 for(
int k=0; k < 4; ++k) {
153 for(
int k=0; k < 4; ++k) {
163 const Index RowsAtCompileTime = 5;
164 const Index ColsAtCompileTime = 4;
165 const Index SizeAtCompileTime = RowsAtCompileTime * ColsAtCompileTime;
167 Scalar raw[SizeAtCompileTime];
168 for (
int i = 0;
i < SizeAtCompileTime; ++
i) {
169 raw[
i] = internal::random<Scalar>();
179 {raw[0], raw[1], raw[2], raw[3]},
180 {raw[4], raw[5], raw[6], raw[7]},
181 {raw[8], raw[9], raw[10], raw[11]},
182 {raw[12], raw[13], raw[14], raw[15]},
183 {raw[16], raw[17], raw[18], raw[19]}
187 m2 << raw[0], raw[1], raw[2], raw[3],
188 raw[4], raw[5], raw[6], raw[7],
189 raw[8], raw[9], raw[10], raw[11],
190 raw[12], raw[13], raw[14], raw[15],
191 raw[16], raw[17], raw[18], raw[19];
194 for(
int i = 0;
i < RowsAtCompileTime; ++
i) {
195 for (
int j = 0;
j < ColsAtCompileTime; ++
j) {
204 {raw[0], raw[1], raw[2], raw[3]},
205 {raw[4], raw[5], raw[6], raw[7]},
206 {raw[8], raw[9], raw[10], raw[11]},
207 {raw[12], raw[13], raw[14], raw[15]},
208 {raw[16], raw[17], raw[18], raw[19]}
214 for(
int i = 0;
i < RowsAtCompileTime; ++
i) {
215 for (
int j = 0;
j < ColsAtCompileTime; ++
j) {
223 for(
int i = 0;
i < RowsAtCompileTime; ++
i) {
224 for (
int j = 0;
j < ColsAtCompileTime; ++
j) {
235 const Index RowsAtCompileTime = 5;
236 const Index ColsAtCompileTime = 4;
237 const Index SizeAtCompileTime = RowsAtCompileTime * ColsAtCompileTime;
239 Scalar raw[SizeAtCompileTime];
240 for (
int i = 0;
i < SizeAtCompileTime; ++
i) {
241 raw[
i] = internal::random<Scalar>();
250 {raw[0], raw[1], raw[2], raw[3]},
251 {raw[4], raw[5], raw[6], raw[7]},
252 {raw[8], raw[9], raw[10], raw[11]},
253 {raw[12], raw[13], raw[14], raw[15]},
254 {raw[16], raw[17], raw[18], raw[19]}
258 m2 << raw[0], raw[1], raw[2], raw[3],
259 raw[4], raw[5], raw[6], raw[7],
260 raw[8], raw[9], raw[10], raw[11],
261 raw[12], raw[13], raw[14], raw[15],
262 raw[16], raw[17], raw[18], raw[19];
265 for(
int i = 0;
i < RowsAtCompileTime; ++
i) {
266 for (
int j = 0;
j < ColsAtCompileTime; ++
j) {
275 {raw[0], raw[1], raw[2], raw[3]},
276 {raw[4], raw[5], raw[6], raw[7]},
277 {raw[8], raw[9], raw[10], raw[11]},
278 {raw[12], raw[13], raw[14], raw[15]},
279 {raw[16], raw[17], raw[18], raw[19]}
285 for(
int i = 0;
i < RowsAtCompileTime; ++
i) {
286 for (
int j = 0;
j < ColsAtCompileTime; ++
j) {
294 for(
int i = 0;
i < RowsAtCompileTime; ++
i) {
295 for (
int j = 0;
j < ColsAtCompileTime; ++
j) {
308 for (
int i = 0;
i <
size; ++
i) {
309 raw[
i] = internal::random<Scalar>();
315 VectorX
v {{raw[0], raw[1], raw[2], raw[3]}};
316 for (
int i = 0;
i <
size; ++
i) {
329 {raw[0], raw[1], raw[2], raw[3]},
330 {raw[0], raw[1], raw[2], raw[3]},
337 CALL_SUBTEST_1(initializerListVectorConstruction<unsigned char>());
342 CALL_SUBTEST_1(initializerListVectorConstruction<std::ptrdiff_t>());
346 CALL_SUBTEST_2(initializerListMatrixConstruction<unsigned char>());
351 CALL_SUBTEST_2(initializerListMatrixConstruction<std::ptrdiff_t>());
355 CALL_SUBTEST_3(initializerListArrayConstruction<unsigned char>());
360 CALL_SUBTEST_3(initializerListArrayConstruction<std::ptrdiff_t>());
364 CALL_SUBTEST_4(fixedsizeVariadicVectorConstruction<unsigned char>());
369 CALL_SUBTEST_4(fixedsizeVariadicVectorConstruction<std::ptrdiff_t>());
#define VERIFY_RAISES_ASSERT(a)
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_4(FUNC)
EIGEN_DECLARE_TEST(initializer_list_construction)
static const Eigen::internal::all_t all
void initializerListVectorConstruction()
void fixedsizeVariadicVectorConstruction2()
#define CALL_SUBTEST_3(FUNC)
Matrix< Scalar, Dynamic, 1 > VectorX
#define CHECK_MIXSCALAR_V5(VEC5, A0, A1, A2, A3, A4)
#define VERIFY_IS_APPROX(a, b)
#define VERIFY_IS_EQUAL(a, b)
#define CALL_SUBTEST_1(FUNC)
void initializerListArrayConstruction()
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Array< int, Dynamic, 1 > v
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Reference counting helper.
void fixedsizeVariadicVectorConstruction3()
#define CALL_SUBTEST_5(FUNC)
void initializerListMatrixConstruction()
#define CALL_SUBTEST(FUNC)
General-purpose arrays with easy API for coefficient-wise operations.
#define CALL_SUBTEST_2(FUNC)
void fixedsizeVariadicVectorConstruction()
void dynamicVectorConstruction()