From a2dd9dd6f9a9b6f45e79082e4d8a3577dd4246b6 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 26 Sep 2007 14:06:26 +0000 Subject: Give the axe to the aliasing system. Improve the evaluation system instead. --- doc/tutorial.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'doc/tutorial.cpp') 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 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; } -- cgit v1.2.3