diff options
author | Gael Guennebaud <g.gael@free.fr> | 2018-09-21 09:36:05 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2018-09-21 09:36:05 +0000 |
commit | 3ec29859146f33e323ebd6d41e46acda63dffcef (patch) | |
tree | 4cbd7d59080ac24c0268aa50a50ded50dbeb5a13 /doc | |
parent | 651e5d4866fb82f30e548029c22834b18897c116 (diff) | |
parent | f0ef3467de0b9a726024e7d5efb3aff007ad6f93 (diff) |
Merged indexing cleanup (pull request PR-506)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/nullary_indexing.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/examples/nullary_indexing.cpp b/doc/examples/nullary_indexing.cpp index e27c3585a..ca1745628 100644 --- a/doc/examples/nullary_indexing.cpp +++ b/doc/examples/nullary_indexing.cpp @@ -30,7 +30,7 @@ public: // [function] template <class ArgType, class RowIndexType, class ColIndexType> CwiseNullaryOp<indexing_functor<ArgType,RowIndexType,ColIndexType>, typename indexing_functor<ArgType,RowIndexType,ColIndexType>::MatrixType> -indexing(const Eigen::MatrixBase<ArgType>& arg, const RowIndexType& row_indices, const ColIndexType& col_indices) +mat_indexing(const Eigen::MatrixBase<ArgType>& arg, const RowIndexType& row_indices, const ColIndexType& col_indices) { typedef indexing_functor<ArgType,RowIndexType,ColIndexType> Func; typedef typename Func::MatrixType MatrixType; @@ -45,7 +45,7 @@ int main() Eigen::MatrixXi A = Eigen::MatrixXi::Random(4,4); Array3i ri(1,2,1); ArrayXi ci(6); ci << 3,2,1,0,0,2; - Eigen::MatrixXi B = indexing(A, ri, ci); + Eigen::MatrixXi B = mat_indexing(A, ri, ci); std::cout << "A =" << std::endl; std::cout << A << std::endl << std::endl; std::cout << "A([" << ri.transpose() << "], [" << ci.transpose() << "]) =" << std::endl; @@ -53,11 +53,11 @@ int main() std::cout << "[main1]\n"; std::cout << "[main2]\n"; - B = indexing(A, ri+1, ci); + B = mat_indexing(A, ri+1, ci); std::cout << "A(ri+1,ci) =" << std::endl; std::cout << B << std::endl << std::endl; #if __cplusplus >= 201103L - B = indexing(A, ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)); + B = mat_indexing(A, ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)); std::cout << "A(ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)) =" << std::endl; std::cout << B << std::endl << std::endl; #endif |