aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-01-13 23:17:51 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-01-13 23:17:51 +0000
commit57d7b7d97bc5f57bcf587708a3647da0dce73fea (patch)
tree01e336de7065346e984f812e9f3e33d8ea40bfc9 /doc/snippets
parent6ce996f219170f79f93a21ca86c7f3bd0f425102 (diff)
documentation update for alpha 3
Diffstat (limited to 'doc/snippets')
-rw-r--r--doc/snippets/MatrixBase_block_int_int.cpp5
-rw-r--r--doc/snippets/MatrixBase_block_int_int_int_int.cpp6
-rw-r--r--doc/snippets/MatrixBase_corner_enum_int_int.cpp6
-rw-r--r--doc/snippets/MatrixBase_end_int.cpp5
-rw-r--r--doc/snippets/MatrixBase_start_int.cpp5
5 files changed, 24 insertions, 3 deletions
diff --git a/doc/snippets/MatrixBase_block_int_int.cpp b/doc/snippets/MatrixBase_block_int_int.cpp
new file mode 100644
index 000000000..810ea5eb5
--- /dev/null
+++ b/doc/snippets/MatrixBase_block_int_int.cpp
@@ -0,0 +1,5 @@
+RowVector4i v = RowVector4i::random();
+cout << "Here is the vector v:" << endl << v << endl;
+cout << "Here is v.block(1, 2):" << endl << v.block(1, 2) << endl;
+v.block(1, 2).setZero();
+cout << "Now the vector v is:" << endl << v << endl;
diff --git a/doc/snippets/MatrixBase_block_int_int_int_int.cpp b/doc/snippets/MatrixBase_block_int_int_int_int.cpp
index 12363d028..1aeadfb18 100644
--- a/doc/snippets/MatrixBase_block_int_int_int_int.cpp
+++ b/doc/snippets/MatrixBase_block_int_int_int_int.cpp
@@ -1,5 +1,5 @@
-Matrix3d m = Vector3d(1,2,3).asDiagonal();
+Matrix4i m = Matrix4i::random();
cout << "Here is the matrix m:" << endl << m << endl;
-cout << "Here is m.block(1, 1, 2, 1):" << endl << m.block(1, 1, 2, 1) << endl;
-m.block(1, 0, 2, 1) = m.block(1, 1, 2, 1);
+cout << "Here is m.block(1, 1, 2, 2):" << endl << m.block(1, 1, 2, 2) << endl;
+m.block(1, 1, 2, 2).setZero();
cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_corner_enum_int_int.cpp b/doc/snippets/MatrixBase_corner_enum_int_int.cpp
new file mode 100644
index 000000000..a332bda91
--- /dev/null
+++ b/doc/snippets/MatrixBase_corner_enum_int_int.cpp
@@ -0,0 +1,6 @@
+Matrix4i m = Matrix4i::random();
+cout << "Here is the matrix m:" << endl << m << endl;
+cout << "Here is the bottom-right 2x3 corner in m:" << endl
+ << m.corner(Eigen::BottomRight, 2, 3) << endl;
+m.corner(Eigen::BottomRight, 2, 3).setZero();
+cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_end_int.cpp b/doc/snippets/MatrixBase_end_int.cpp
new file mode 100644
index 000000000..12b5f19f2
--- /dev/null
+++ b/doc/snippets/MatrixBase_end_int.cpp
@@ -0,0 +1,5 @@
+RowVector4i v = RowVector4i::random();
+cout << "Here is the vector v:" << endl << v << endl;
+cout << "Here is v.end(2):" << endl << v.end(2) << endl;
+v.end(2).setZero();
+cout << "Now the vector v is:" << endl << v << endl;
diff --git a/doc/snippets/MatrixBase_start_int.cpp b/doc/snippets/MatrixBase_start_int.cpp
new file mode 100644
index 000000000..cee28f329
--- /dev/null
+++ b/doc/snippets/MatrixBase_start_int.cpp
@@ -0,0 +1,5 @@
+RowVector4i v = RowVector4i::random();
+cout << "Here is the vector v:" << endl << v << endl;
+cout << "Here is v.start(2):" << endl << v.start(2) << endl;
+v.start(2).setZero();
+cout << "Now the vector v is:" << endl << v << endl;