Go to the source code of this file.
|
int | main () |
|
template<class ArgType , class RowIndexType , class ColIndexType > |
Eigen::CwiseNullaryOp< indexing_functor< ArgType, RowIndexType, ColIndexType >, typename indexing_functor< ArgType, RowIndexType, ColIndexType >::MatrixType > | mat_indexing (const Eigen::MatrixBase< ArgType > &arg, const RowIndexType &row_indices, const ColIndexType &col_indices) |
|
◆ main()
Definition at line 40 of file nullary_indexing.cpp.
42 std::cout <<
"[main1]\n";
47 std::cout <<
"A =" << std::endl;
48 std::cout <<
A << std::endl << std::endl;
49 std::cout <<
"A([" << ri.transpose() <<
"], [" << ci.transpose() <<
"]) =" << std::endl;
50 std::cout <<
B << std::endl;
51 std::cout <<
"[main1]\n";
53 std::cout <<
"[main2]\n";
55 std::cout <<
"A(ri+1,ci) =" << std::endl;
56 std::cout <<
B << std::endl << std::endl;
58 std::cout <<
"A(ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)) =" << std::endl;
59 std::cout <<
B << std::endl << std::endl;
60 std::cout <<
"[main2]\n";
const CwiseUnaryOp< CustomUnaryOp, const Derived > unaryExpr(const CustomUnaryOp &func=CustomUnaryOp()) const
Apply a unary operator coefficient-wise.
General-purpose arrays with easy API for coefficient-wise operations.
static EIGEN_DEPRECATED const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar &low, const Scalar &high)
static const RandomReturnType Random()
The matrix class, also used for vectors and row-vectors.
Eigen::CwiseNullaryOp< indexing_functor< ArgType, RowIndexType, ColIndexType >, typename indexing_functor< ArgType, RowIndexType, ColIndexType >::MatrixType > mat_indexing(const Eigen::MatrixBase< ArgType > &arg, const RowIndexType &row_indices, const ColIndexType &col_indices)
◆ mat_indexing()
template<class ArgType , class RowIndexType , class ColIndexType >
Eigen::CwiseNullaryOp<indexing_functor<ArgType,RowIndexType,ColIndexType>, typename indexing_functor<ArgType,RowIndexType,ColIndexType>::MatrixType> mat_indexing |
( |
const Eigen::MatrixBase< ArgType > & |
arg, |
|
|
const RowIndexType & |
row_indices, |
|
|
const ColIndexType & |
col_indices |
|
) |
| |
Definition at line 31 of file nullary_indexing.cpp.
33 typedef indexing_functor<ArgType,RowIndexType,ColIndexType> Func;
35 return MatrixType::NullaryExpr(row_indices.size(), col_indices.size(), Func(
arg.derived(), row_indices, col_indices));
const ArgReturnType arg() const
Matrix< float, 1, Dynamic > MatrixType