mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-30 17:40:05 +08:00
QuickStart examples: shorten var names, remove superfluous 'using'.
This commit is contained in:
parent
729960e465
commit
9d4b16c1d1
@ -2,7 +2,6 @@
|
||||
#include <Eigen/Dense>
|
||||
|
||||
using Eigen::MatrixXd;
|
||||
using Eigen::VectorXd;
|
||||
|
||||
int main(int, char *[])
|
||||
{
|
||||
@ -11,5 +10,5 @@ int main(int, char *[])
|
||||
m(1,0) = 2.5;
|
||||
m(0,1) = -1;
|
||||
m(1,1) = m(1,0) + m(0,1);
|
||||
std::cout << 2*m << std::endl;
|
||||
std::cout << m << std::endl;
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ using Eigen::VectorXd;
|
||||
int main(int, char *[])
|
||||
{
|
||||
MatrixXd m(3,3);
|
||||
for (int rowIndex = 0; rowIndex < 3; ++rowIndex)
|
||||
for (int columnIndex = 0; columnIndex < 3; ++columnIndex)
|
||||
m(rowIndex, columnIndex) = rowIndex + 0.01 * columnIndex;
|
||||
for (int row = 0; row < 3; ++row)
|
||||
for (int column = 0; column < 3; ++column)
|
||||
m(row, column) = row + 0.01 * column;
|
||||
VectorXd v = VectorXd::Ones(3);
|
||||
std::cout << m * v << std::endl;
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ using Eigen::Vector3d;
|
||||
int main(int, char *[])
|
||||
{
|
||||
Matrix3d m;
|
||||
for (int rowIndex = 0; rowIndex < 3; ++rowIndex)
|
||||
for (int columnIndex = 0; columnIndex < 3; ++columnIndex)
|
||||
m(rowIndex, columnIndex) = rowIndex + 0.01 * columnIndex;
|
||||
for (int row = 0; row < 3; ++row)
|
||||
for (int column = 0; column < 3; ++column)
|
||||
m(row, column) = row + 0.01 * column;
|
||||
Vector3d v = Vector3d::Ones();
|
||||
std::cout << m * v << std::endl;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user