113 ColMatrixType
A = ColMatrixType::Random(
rows,
cols);
114 const ColMatrixType& cA(
A);
115 RowMatrixType
B = RowMatrixType::Random(
rows,
cols);
143 j = internal::random<Index>(0,
A.
cols() - 1);
149 i = internal::random<Index>(0,
A.
rows() - 1);
181 auto b =
v.end() - 1;
192 RowMatrixType B_copy =
B;
193 auto Br =
B.reshaped();
195 auto b = Br.end() - 1;
212 j = internal::random<Index>(0,
A.
cols() - 1);
214 for (
auto x :
A.col(
j)) {
219 for (
auto x : (
v +
A.col(
j))) {
225 i = internal::random<Index>(0,
A.
rows() - 1);
226 for (
auto x :
A.row(
i)) {
231 for (
auto x :
A.reshaped()) {
244 for (
auto x : cA.reshaped()) {
249 i = internal::random<Index>(0,
A.
rows() - 1);
250 for (
auto x : cA.row(
i)) {
259 for (
auto x :
B.reshaped()) {
278 j = internal::random<Index>(0,
A.
cols() - 1);
279 auto it =
A.col(
j).begin();
287 i = internal::random<Index>(0,
A.
rows() - 1);
288 auto it =
A.row(
i).begin();
295 j = internal::random<Index>(0,
A.
cols() - 1);
300 auto it =
tmp.begin();
310 for (
auto it =
A.colwise().cbegin(); it !=
A.colwise().cend(); ++it, ++
j) {
315 for (
auto it =
A.colwise().begin(); it !=
A.colwise().end(); ++it, ++
j) {
316 (*it).coeffRef(0) = (*it).coeff(0);
317 it->coeffRef(0) = it->coeff(0);
324 for (
auto it =
A.colwise().cbegin(); it !=
A.colwise().cend(); ++it, ++
j) {
325 typename decltype(it)::value_type
tmp = *it;
351 std::sort(
v.begin(),
v.end());
358 j = internal::random<Index>(0,
A.
cols() - 1);
360 typename ColMatrixType::ColXpr Acol =
A.col(
j);
361 std::sort(Acol.begin(), Acol.end());
365 std::sort(
A.col(
j).begin(),
A.col(
j).end());
372 i = internal::random<Index>(0,
A.
rows() - 1);
373 typename ColMatrixType::RowXpr Arow =
A.row(
i);
375 std::sort(Arow.begin(), Arow.end());
379 std::sort(
A.row(
i).begin(),
A.row(
i).end());
387 std::sort(B1.begin(), B1.end());
400 j = internal::random<Index>(0,
A.
cols() - 1);
401 typename ColMatrixType::ColXpr Acol =
A.col(
j);
402 std::partial_sum(Acol.begin(), Acol.end(),
v.begin());
406 std::partial_sum(Acol.begin(), Acol.end(), Acol.begin());
414 std::sort(
v1.begin(),
v1.end());
415 std::nth_element(
v.begin(),
v.begin() +
rows / 2,
v.end());
420 std::sort(
v1.begin() +
rows / 2,
v1.end());
421 std::nth_element(
v.begin() +
rows / 2,
v.begin() +
rows / 4,
v.end());
428 for (
auto c :
A.colwise()) {
433 for (
auto c :
B.colwise()) {
439 for (
auto c :
B.colwise()) {
452 for (
auto r :
A.rowwise()) {
457 for (
auto r :
B.rowwise()) {
465 RowVectorType
row = RowVectorType::Random(
cols);
470 row.array() =
row.array() - kMaxVal * (
row.array() / kMaxVal);
471 col.array() =
col.array() - kMaxVal * (
col.array() / kMaxVal);
474 VERIFY(std::all_of(
A.rowwise().begin(),
A.rowwise().end(), [&
row](
typename ColMatrixType::RowXpr
x) {
475 return internal::isApprox(x.squaredNorm(), row.squaredNorm());
477 VERIFY(std::all_of(
A.rowwise().rbegin(),
A.rowwise().rend(), [&
row](
typename ColMatrixType::RowXpr
x) {
478 return internal::isApprox(x.squaredNorm(), row.squaredNorm());
482 VERIFY(std::all_of(
A.colwise().begin(),
A.colwise().end(), [&
col](
typename ColMatrixType::ColXpr
x) {
483 return internal::isApprox(x.squaredNorm(), col.squaredNorm());
485 VERIFY(std::all_of(
A.colwise().rbegin(),
A.colwise().rend(), [&
col](
typename ColMatrixType::ColXpr
x) {
486 return internal::isApprox(x.squaredNorm(), col.squaredNorm());
488 VERIFY(std::all_of(
A.colwise().cbegin(),
A.colwise().cend(), [&
col](
typename ColMatrixType::ConstColXpr
x) {
489 return internal::isApprox(x.squaredNorm(), col.squaredNorm());
491 VERIFY(std::all_of(
A.colwise().crbegin(),
A.colwise().crend(), [&
col](
typename ColMatrixType::ConstColXpr
x) {
492 return internal::isApprox(x.squaredNorm(), col.squaredNorm());
495 i = internal::random<Index>(0,
A.
rows() - 1);
499 std::find_if(
A.rowwise().begin(),
A.rowwise().end(),
500 [](
typename ColMatrixType::RowXpr
x) { return numext::is_exactly_zero(x.squaredNorm()); }) -
504 std::find_if(
A.rowwise().rbegin(),
A.rowwise().rend(),
505 [](
typename ColMatrixType::RowXpr
x) { return numext::is_exactly_zero(x.squaredNorm()); }) -
506 A.rowwise().rbegin(),
509 j = internal::random<Index>(0,
A.
cols() - 1);
513 std::find_if(
A.colwise().begin(),
A.colwise().end(),
514 [](
typename ColMatrixType::ColXpr
x) { return numext::is_exactly_zero(x.squaredNorm()); }) -
518 std::find_if(
A.colwise().rbegin(),
A.colwise().rend(),
519 [](
typename ColMatrixType::ColXpr
x) { return numext::is_exactly_zero(x.squaredNorm()); }) -
520 A.colwise().rbegin(),
526 STATIC_CHECK((internal::is_same<VecOp::const_iterator, decltype(std::declval<const VecOp&>().cbegin())>::
value));
527 STATIC_CHECK((internal::is_same<VecOp::const_iterator, decltype(std::declval<const VecOp&>().cend())>::
value));
529 (internal::is_same<VecOp::const_iterator, decltype(std::cbegin(std::declval<const VecOp&>()))>::
value));
530 STATIC_CHECK((internal::is_same<VecOp::const_iterator, decltype(std::cend(std::declval<const VecOp&>()))>::
value));
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
RowVector3d w
Definition: Matrix_resize_int.cpp:3
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9;Map< RowVectorXf > v1(M1.data(), M1.size())
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:48
constexpr EIGEN_DEVICE_FUNC const Scalar * data() const
Definition: PlainObjectBase.h:273
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: PlainObjectBase.h:192
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
Definition: CwiseNullaryOp.h:569
Derived & setRandom(Index size)
Definition: Random.h:147
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: PlainObjectBase.h:191
Expression of a fixed-size or dynamic-size reshape.
Definition: Reshaped.h:99
Pseudo expression providing broadcasting and partial reduction operations.
Definition: VectorwiseOp.h:192
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
static constexpr const last_t last
Definition: IndexedViewHelper.h:48
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:13
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_IS_NOT_EQUAL(a, b)
Definition: main.h:368
#define STATIC_CHECK(COND)
Definition: main.h:380
auto seq(FirstType f, LastType l) -> decltype(seqN(typename internal::cleanup_index_type< FirstType >::type(f),(typename internal::cleanup_index_type< LastType >::type(l) - typename internal::cleanup_index_type< FirstType >::type(f)+fix< 1 >())))
Definition: ArithmeticSequence.h:152
int c
Definition: calibrate.py:100
list x
Definition: plotDoE.py:28
bool is_sorted(const T &mat)
Definition: sparse_permutations.cpp:35
void check_begin_end_for_loop(Xpr xpr)
Definition: stl_iterators.cpp:41
bool is_generic_randaccess_stl_iterator(const internal::generic_randaccess_stl_iterator< XprType > &)
Definition: stl_iterators.cpp:27
bool is_default_constructible_and_assignable(const Iter &it)
Definition: stl_iterators.cpp:32
std::reverse_iterator< Iterator > make_reverse_iterator(Iterator i)
Definition: stl_iterators.cpp:15
bool is_pointer_based_stl_iterator(const internal::pointer_based_stl_iterator< XprType > &)
Definition: stl_iterators.cpp:22
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2