aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/src/Core/Block.h25
-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
6 files changed, 47 insertions, 5 deletions
diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h
index 52bdbc9ac..ffb6188ff 100644
--- a/Eigen/src/Core/Block.h
+++ b/Eigen/src/Core/Block.h
@@ -44,7 +44,7 @@
* \include class_Block.cpp
* Output: \verbinclude class_Block.out
*
- * \note Even though this expression has dynamic size, in the case where the \a MatrixType
+ * \note Even though this expression has dynamic size, in the case where \a MatrixType
* has fixed size, this expression inherits a fixed maximal size which means that evaluating
* it does not cause a dynamic memory allocation.
*
@@ -112,6 +112,10 @@ template<typename MatrixType> class Block
* Example: \include MatrixBase_block_int_int_int_int.cpp
* Output: \verbinclude MatrixBase_block_int_int_int_int.out
*
+ * \note Even though the returned expression has dynamic size, in the case
+ * when it is applied to a fixed-size matrix, it inherits a fixed maximal size,
+ * which means that evaluating it does not cause a dynamic memory allocation.
+ *
* \sa class Block, fixedBlock(int,int)
*/
template<typename Scalar, typename Derived>
@@ -139,6 +143,10 @@ const Block<Derived> MatrixBase<Scalar, Derived>
* Example: \include MatrixBase_block_int_int.cpp
* Output: \verbinclude MatrixBase_block_int_int.out
*
+ * \note Even though the returned expression has dynamic size, in the case
+ * when it is applied to a fixed-size vector, it inherits a fixed maximal size,
+ * which means that evaluating it does not cause a dynamic memory allocation.
+ *
* \sa class Block, fixedBlock(int)
*/
template<typename Scalar, typename Derived>
@@ -173,6 +181,10 @@ const Block<Derived> MatrixBase<Scalar, Derived>
* Example: \include MatrixBase_start_int.cpp
* Output: \verbinclude MatrixBase_start_int.out
*
+ * \note Even though the returned expression has dynamic size, in the case
+ * when it is applied to a fixed-size vector, it inherits a fixed maximal size,
+ * which means that evaluating it does not cause a dynamic memory allocation.
+ *
* \sa class Block, block(int,int)
*/
template<typename Scalar, typename Derived>
@@ -205,6 +217,10 @@ const Block<Derived> MatrixBase<Scalar, Derived>
* Example: \include MatrixBase_end_int.cpp
* Output: \verbinclude MatrixBase_end_int.out
*
+ * \note Even though the returned expression has dynamic size, in the case
+ * when it is applied to a fixed-size vector, it inherits a fixed maximal size,
+ * which means that evaluating it does not cause a dynamic memory allocation.
+ *
* \sa class Block, block(int,int)
*/
template<typename Scalar, typename Derived>
@@ -234,13 +250,18 @@ const Block<Derived> MatrixBase<Scalar, Derived>
/** \returns a dynamic-size expression of a corner of *this.
*
- * \param type the type of corner. Can be \a TopLeft, \a TopRight, \a BottomLeft, \a BottomRight.
+ * \param type the type of corner. Can be \a Eigen::TopLeft, \a Eigen::TopRight,
+ * \a Eigen::BottomLeft, \a Eigen::BottomRight.
* \param cRows the number of rows in the corner
* \param cCols the number of columns in the corner
*
* Example: \include MatrixBase_corner_enum_int_int.cpp
* Output: \verbinclude MatrixBase_corner_enum_int_int.out
*
+ * \note Even though the returned expression has dynamic size, in the case
+ * when it is applied to a fixed-size matrix, it inherits a fixed maximal size,
+ * which means that evaluating it does not cause a dynamic memory allocation.
+ *
* \sa class Block, block(int,int,int,int)
*/
template<typename Scalar, typename Derived>
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;