aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/CustomizingEigen_NullaryExpr.dox
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-08-31 15:46:04 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-08-31 15:46:04 +0200
commit7ae819123c38b2397bbb0922f5d16e53e4fac42c (patch)
treeef8c2f0c9ec3f9e0286fa8735e2e8596bb7d5cc4 /doc/CustomizingEigen_NullaryExpr.dox
parent218c37beb4dbc701938da71acf0bd3914f34f89e (diff)
Simplify CwiseNullaryOp example.
Diffstat (limited to 'doc/CustomizingEigen_NullaryExpr.dox')
-rw-r--r--doc/CustomizingEigen_NullaryExpr.dox6
1 files changed, 1 insertions, 5 deletions
diff --git a/doc/CustomizingEigen_NullaryExpr.dox b/doc/CustomizingEigen_NullaryExpr.dox
index cefa5317c..d70f81065 100644
--- a/doc/CustomizingEigen_NullaryExpr.dox
+++ b/doc/CustomizingEigen_NullaryExpr.dox
@@ -41,11 +41,6 @@ Then, we need to implement our \c circulant_functor, which is a straightforward
\snippet make_circulant2.cpp circulant_func
-The only subtlety here is that, by default, CwiseNullaryOp assumes that the given nullary functor can be evaluated linearly even for 2D matrices. That is, by default, CwiseNullaryOp will call \c operator(Index index) with \c index=i+j*rows. This is more efficient for non-structured matrices, but not usable for any more sophisticated nullary functor as ours. We need to tell this to %Eigen by specializing the internal::functor_has_linear_access structure for our functor as follows:
-
-\snippet make_circulant2.cpp linear_access
-
-
We are now all set to try our new feature:
\snippet make_circulant2.cpp main
@@ -59,5 +54,6 @@ showing that the program works as expected:
This implementation of \c makeCirculant is much simpler than \ref TopicNewExpressionType "defining a new expression" from scratch.
*/
+
}