aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/tutorial.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-09-09 08:17:08 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-09-09 08:17:08 +0000
commit1dab53d3004b4b94d079a664ea96cd66bb748d6b (patch)
tree6ad34e335a6e663e512eea5c72a1bcff6c69044c /doc/tutorial.cpp
parentfe9b6b8f17c190a48e8acb2891b6ced9a154ceff (diff)
update tutorial
Diffstat (limited to 'doc/tutorial.cpp')
-rw-r--r--doc/tutorial.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp
index 330fcf326..60d204ce6 100644
--- a/doc/tutorial.cpp
+++ b/doc/tutorial.cpp
@@ -16,14 +16,13 @@ int main(int, char **)
// notice how we are mixing fixed-size and dynamic-size types.
cout << "In the top-left block, we put the matrix m shown above." << endl;
- // here we need to use .xpr() to allow write access to the block.
- m2.xpr().block(0,1,0,1) = m;
+ m2.block(0,1,0,1) = m;
cout << "In the bottom-left block, we put the matrix m*m, which is:" << endl << m*m << endl;
- m2.xpr().block(2,3,0,1) = m * m;
+ m2.block(2,3,0,1) = m * m;
cout << "In the top-right block, we put the matrix m+m, which is:" << endl << m+m << endl;
- m2.xpr().block(0,1,2,3) = m + m;
+ m2.block(0,1,2,3) = m + m;
cout << "In the bottom-right block, we put the matrix m-m, which is:" << endl << m-m << endl;
- m2.xpr().block(2,3,2,3) = m - m;
+ m2.block(2,3,2,3) = m - m;
cout << "Now the 4x4 matrix m2 is:" << endl << m2 << endl;
// here we don't need to use .xpr() because we only need read access.