mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add examples for API documentation of block methods in DenseBase.
This commit is contained in:
6
doc/snippets/MatrixBase_bottomLeftCorner_int_int.cpp
Normal file
6
doc/snippets/MatrixBase_bottomLeftCorner_int_int.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.bottomLeftCorner(2, 2):" << endl;
|
||||
cout << m.bottomLeftCorner(2, 2) << endl;
|
||||
m.bottomLeftCorner(2, 2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
6
doc/snippets/MatrixBase_bottomRightCorner_int_int.cpp
Normal file
6
doc/snippets/MatrixBase_bottomRightCorner_int_int.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.bottomRightCorner(2, 2):" << endl;
|
||||
cout << m.bottomRightCorner(2, 2) << endl;
|
||||
m.bottomRightCorner(2, 2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
6
doc/snippets/MatrixBase_bottomRows_int.cpp
Normal file
6
doc/snippets/MatrixBase_bottomRows_int.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Array44i a = Array44i::Random();
|
||||
cout << "Here is the array a:" << endl << a << endl;
|
||||
cout << "Here is a.bottomRows(2):" << endl;
|
||||
cout << a.bottomRows(2) << endl;
|
||||
a.bottomRows(2).setZero();
|
||||
cout << "Now the array a is:" << endl << a << endl;
|
||||
6
doc/snippets/MatrixBase_leftCols_int.cpp
Normal file
6
doc/snippets/MatrixBase_leftCols_int.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Array44i a = Array44i::Random();
|
||||
cout << "Here is the array a:" << endl << a << endl;
|
||||
cout << "Here is a.leftCols(2):" << endl;
|
||||
cout << a.leftCols(2) << endl;
|
||||
a.leftCols(2).setZero();
|
||||
cout << "Now the array a is:" << endl << a << endl;
|
||||
6
doc/snippets/MatrixBase_rightCols_int.cpp
Normal file
6
doc/snippets/MatrixBase_rightCols_int.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Array44i a = Array44i::Random();
|
||||
cout << "Here is the array a:" << endl << a << endl;
|
||||
cout << "Here is a.rightCols(2):" << endl;
|
||||
cout << a.rightCols(2) << endl;
|
||||
a.rightCols(2).setZero();
|
||||
cout << "Now the array a is:" << endl << a << endl;
|
||||
6
doc/snippets/MatrixBase_template_int_bottomRows.cpp
Normal file
6
doc/snippets/MatrixBase_template_int_bottomRows.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Array44i a = Array44i::Random();
|
||||
cout << "Here is the array a:" << endl << a << endl;
|
||||
cout << "Here is a.bottomRows<2>():" << endl;
|
||||
cout << a.bottomRows<2>() << endl;
|
||||
a.bottomRows<2>().setZero();
|
||||
cout << "Now the array a is:" << endl << a << endl;
|
||||
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.bottomLeftCorner<2,2>():" << endl;
|
||||
cout << m.bottomLeftCorner<2,2>() << endl;
|
||||
m.bottomLeftCorner<2,2>().setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.bottomRightCorner<2,2>():" << endl;
|
||||
cout << m.bottomRightCorner<2,2>() << endl;
|
||||
m.bottomRightCorner<2,2>().setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.topLeftCorner<2,2>():" << endl;
|
||||
cout << m.topLeftCorner<2,2>() << endl;
|
||||
m.topLeftCorner<2,2>().setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.topRightCorner<2,2>():" << endl;
|
||||
cout << m.topRightCorner<2,2>() << endl;
|
||||
m.topRightCorner<2,2>().setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
6
doc/snippets/MatrixBase_template_int_leftCols.cpp
Normal file
6
doc/snippets/MatrixBase_template_int_leftCols.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Array44i a = Array44i::Random();
|
||||
cout << "Here is the array a:" << endl << a << endl;
|
||||
cout << "Here is a.leftCols<2>():" << endl;
|
||||
cout << a.leftCols<2>() << endl;
|
||||
a.leftCols<2>().setZero();
|
||||
cout << "Now the array a is:" << endl << a << endl;
|
||||
6
doc/snippets/MatrixBase_template_int_rightCols.cpp
Normal file
6
doc/snippets/MatrixBase_template_int_rightCols.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Array44i a = Array44i::Random();
|
||||
cout << "Here is the array a:" << endl << a << endl;
|
||||
cout << "Here is a.rightCols<2>():" << endl;
|
||||
cout << a.rightCols<2>() << endl;
|
||||
a.rightCols<2>().setZero();
|
||||
cout << "Now the array a is:" << endl << a << endl;
|
||||
6
doc/snippets/MatrixBase_template_int_topRows.cpp
Normal file
6
doc/snippets/MatrixBase_template_int_topRows.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Array44i a = Array44i::Random();
|
||||
cout << "Here is the array a:" << endl << a << endl;
|
||||
cout << "Here is a.topRows<2>():" << endl;
|
||||
cout << a.topRows<2>() << endl;
|
||||
a.topRows<2>().setZero();
|
||||
cout << "Now the array a is:" << endl << a << endl;
|
||||
6
doc/snippets/MatrixBase_topLeftCorner_int_int.cpp
Normal file
6
doc/snippets/MatrixBase_topLeftCorner_int_int.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.topLeftCorner(2, 2):" << endl;
|
||||
cout << m.topLeftCorner(2, 2) << endl;
|
||||
m.topLeftCorner(2, 2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
6
doc/snippets/MatrixBase_topRightCorner_int_int.cpp
Normal file
6
doc/snippets/MatrixBase_topRightCorner_int_int.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m.topRightCorner(2, 2):" << endl;
|
||||
cout << m.topRightCorner(2, 2) << endl;
|
||||
m.topRightCorner(2, 2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
6
doc/snippets/MatrixBase_topRows_int.cpp
Normal file
6
doc/snippets/MatrixBase_topRows_int.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
Array44i a = Array44i::Random();
|
||||
cout << "Here is the array a:" << endl << a << endl;
|
||||
cout << "Here is a.topRows(2):" << endl;
|
||||
cout << a.topRows(2) << endl;
|
||||
a.topRows(2).setZero();
|
||||
cout << "Now the array a is:" << endl << a << endl;
|
||||
Reference in New Issue
Block a user