diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-10-01 07:45:30 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-10-01 07:45:30 +0000 |
commit | 96524fc5730b2e791d2406ced7e78f3bd9fb79ab (patch) | |
tree | fba89e2c86cda294c846d570a69c36498d9045f9 /doc/tutorial.cpp | |
parent | 3cf6caba1a144db2c5a4f37c5a8405cdc50ffade (diff) |
Split Row and Column into separate files.
Introduce a notion of RowVector (typedef for Matriw with 1 row)
Make row() return a row vector instead of a "column vector"
Introduce operator[] to access elements of row/column vectors uniformly
Remove default arguments in operator(), these were for vectors, now use operator[] instead
Diffstat (limited to 'doc/tutorial.cpp')
-rw-r--r-- | doc/tutorial.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp index 03495dbcb..a5b019531 100644 --- a/doc/tutorial.cpp +++ b/doc/tutorial.cpp @@ -26,8 +26,10 @@ int main(int, char **) cout << "Now the 4x4 matrix m2 is:" << endl << m2 << endl; cout << "The central 2x2 block of m2 is:" << endl << m2.block(1,2,1,2) << endl; - cout << "Row 0 of m2, written as a column vector, is:" << endl << m2.row(0) << endl; + cout << "Row 0 of m2 is:" << endl << m2.row(0) << endl; + cout << "The third element in that row is " << m2.row(0)[2] << endl; cout << "Column 1 of m2 is:" << endl << m2.col(1) << endl; cout << "The matrix m2 with row 0 and column 1 removed is:" << endl << m2.minor(0,1) << endl; + return 0; } |