aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-09-15 15:45:41 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-09-15 15:45:41 +0000
commit247f2b0ffa734d2133db9bb81a48cb4b5620d145 (patch)
tree44610107cad4e0508177cad78d490c5dd6f427d2 /doc/snippets
parent0940ad7127474dc0b6e5e271502988cb7141843a (diff)
* block() for vectors ---> segment()
* documentation improvements, especially in quickstart guide
Diffstat (limited to 'doc/snippets')
-rw-r--r--doc/snippets/MatrixBase_block_int_int.cpp10
-rw-r--r--doc/snippets/MatrixBase_segment_int_int.cpp (renamed from doc/snippets/MatrixBase_template_int.cpp)4
-rw-r--r--doc/snippets/MatrixBase_template_int_segment.cpp5
3 files changed, 12 insertions, 7 deletions
diff --git a/doc/snippets/MatrixBase_block_int_int.cpp b/doc/snippets/MatrixBase_block_int_int.cpp
index 974f86b54..f99b6d4ca 100644
--- a/doc/snippets/MatrixBase_block_int_int.cpp
+++ b/doc/snippets/MatrixBase_block_int_int.cpp
@@ -1,5 +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;
+Matrix4i m = Matrix4i::Random();
+cout << "Here is the matrix m:" << endl << m << endl;
+cout << "Here is m.block<2,2>(1,1):" << endl << m.block<2,2>(1,1) << endl;
+m.block<2,2>(1,1).setZero();
+cout << "Now the matrix m is:" << endl << m << endl;
diff --git a/doc/snippets/MatrixBase_template_int.cpp b/doc/snippets/MatrixBase_segment_int_int.cpp
index 6bee6d6c5..70cd6d266 100644
--- a/doc/snippets/MatrixBase_template_int.cpp
+++ b/doc/snippets/MatrixBase_segment_int_int.cpp
@@ -1,5 +1,5 @@
RowVector4i v = RowVector4i::Random();
cout << "Here is the vector v:" << endl << v << endl;
-cout << "Here is v.block<2>(1):" << endl << v.block<2>(1) << endl;
-v.block<2>(2).setZero();
+cout << "Here is v.segment(1, 2):" << endl << v.segment(1, 2) << endl;
+v.segment(1, 2).setZero();
cout << "Now the vector v is:" << endl << v << endl;
diff --git a/doc/snippets/MatrixBase_template_int_segment.cpp b/doc/snippets/MatrixBase_template_int_segment.cpp
new file mode 100644
index 000000000..e448b4022
--- /dev/null
+++ b/doc/snippets/MatrixBase_template_int_segment.cpp
@@ -0,0 +1,5 @@
+RowVector4i v = RowVector4i::Random();
+cout << "Here is the vector v:" << endl << v << endl;
+cout << "Here is v.segment<2>(1):" << endl << v.segment<2>(1) << endl;
+v.segment<2>(2).setZero();
+cout << "Now the vector v is:" << endl << v << endl;