aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/tutorial.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-09-26 14:06:32 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-09-26 14:06:32 +0000
commit8a024825d26aee76431e4c7dab98f114bf51dff2 (patch)
tree51e9a02462b558012b5d487e9066c6b7500b8dd7 /doc/tutorial.cpp
parenta2dd9dd6f9a9b6f45e79082e4d8a3577dd4246b6 (diff)
fix bugs caused by default copy constructors being called. valgrind,
you saved my life.
Diffstat (limited to 'doc/tutorial.cpp')
-rw-r--r--doc/tutorial.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp
index 2d881cda2..efadc9bfa 100644
--- a/doc/tutorial.cpp
+++ b/doc/tutorial.cpp
@@ -17,13 +17,11 @@ int main(int, char **)
cout << "Here is a 2x2 matrix m:" << endl << m << endl;
cout << "Let us now build a 4x4 matrix m2 by assembling together four 2x2 blocks." << endl;
- Matrix<double,4,4> m2; // dynamic matrix with initial size 4x4 and uninitialized entries
+ MatrixXd m2(4,4); // dynamic matrix with initial size 4x4 and uninitialized entries
// 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;
m2.block(0,1,0,1) = m;
- cout << "m2 is now " << endl << m2 << endl;
- cout << "m2.block(0,1,0,1) has " << m2.block(0,1,0,1).rows() << " rows" << endl;
cout << "In the bottom-left block, we put the matrix m*m, which is:" << endl << m*m << endl;
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;