52 typedef Matrix<
Scalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime,
67 RowSquareMatrixType identity = RowSquareMatrixType::Identity(
rows,
rows),
69 ColSquareMatrixType square2 = ColSquareMatrixType::Random(
cols,
cols), res2 = ColSquareMatrixType::Random(
cols,
cols);
70 RowVectorType
v1 = RowVectorType::Random(
rows);
71 ColVectorType vc2 = ColVectorType::Random(
cols), vcres(
cols);
76 m1.array() =
m1.array() - kMaxVal * (
m1.array() / kMaxVal);
77 m2.array() =
m2.array() - kMaxVal * (
m2.array() / kMaxVal);
78 v1.array() =
v1.array() - kMaxVal * (
v1.array() / kMaxVal);
81 OtherMajorMatrixType tm1 =
m1;
83 Scalar s1 = internal::random<Scalar>();
85 Index r = internal::random<Index>(0,
rows - 1),
c = internal::random<Index>(0,
cols - 1),
86 c2 = internal::random<Index>(0,
cols - 1);
96 m3 *=
m1.transpose() *
m2;
126 res.noalias() +=
m1 *
m2.transpose();
132 vcres.noalias() +=
m1.transpose() *
v1;
137 res.noalias() -=
m1 *
m2.transpose();
143 vcres.noalias() -=
m1.transpose() *
v1;
148 res.noalias() = s1 *
m1 *
m2.transpose();
151 res.noalias() += s1 *
m1 *
m2.transpose();
154 res.noalias() -= s1 *
m1 *
m2.transpose();
185 res2.noalias() +=
m1.transpose() *
m2;
198 RowSquareMatrixType ref(
square);
199 ColSquareMatrixType ref2(square2);
202 (ref.row(0) =
m1.col(0).transpose() *
square.transpose()));
204 (ref.row(0) =
m1.col(0).transpose() *
square.transpose()));
206 (ref.row(0) =
m1.col(0).transpose() *
square));
208 (ref.row(0) =
m1.col(0).transpose() *
square));
209 ref2 = res2 = square2;
211 (ref2.row(0) =
m1.row(0) * square2.transpose()));
213 (ref2.row(0) =
m1.row(0) * square2.transpose()));
216 (ref2.row(0) =
m1.row(0) * square2));
221 RowVectorType w1(
rows);
228 VERIFY_IS_APPROX(w2.noalias() = vc2.block(0, 0,
cols, 1).transpose() * square2, vc2.transpose() * square2);
230 vc2.transpose() * square2);
232 vc2 = square2.block(0, 0, 1,
cols).transpose();
234 VERIFY_IS_APPROX(w2.noalias() = square2.block(0, 0, 1,
cols) * square2, vc2.transpose() * square2);
236 vc2.transpose() * square2);
238 vc2 = square2.block(0, 0,
cols, 1);
239 VERIFY_IS_APPROX(square2.block(0, 0,
cols, 1).transpose() * square2, vc2.transpose() * square2);
240 VERIFY_IS_APPROX(w2.noalias() = square2.block(0, 0,
cols, 1).transpose() * square2, vc2.transpose() * square2);
242 vc2.transpose() * square2);
247 Scalar x = square2.row(
c) * square2.col(c2);
255 m1.block(
r, 0, 1,
cols).transpose() *
m1.block(0,
c,
rows, 1).transpose());
256 VERIFY_IS_APPROX(
m1.block(0,
c,
rows, 1) *
m1.row(
r),
m1.block(0,
c,
rows, 1) *
m1.block(
r, 0, 1,
cols));
257 VERIFY_IS_APPROX(
m1.col(
c) *
m1.block(
r, 0, 1,
cols),
m1.block(0,
c,
rows, 1) *
m1.block(
r, 0, 1,
cols));
264 ColVectorType
x(
cols);
267 ColVectorType
y(
cols);
294 if (!MatrixType::IsRowMajor) {
AnnoyingScalar get_test_precision(const AnnoyingScalar &)
Definition: AnnoyingScalar.h:190
int i
Definition: BiCGSTAB_step_by_step.cpp:9
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9;Map< RowVectorXf > v1(M1.data(), M1.size())
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
SCALAR Scalar
Definition: bench_gemm.cpp:45
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
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
Holds strides information for Map.
Definition: Stride.h:55
#define min(a, b)
Definition: datatypes.h:22
@ ColMajor
Definition: Constants.h:318
@ RowMajor
Definition: Constants.h:320
const unsigned int RowMajorBit
Definition: Constants.h:70
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:13
Scalar * y
Definition: level1_cplx_impl.h:128
int * m
Definition: level2_cplx_impl.h:294
#define VERIFY(a)
Definition: main.h:362
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
squared absolute sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2 square(power 2)
void transpose()
Definition: skew_symmetric_matrix3.cpp:135
int c
Definition: calibrate.py:100
list x
Definition: plotDoE.py:28
std::enable_if_t< RhsType::SizeAtCompileTime==Dynamic, void > check_mismatched_product(LhsType &lhs, const RhsType &rhs)
Definition: product.h:32
bool areNotApprox(const MatrixBase< Derived1 > &m1, const MatrixBase< Derived2 > &m2, typename Derived1::RealScalar epsilon=NumTraits< typename Derived1::RealScalar >::dummy_precision())
Definition: product.h:14
bool verifyIsApprox(const Type1 &a, const Type2 &b, Tol tol)
Definition: product.h:22
internal::nested_eval< T, 1 >::type eval(const T &xpr)
Definition: sparse_permutations.cpp:47
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217