diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-02-06 22:49:18 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-02-06 22:49:18 +0100 |
commit | 010afe1619c9200b885f74d3c3937e000ec76b1d (patch) | |
tree | c8e8fbbc9137501aac17bb7b7acf78db8754331b /doc/snippets/Tutorial_SlicingVec.cpp | |
parent | 8e599bc098cef7030004489dca2b9dab920f2cc8 (diff) |
Add exemples for reshaping/slicing with Map.
Diffstat (limited to 'doc/snippets/Tutorial_SlicingVec.cpp')
-rw-r--r-- | doc/snippets/Tutorial_SlicingVec.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/snippets/Tutorial_SlicingVec.cpp b/doc/snippets/Tutorial_SlicingVec.cpp new file mode 100644 index 000000000..07e10bf69 --- /dev/null +++ b/doc/snippets/Tutorial_SlicingVec.cpp @@ -0,0 +1,4 @@ +RowVectorXf v = RowVectorXf::LinSpaced(20,0,19); +cout << "Input:" << endl << v << endl; +Map<RowVectorXf,0,InnerStride<2> > v2(v.data(), v.size()/2); +cout << "Even:" << v2 << endl;
\ No newline at end of file |