aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/QuickStartGuide.dox
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-11-20 11:01:17 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-11-20 11:01:17 +0000
commita040b7f15daa915b997dd4776ce84809ff38fbe6 (patch)
treed73321b820a72f8989991ab5392b20b948cc445f /doc/QuickStartGuide.dox
parentcc6121b98d16d567580743ac54d4809124b2b29c (diff)
tutorial: extend casting section with set
Diffstat (limited to 'doc/QuickStartGuide.dox')
-rw-r--r--doc/QuickStartGuide.dox10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/QuickStartGuide.dox b/doc/QuickStartGuide.dox
index 25bbf4632..5e5959e18 100644
--- a/doc/QuickStartGuide.dox
+++ b/doc/QuickStartGuide.dox
@@ -190,13 +190,21 @@ v = 6 6 6
\subsection TutorialCasting Casting
-In Eigen, any matrices of same size and same scalar type are all naturally compatible. The scalar type can be explicitely casted to another one using the template cast() function:
+In Eigen, any matrices of same size and same scalar type are all naturally compatible. The scalar type can be explicitely casted to another one using the template MatrixBase::cast() function:
\code
Matrix3d md(1,2,3);
Matrix3f mf = md.cast<float>();
\endcode
Note that casting to the same scalar type in an expression is free.
+The sizes of a resizable destination matrix can be changed automatically using the Matrix::set() function:
+\code
+MatrixXf res(10,10);
+Matrix3f a, b;
+res = a + b; // does not work (no automatic resizing)
+res.set(a+b); // OK
+\endcode
+
\subsection TutorialMap Map
Any memory buffer can be mapped as an Eigen expression: