From a040b7f15daa915b997dd4776ce84809ff38fbe6 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 20 Nov 2008 11:01:17 +0000 Subject: tutorial: extend casting section with set --- doc/QuickStartGuide.dox | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'doc/QuickStartGuide.dox') 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(); \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: -- cgit v1.2.3