aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/tutorial.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-10-14 14:45:31 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-10-14 14:45:31 +0000
commita94a8c68e8d66fa2b06e37f3a47f1b7e1ddfa1bc (patch)
tree40edc0947b2dfe87181c4b62c0ba00e925a9f1b4 /doc/tutorial.cpp
parent3f979187600897221c7e807373eb267af4db1ada (diff)
add fromArray() and wrapArray().
For example, the following now works: double a1[3] = {1.0, 3.0, 2.0}, a2[3]; Vector3d::wrapArray(a2) = 2 * Vector3d::fromArray(a1); cout << Vector3d::fromArray(a2) << endl; // output: 2,6,4
Diffstat (limited to 'doc/tutorial.cpp')
-rw-r--r--doc/tutorial.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp
index 4400bd2d1..8a7d499d3 100644
--- a/doc/tutorial.cpp
+++ b/doc/tutorial.cpp
@@ -32,5 +32,10 @@ int main(int, char **)
cout << "Column 1 of m2 is:" << endl << m2.col(1) << endl;
cout << "The transpose of m2 is:" << endl << m2.transpose() << endl;
cout << "The matrix m2 with row 0 and column 1 removed is:" << endl << m2.minor(0,1) << endl;
+
+ double a1[3] = {1.0, 3.0, 2.0};
+ double a2[3];
+ Vector3d::wrapArray(a2) = 2 * Vector3d::fromArray(a1);
+ cout << Vector3d::fromArray(a2) << endl;
return 0;
}