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);
157 MatrixXf
a(s,s),
b(s,s),
c(s,s),
d(s,s);
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};
326 Vector3f::Map(buffer) = 2*
v3;
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();
455 C =
B;
C.triangularView<
Upper>() = A;
457 VERIFY(
B.isApprox(
C) &&
"copy_using_evaluator(B.triangularView<Upper>(), A)");
459 A.setRandom();
B.setRandom();
460 C =
B;
C.triangularView<
Lower>() = A.triangularView<
Lower>();
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];
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
#define EIGEN_STRONG_INLINE
Matrix< RealScalar, Dynamic, Dynamic > M
static const Eigen::internal::all_t all
m m block(1, 0, 2, 2)<< 4
EIGEN_DEVICE_FUNC ExpressionType & expression() const
Pseudo expression providing an operator = assuming no aliasing.
A matrix or vector expression mapping an existing array of data.
#define VERIFY_IS_APPROX_EVALUATOR(DEST, EXPR)
EIGEN_DEVICE_FUNC void call_assignment(const NoAlias< Dst, StorageBase > &dst, const Src &src, const Func &func)
EIGEN_DEVICE_FUNC Derived & const_cast_derived() const
Namespace containing all symbols from the Eigen library.
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
MatrixXd mat1(size, size)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
EIGEN_STRONG_INLINE DstXprType & copy_using_evaluator(const EigenBase< DstXprType > &dst, const SrcXprType &src)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resizeLike(const EigenBase< OtherDerived > &_other)
#define VERIFY_IS_APPROX(a, b)
Generic expression where a coefficient-wise binary operator is applied to two expressions.
#define VERIFY_IS_EQUAL(a, b)
#define VERIFY_IS_APPROX_EVALUATOR2(DEST, EXPR, REF)
Array< int, Dynamic, 1 > v
void swap_using_evaluator(const DstXprType &dst, const SrcXprType &src)
void subtract_assign_using_evaluator(const DstXprType &dst, const SrcXprType &src)
EIGEN_DECLARE_TEST(evaluators)
Matrix< Scalar, Dynamic, Dynamic > C
#define EIGEN_DEVICE_FUNC
EIGEN_DEVICE_FUNC void call_restricted_packet_assignment(const NoAlias< Dst, StorageBase > &dst, const Src &src, const Func &func)
void add_assign_using_evaluator(const DstXprType &dst, const SrcXprType &src)
void divide_assign_using_evaluator(const DstXprType &dst, const SrcXprType &src)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_restricted_packet_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
void multiply_assign_using_evaluator(const DstXprType &dst, const SrcXprType &src)
const Product< Lhs, Rhs, LazyProduct > lazyprod(const Lhs &lhs, const Rhs &rhs)
long get_cost(const XprType &)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
The matrix class, also used for vectors and row-vectors.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Derived & setRandom(Index size)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
void swap(scoped_array< T > &a, scoped_array< T > &b)
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)