6 template<
typename Lhs,
typename Rhs>
13 template<
typename Lhs,
typename Rhs>
20 template<
typename DstXprType,
typename SrcXprType>
28 template<
typename DstXprType,
template <
typename>
class StorageBase,
typename SrcXprType>
36 template<
typename DstXprType,
typename SrcXprType>
40 #ifdef EIGEN_NO_AUTOMATIC_RESIZING
41 eigen_assert((dst.size()==0 || (IsVectorAtCompileTime ? (dst.size() == src.size())
42 : (dst.
rows() == src.rows() && dst.
cols() == src.cols())))
43 &&
"Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
45 dst.const_cast_derived().
resizeLike(src.derived());
49 return dst.const_cast_derived();
52 template<
typename DstXprType,
typename SrcXprType>
59 template<
typename DstXprType,
typename SrcXprType>
66 template<
typename DstXprType,
typename SrcXprType>
73 template<
typename DstXprType,
typename SrcXprType>
80 template<
typename DstXprType,
typename SrcXprType>
88 template<
typename Dst,
template <
typename>
class StorageBase,
typename Src,
typename Func>
94 template<
typename Dst,
template <
typename>
class StorageBase,
typename Src,
typename Func>
107 #define VERIFY_IS_APPROX_EVALUATOR(DEST,EXPR) VERIFY_IS_APPROX(copy_using_evaluator(DEST,(EXPR)), (EXPR).eval());
108 #define VERIFY_IS_APPROX_EVALUATOR2(DEST,EXPR,REF) VERIFY_IS_APPROX(copy_using_evaluator(DEST,(EXPR)), (REF).eval());
113 Vector2d
v = Vector2d::Random();
114 const Vector2d v_const(
v);
136 const ArrayXXf a_const(
a);
144 VERIFY((
w.array() >= -1).all() && (
w.array() <= 1).all());
156 int s = internal::random<int>(1,100);
190 int s = internal::random<int>(1,100);
234 const ArrayXXf a_const(
a);
250 MatrixXd
mat1(6,6), mat2(6,6);
256 ArrayXXd arr1(6,6), arr2(6,6);
284 Matrix4f m4, m4src = Matrix4f::Random();
285 Array44f a4, a4src = Matrix4f::Random();
294 MatrixXf mX(6,6), mXsrc = MatrixXf::Random(6,6);
295 ArrayXXf aX(6,6), aXsrc = ArrayXXf::Random(6,6);
309 m4ref.block(1, 1, 2, 3) =
m3.bottomRows(2);
312 mX.setIdentity(20,20);
313 MatrixXf mXref = MatrixXf::Identity(20,20);
314 mXsrc = MatrixXf::Random(9,12);
316 mXref.block(4, 4, 9, 12) = mXsrc;
320 const float raw[3] = {1,2,3};
321 float buffer[3] = {0,0,0};
334 MatrixXcd matXcd(6,6), matXcd_ref(6,6);
337 matXcd_ref.real() =
mat1;
338 matXcd_ref.imag() = mat2;
345 mXsrc = MatrixXf::Random(6, 6);
346 VectorXf vX = VectorXf::Random(6);
349 matXcd.resize(12, 12);
365 mat2.array() = arr1 * arr1;
367 arr2.matrix() = MatrixXd::Identity(6,6);
374 arr2.reverse() = arr1;
376 mat2.array() =
mat1.array().reverse();
388 mat2.diagonal(1) =
vec1;
392 mat2.diagonal<-1>() = mat2.diagonal(1);
398 MatrixXd
mat1, mat2, mat1ref, mat2ref;
399 mat1ref =
mat1 = MatrixXd::Random(6, 6);
400 mat2ref = mat2 = 2 *
mat1 + MatrixXd::Identity(6, 6);
402 mat1ref.swap(mat2ref);
407 mat1ref.block(0, 0, 3, 3).swap(mat2ref.block(3, 3, 3, 3));
412 mat1.row(2).swap(mat2.col(3).transpose());
419 const Matrix4d mat_const = Matrix4d::Random();
420 Matrix4d
mat, mat_ref;
421 mat = mat_ref = Matrix4d::Identity();
423 mat_ref += mat_const;
427 mat_ref.row(1) -= 2*mat_ref.row(2);
430 const ArrayXXf arr_const = ArrayXXf::Random(5,3);
431 ArrayXXf
arr, arr_ref;
432 arr = arr_ref = ArrayXXf::Constant(5, 3, 0.5);
434 arr_ref *= arr_const;
438 arr_ref.row(1) /= (arr_ref.row(2) + 1);
444 MatrixXd
A = MatrixXd::Random(6,6),
B(6,6),
C(6,6),
D(6,6);
445 A.setRandom();
B.setRandom();
448 A.setRandom();
B.setRandom();
451 A.setRandom();
B.setRandom();
454 A.setRandom();
B.setRandom();
457 VERIFY(
B.isApprox(
C) &&
"copy_using_evaluator(B.triangularView<Upper>(), A)");
459 A.setRandom();
B.setRandom();
462 VERIFY(
B.isApprox(
C) &&
"copy_using_evaluator(B.triangularView<Lower>(), A.triangularView<Lower>())");
465 A.setRandom();
B.setRandom();
466 C =
B;
C.triangularView<
Lower>() =
A.triangularView<
Upper>().transpose();
468 VERIFY(
B.isApprox(
C) &&
"copy_using_evaluator(B.triangularView<Lower>(), A.triangularView<Lower>().transpose())");
471 A.setRandom();
B.setRandom();
C =
B;
D =
A;
474 VERIFY(
B.isApprox(
C) &&
"swap_using_evaluator(B.triangularView<Upper>(), A.triangularView<Upper>())");
484 VectorXd
d = VectorXd::Random(6);
485 MatrixXd
A = MatrixXd::Random(6,6),
B(6,6);
486 A.setRandom();
B.setRandom();
512 float *destMem =
new float[(
M*
N) + 1];