mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
update of the geometry tutorial
This commit is contained in:
@@ -7,10 +7,11 @@ int main(int, char *[])
|
||||
{
|
||||
for (int size=1; size<=4; ++size)
|
||||
{
|
||||
MatrixXi m(size,size+1); // creates a size x (size+1) matrix of int
|
||||
for (int j=0; j<m.cols(); ++j) // loop over the columns
|
||||
for (int i=0; i<m.rows(); ++i) // loop over the rows
|
||||
m(i,j) = i+j*m.rows(); // to access matrix elements use operator (int,int)
|
||||
MatrixXi m(size,size+1); // a size x (size+1) matrix of int
|
||||
for (int j=0; j<m.cols(); ++j) // loop over the columns
|
||||
for (int i=0; i<m.rows(); ++i) // loop over the rows
|
||||
m(i,j) = i+j*m.rows(); // to access matrix elements
|
||||
// use operator (int,int)
|
||||
std::cout << m << "\n\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -10,5 +10,6 @@ int main(int, char *[])
|
||||
Matrix4f m4 = Matrix4f::Identity();
|
||||
Vector4i v4(1, 2, 3, 4);
|
||||
|
||||
std::cout << "m3\n" << m3 << "\nm4:\n" << m4 << "\nv4:\n" << v4 << std::endl;
|
||||
std::cout << "m3\n" << m3 << "\nm4:\n"
|
||||
<< m4 << "\nv4:\n" << v4 << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user