106 Vector2d
v = Vector2d::Random();
107 const Vector2d v_const(
v);
128 a << 1, 2, 3, 4, 5, 6;
129 const ArrayXXf a_const(
a);
137 VERIFY((
w.array() >= -1).all() && (
w.array() <= 1).all());
149 int s = internal::random<int>(1, 100);
172 d.noalias() +=
a *
b;
177 d.noalias() -=
a *
b;
183 int s = internal::random<int>(1, 100);
235 a << 1, 2, 3, 4, 5, 6;
236 const ArrayXXf a_const(
a);
252 MatrixXd
mat1(6, 6), mat2(6, 6);
258 ArrayXXd arr1(6, 6), arr2(6, 6);
286 Matrix4f m4, m4src = Matrix4f::Random();
287 Array44f a4, a4src = Matrix4f::Random();
296 MatrixXf mX(6, 6), mXsrc = MatrixXf::Random(6, 6);
297 ArrayXXf aX(6, 6), aXsrc = ArrayXXf::Random(6, 6);
311 m4ref.block(1, 1, 2, 3) = m3.bottomRows(2);
314 mX.setIdentity(20, 20);
315 MatrixXf mXref = MatrixXf::Identity(20, 20);
316 mXsrc = MatrixXf::Random(9, 12);
318 mXref.block(4, 4, 9, 12) = mXsrc;
322 const float raw[3] = {1, 2, 3};
323 float buffer[3] = {0, 0, 0};
328 Vector3f::Map(buffer) = 2 * v3;
336 MatrixXcd matXcd(6, 6), matXcd_ref(6, 6);
339 matXcd_ref.real() =
mat1;
340 matXcd_ref.imag() = mat2;
347 mXsrc = MatrixXf::Random(6, 6);
348 VectorXf vX = VectorXf::Random(6);
351 matXcd.resize(12, 12);
361 mat1.setRandom(6, 6);
362 arr1.setRandom(6, 6);
367 mat2.array() = arr1 * arr1;
369 arr2.matrix() = MatrixXd::Identity(6, 6);
376 arr2.reverse() = arr1;
378 mat2.array() =
mat1.array().reverse();
390 mat2.diagonal(1) =
vec1;
394 mat2.diagonal<-1>() = mat2.diagonal(1);
400 MatrixXd
mat1, mat2, mat1ref, mat2ref;
401 mat1ref =
mat1 = MatrixXd::Random(6, 6);
402 mat2ref = mat2 = 2 *
mat1 + MatrixXd::Identity(6, 6);
404 mat1ref.swap(mat2ref);
409 mat1ref.block(0, 0, 3, 3).swap(mat2ref.block(3, 3, 3, 3));
414 mat1.row(2).swap(mat2.col(3).transpose());
421 const Matrix4d mat_const = Matrix4d::Random();
422 Matrix4d
mat, mat_ref;
423 mat = mat_ref = Matrix4d::Identity();
425 mat_ref += mat_const;
429 mat_ref.row(1) -= 2 * mat_ref.row(2);
432 const ArrayXXf arr_const = ArrayXXf::Random(5, 3);
433 ArrayXXf arr, arr_ref;
434 arr = arr_ref = ArrayXXf::Constant(5, 3, 0.5);
436 arr_ref *= arr_const;
440 arr_ref.row(1) /= (arr_ref.row(2) + 1);
446 MatrixXd
A = MatrixXd::Random(6, 6),
B(6, 6),
C(6, 6),
D(6, 6);
464 VERIFY(
B.isApprox(
C) &&
"copy_using_evaluator(B.triangularView<Upper>(), A)");
471 VERIFY(
B.isApprox(
C) &&
"copy_using_evaluator(B.triangularView<Lower>(), A.triangularView<Lower>())");
476 C.triangularView<
Lower>() =
A.triangularView<
Upper>().transpose();
478 VERIFY(
B.isApprox(
C) &&
"copy_using_evaluator(B.triangularView<Lower>(), A.triangularView<Lower>().transpose())");
486 VERIFY(
B.isApprox(
C) &&
"swap_using_evaluator(B.triangularView<Upper>(), A.triangularView<Upper>())");
495 VectorXd d = VectorXd::Random(6);
496 MatrixXd
A = MatrixXd::Random(6, 6),
B(6, 6);
524 float* destMem =
new float[(
M *
N) + 1];
527 float* dest = (std::uintptr_t(destMem) % alignment) == 0 ? destMem + 1 : destMem;
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
dominoes D
Definition: Domino.cpp:55
Eigen::SparseMatrix< double > mat
Definition: EigenUnitTest.cpp:10
RowVector3d w
Definition: Matrix_resize_int.cpp:3
MatrixXd mat1(size, size)
Map< RowVectorXf > v2(M2.data(), M2.size())
m m block(1, 0, 2, 2)<< 4
Scalar * b
Definition: benchVecAdd.cpp:17
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:49
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:48
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Derived & setRandom(Index size)
Definition: Random.h:147
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:202
Definition: matrices.h:74
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85
@ N
Definition: constructor.cpp:22
#define VERIFY_IS_APPROX_EVALUATOR(DEST, EXPR)
Definition: evaluators.cpp:101
#define VERIFY_IS_APPROX_EVALUATOR2(DEST, EXPR, REF)
Definition: evaluators.cpp:102
long get_cost(const XprType &)
Definition: evaluators.cpp:95
@ LazyProduct
Definition: Constants.h:504
@ UnitLower
Definition: Constants.h:219
@ UnitUpper
Definition: Constants.h:221
@ Lower
Definition: Constants.h:211
@ Upper
Definition: Constants.h:213
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:13
RealScalar s
Definition: level1_cplx_impl.h:130
EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Definition: level1_impl.h:117
const Scalar * a
Definition: level2_cplx_impl.h:32
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
#define VERIFY(a)
Definition: main.h:362
#define VERIFY_IS_EQUAL(a, b)
Definition: main.h:367
EIGEN_DEVICE_FUNC void call_restricted_packet_assignment(const NoAlias< Dst, StorageBase > &dst, const Src &src, const Func &func)
Definition: evaluators.cpp:86
EIGEN_STRONG_INLINE DstXprType & copy_using_evaluator(const PlainObjectBase< DstXprType > &dst, const SrcXprType &src)
Definition: evaluators.cpp:31
std::array< T, N > array
Definition: EmulateArray.h:231
void subtract_assign_using_evaluator(const DstXprType &dst, const SrcXprType &src)
Definition: evaluators.cpp:53
void swap_using_evaluator(const DstXprType &dst, const SrcXprType &src)
Definition: evaluators.cpp:74
const Product< Lhs, Rhs, LazyProduct > lazyprod(const Lhs &lhs, const Rhs &rhs)
Definition: evaluators.cpp:12
void multiply_assign_using_evaluator(const DstXprType &dst, const SrcXprType &src)
Definition: evaluators.cpp:60
void divide_assign_using_evaluator(const DstXprType &dst, const SrcXprType &src)
Definition: evaluators.cpp:67
void add_assign_using_evaluator(const DstXprType &dst, const SrcXprType &src)
Definition: evaluators.cpp:46
double K
Wave number.
Definition: sphere_scattering.cc:115
void transpose()
Definition: skew_symmetric_matrix3.cpp:135
int c
Definition: calibrate.py:100
double Zero
Definition: pseudosolid_node_update_elements.cc:35
EIGEN_DONT_INLINE void prod(const Lhs &a, const Rhs &b, Res &c)
Definition: product_threshold.cpp:53