aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-11-09 09:08:03 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-11-09 09:08:03 -0500
commit92749eed11d000300cfa54654f1043cd52399ed8 (patch)
treeba227522582b2f9f4280ed1404e74c654e21ccb3 /doc
parent4b366b07be4e409239c61158a23d93e8ebf3811b (diff)
parent670651e2e0932c5edfe2a2da4b9f3c42af3b7dec (diff)
* merge
* remove a ctor in QuaternionBase as it gives a strange error with GCC 4.4.2.
Diffstat (limited to 'doc')
-rw-r--r--doc/C01_QuickStartGuide.dox24
1 files changed, 15 insertions, 9 deletions
diff --git a/doc/C01_QuickStartGuide.dox b/doc/C01_QuickStartGuide.dox
index 2943aed80..06b2595e7 100644
--- a/doc/C01_QuickStartGuide.dox
+++ b/doc/C01_QuickStartGuide.dox
@@ -278,18 +278,24 @@ Of course, fixed-size matrices can't be resized.
\subsection TutorialMap Map
-Any memory buffer can be mapped as an Eigen expression:
-<table class="tutorial_code"><tr><td>
+Any memory buffer can be mapped as an Eigen expression using the Map() static method:
\code
std::vector<float> stlarray(10);
-Map<VectorXf>(&stlarray[0], stlarray.size()).setOnes();
-int data[4] = 1, 2, 3, 4;
-Matrix2i mat2x2(data);
-MatrixXi mat2x2 = Map<Matrix2i>(data);
-MatrixXi mat2x2 = Map<MatrixXi>(data,2,2);
+VectorXf::Map(&stlarray[0], stlarray.size()).squaredNorm();
+\endcode
+Here VectorXf::Map returns an object of class Map<VectorXf>, which behaves like a VectorXf except that it uses the existing array. You can write to this object, that will write to the existing array. You can also construct a named obtect to reuse it:
+\code
+float array[rows*cols];
+Map<MatrixXf> m(array,rows,cols);
+m = othermatrix1 * othermatrix2;
+m.eigenvalues();
+\endcode
+In the fixed-size case, no need to pass sizes:
+\code
+float array[9];
+Map<Matrix3d> m(array);
+Matrix3d::Map(array).setIdentity();
\endcode
-</td></tr></table>
-
\subsection TutorialCommaInit Comma initializer