diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-01-03 19:36:32 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-01-03 19:36:32 +0000 |
commit | 23ffede3d0d280962bad418a41957cf82e3fadc9 (patch) | |
tree | a6dacc6b06f39b19d342664d2b73a6de3b0d424b /doc | |
parent | 42f6590bb26d77bfa67f57c64ff9cc6d38e23f58 (diff) |
more documentation, 12 more code snippets
Diffstat (limited to 'doc')
-rw-r--r-- | doc/snippets/MatrixBase_map.cpp | 5 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_map_int.cpp | 5 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_map_int_int.cpp | 5 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_ones.cpp | 2 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_ones_int.cpp | 2 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_ones_int_int.cpp | 1 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_random.cpp | 1 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_random_int.cpp | 1 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_random_int_int.cpp | 1 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_transpose.cpp | 2 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_zero.cpp | 2 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_zero_int.cpp | 2 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_zero_int_int.cpp | 1 |
13 files changed, 29 insertions, 1 deletions
diff --git a/doc/snippets/MatrixBase_map.cpp b/doc/snippets/MatrixBase_map.cpp new file mode 100644 index 000000000..1655c542e --- /dev/null +++ b/doc/snippets/MatrixBase_map.cpp @@ -0,0 +1,5 @@ +int data[4] = {1,3,0,2}; +cout << Matrix2i::map(data) << endl; +Matrix2i::map(data) *= 2; +cout << "The data is now:" << endl; +for(int i = 0; i < 4; i++) cout << data[i] << endl;
\ No newline at end of file diff --git a/doc/snippets/MatrixBase_map_int.cpp b/doc/snippets/MatrixBase_map_int.cpp new file mode 100644 index 000000000..066e54773 --- /dev/null +++ b/doc/snippets/MatrixBase_map_int.cpp @@ -0,0 +1,5 @@ +int data[4] = {1,3,0,2}; +cout << VectorXi::map(data, 4) << endl; +VectorXi::map(data, 4) *= 2; +cout << "The data is now:" << endl; +for(int i = 0; i < 4; i++) cout << data[i] << endl; diff --git a/doc/snippets/MatrixBase_map_int_int.cpp b/doc/snippets/MatrixBase_map_int_int.cpp new file mode 100644 index 000000000..516b9e7f9 --- /dev/null +++ b/doc/snippets/MatrixBase_map_int_int.cpp @@ -0,0 +1,5 @@ +int data[4] = {1,3,0,2}; +cout << MatrixXi::map(data, 2, 2) << endl; +MatrixXi::map(data, 2, 2) *= 2; +cout << "The data is now:" << endl; +for(int i = 0; i < 4; i++) cout << data[i] << endl; diff --git a/doc/snippets/MatrixBase_ones.cpp b/doc/snippets/MatrixBase_ones.cpp new file mode 100644 index 000000000..2434f518a --- /dev/null +++ b/doc/snippets/MatrixBase_ones.cpp @@ -0,0 +1,2 @@ +cout << Matrix2d::ones() << endl; +cout << 6 * RowVector4i::ones() << endl; diff --git a/doc/snippets/MatrixBase_ones_int.cpp b/doc/snippets/MatrixBase_ones_int.cpp new file mode 100644 index 000000000..0610bc2f2 --- /dev/null +++ b/doc/snippets/MatrixBase_ones_int.cpp @@ -0,0 +1,2 @@ +cout << 6 * RowVectorXi::ones(4) << endl; +cout << VectorXf::ones(2) << endl; diff --git a/doc/snippets/MatrixBase_ones_int_int.cpp b/doc/snippets/MatrixBase_ones_int_int.cpp new file mode 100644 index 000000000..faecee1af --- /dev/null +++ b/doc/snippets/MatrixBase_ones_int_int.cpp @@ -0,0 +1 @@ +cout << MatrixXi::ones(2,3) << endl; diff --git a/doc/snippets/MatrixBase_random.cpp b/doc/snippets/MatrixBase_random.cpp new file mode 100644 index 000000000..09b5fb2db --- /dev/null +++ b/doc/snippets/MatrixBase_random.cpp @@ -0,0 +1 @@ +cout << 100 * Matrix2i::random() << endl; diff --git a/doc/snippets/MatrixBase_random_int.cpp b/doc/snippets/MatrixBase_random_int.cpp new file mode 100644 index 000000000..a1f609ce0 --- /dev/null +++ b/doc/snippets/MatrixBase_random_int.cpp @@ -0,0 +1 @@ +cout << VectorXi::random(2) << endl; diff --git a/doc/snippets/MatrixBase_random_int_int.cpp b/doc/snippets/MatrixBase_random_int_int.cpp new file mode 100644 index 000000000..235dd4721 --- /dev/null +++ b/doc/snippets/MatrixBase_random_int_int.cpp @@ -0,0 +1 @@ +cout << MatrixXi::random(2,3) << endl; diff --git a/doc/snippets/MatrixBase_transpose.cpp b/doc/snippets/MatrixBase_transpose.cpp index 0a0586d53..342d14a81 100644 --- a/doc/snippets/MatrixBase_transpose.cpp +++ b/doc/snippets/MatrixBase_transpose.cpp @@ -1,4 +1,4 @@ -Matrix2f m = Matrix2f::random(); +Matrix2i m = Matrix2i::random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the transpose of m:" << endl << m.transpose() << endl; cout << "Here is the coefficient (1,0) in the transpose of m:" << endl diff --git a/doc/snippets/MatrixBase_zero.cpp b/doc/snippets/MatrixBase_zero.cpp new file mode 100644 index 000000000..8b4af04a9 --- /dev/null +++ b/doc/snippets/MatrixBase_zero.cpp @@ -0,0 +1,2 @@ +cout << Matrix2d::zero() << endl; +cout << RowVector4i::zero() << endl; diff --git a/doc/snippets/MatrixBase_zero_int.cpp b/doc/snippets/MatrixBase_zero_int.cpp new file mode 100644 index 000000000..4ef99edeb --- /dev/null +++ b/doc/snippets/MatrixBase_zero_int.cpp @@ -0,0 +1,2 @@ +cout << RowVectorXi::zero(4) << endl; +cout << VectorXf::zero(2) << endl; diff --git a/doc/snippets/MatrixBase_zero_int_int.cpp b/doc/snippets/MatrixBase_zero_int_int.cpp new file mode 100644 index 000000000..b108c763b --- /dev/null +++ b/doc/snippets/MatrixBase_zero_int_int.cpp @@ -0,0 +1 @@ +cout << MatrixXi::zero(2,3) << endl; |