mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Implement mixed static/dynamic-size .block() (bug #579)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is the block:" << endl << m.block<2, Dynamic>(1, 1, 2, 3) << endl;
|
||||
m.block<2, Dynamic>(1, 1, 2, 3).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.bottomLeftCorner<2,Dynamic>(2,2):" << endl;
|
||||
cout << m.bottomLeftCorner<2,Dynamic>(2,2) << endl;
|
||||
m.bottomLeftCorner<2,Dynamic>(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,Dynamic>(2,2):" << endl;
|
||||
cout << m.bottomRightCorner<2,Dynamic>(2,2) << endl;
|
||||
m.bottomRightCorner<2,Dynamic>(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,Dynamic>(2,2):" << endl;
|
||||
cout << m.topLeftCorner<2,Dynamic>(2,2) << endl;
|
||||
m.topLeftCorner<2,Dynamic>(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,Dynamic>(2,2):" << endl;
|
||||
cout << m.topRightCorner<2,Dynamic>(2,2) << endl;
|
||||
m.topRightCorner<2,Dynamic>(2,2).setZero();
|
||||
cout << "Now the matrix m is:" << endl << m << endl;
|
||||
Reference in New Issue
Block a user