diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-09-26 14:06:26 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-09-26 14:06:26 +0000 |
commit | a2dd9dd6f9a9b6f45e79082e4d8a3577dd4246b6 (patch) | |
tree | c6c8459d72aea374b2e469b94d762e9e34537615 /doc/tutorial.cpp | |
parent | 55227b1f636b03c321940035061360484ea05e66 (diff) |
Give the axe to the aliasing system.
Improve the evaluation system instead.
Diffstat (limited to 'doc/tutorial.cpp')
-rw-r--r-- | doc/tutorial.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp index e37c245cc..2d881cda2 100644 --- a/doc/tutorial.cpp +++ b/doc/tutorial.cpp @@ -12,9 +12,9 @@ int main(int, char **) m(1,1) = 4; n = m; - n = eval(n*n); + n = eval(n*n+n); cout << n << endl; -#if 0 + 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 @@ -50,10 +50,9 @@ int main(int, char **) << "overwritten _while_ the matrix product m * m is being computed." << endl << "This is the counterpart of eliminating temporary objects!" << endl << "Anyway, if you want to store m * m into m, you can do this:" << endl - << " m.alias() = m * m;" << endl; + << " m = eval(m * m);" << endl; m = m_save; - m.alias() = m * m; + m = eval(m * m); cout << "And m is now:" << endl << m << endl << "as was expected." << endl; -#endif return 0; } |