toon-members
[Top][All Lists]

[Toon-members] TooN/doc documentation.h

 From: Tom Drummond Subject: [Toon-members] TooN/doc documentation.h Date: Fri, 07 Jul 2006 13:53:34 +0000

```CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Tom Drummond <twd20>    06/07/07 13:53:34

Modified files:
doc            : documentation.h

Log message:
bugs in example code fixed

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/doc/documentation.h?cvsroot=toon&r1=1.4&r2=1.5

Patches:
Index: documentation.h
===================================================================
RCS file: /cvsroot/toon/TooN/doc/documentation.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- documentation.h     7 Jul 2006 12:18:17 -0000       1.4
+++ documentation.h     7 Jul 2006 13:53:34 -0000       1.5
@@ -62,18 +62,21 @@
Create two vectors and work out their inner (dot), outer and cross products
@code
// Initialise the vectors
-Vector<3> a = 3,5,0;
-Vector<3> b  = 4,1,3;
+Vector<3> a;
+a = 3,5,0;
+Vector<3> b;
+b = 4,1,3;
// Now work out the products
double dot = a*b;                            // Dot product
-Matrix<3,3> outer = a.as_row() * b.as_col(); // Outer product
+Matrix<3,3> outer = a.as_col() * b.as_row(); // Outer product
Vector<3> cross = a ^ b;                     // Cross product
@endcode

Create a vector and a matrix and multiply the two together
@code
// Initialise a vector
-Vector<3> v = 1,2,3;
+Vector<3> v;
+v = 1,2,3;
// Initialise a matrix
double d[2][3] = {{2,4,5},{6,8,9}};
Matrix<2,3> M(d);

```