mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
merge with default Eigen
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
typedef Matrix<double,4,Dynamic> Matrix4Xd;
|
||||
Matrix4Xd M = Matrix4Xd::Random(4,5);
|
||||
Projective3d P(Matrix4d::Random());
|
||||
cout << "The matrix M is:" << endl << M << endl << endl;
|
||||
cout << "M.colwise().hnormalized():" << endl << M.colwise().hnormalized() << endl << endl;
|
||||
cout << "P*M:" << endl << P*M << endl << endl;
|
||||
cout << "(P*M).colwise().hnormalized():" << endl << (P*M).colwise().hnormalized() << endl << endl;
|
||||
cout << "(P*M).colwise().hnormalized():" << endl << (P*M).colwise().hnormalized() << endl << endl;
|
||||
|
||||
@@ -3,5 +3,5 @@ m << 1, 0,
|
||||
1, 1;
|
||||
cout << "Comparing m with identity matrix:" << endl;
|
||||
cout << m.cwiseEqual(MatrixXi::Identity(2,2)) << endl;
|
||||
int count = m.cwiseEqual(MatrixXi::Identity(2,2)).count();
|
||||
Index count = m.cwiseEqual(MatrixXi::Identity(2,2)).count();
|
||||
cout << "Number of coefficients that are equal: " << count << endl;
|
||||
|
||||
@@ -3,5 +3,5 @@ m << 1, 0,
|
||||
1, 1;
|
||||
cout << "Comparing m with identity matrix:" << endl;
|
||||
cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl;
|
||||
int count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count();
|
||||
Index count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count();
|
||||
cout << "Number of coefficients that are not equal: " << count << endl;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Eigen::placeholders::all;
|
||||
Matrix4i m = Matrix4i::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
cout << "Here is m(all).transpose():" << endl << m(all).transpose() << endl;
|
||||
|
||||
7
doc/snippets/Matrix_Map_stride.cpp
Normal file
7
doc/snippets/Matrix_Map_stride.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
Matrix4i A;
|
||||
A << 1, 2, 3, 4,
|
||||
5, 6, 7, 8,
|
||||
9, 10, 11, 12,
|
||||
13, 14, 15, 16;
|
||||
|
||||
std::cout << Matrix2i::Map(&A(1,1),Stride<8,2>()) << std::endl;
|
||||
@@ -1,7 +1,6 @@
|
||||
typedef Matrix<double,3,Dynamic> Matrix3Xd;
|
||||
Matrix3Xd M = Matrix3Xd::Random(3,5);
|
||||
Projective3d P(Matrix4d::Random());
|
||||
cout << "The matrix M is:" << endl << M << endl << endl;
|
||||
cout << "M.colwise().homogeneous():" << endl << M.colwise().homogeneous() << endl << endl;
|
||||
cout << "P * M.colwise().homogeneous():" << endl << P * M.colwise().homogeneous() << endl << endl;
|
||||
cout << "P * M.colwise().homogeneous().hnormalized(): " << endl << (P * M.colwise().homogeneous()).colwise().hnormalized() << endl << endl;
|
||||
cout << "P * M.colwise().homogeneous().hnormalized(): " << endl << (P * M.colwise().homogeneous()).colwise().hnormalized() << endl << endl;
|
||||
|
||||
Reference in New Issue
Block a user