diff options
author | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2010-06-18 10:43:22 +0100 |
---|---|---|
committer | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2010-06-18 10:43:22 +0100 |
commit | 9d4b16c1d1a93da478a2a7fa491f741ac87bc5e0 (patch) | |
tree | 8406f53c9a40885b25867851cfa7c5f9875ecc32 /doc/examples | |
parent | 729960e4656ab9f61e523a3908edf5474b04638d (diff) |
QuickStart examples: shorten var names, remove superfluous 'using'.
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/QuickStart_example.cpp | 3 | ||||
-rw-r--r-- | doc/examples/QuickStart_example2_dynamic.cpp | 6 | ||||
-rw-r--r-- | doc/examples/QuickStart_example2_fixed.cpp | 6 |
3 files changed, 7 insertions, 8 deletions
diff --git a/doc/examples/QuickStart_example.cpp b/doc/examples/QuickStart_example.cpp index 3fbd6fab2..f4ab2fbe0 100644 --- a/doc/examples/QuickStart_example.cpp +++ b/doc/examples/QuickStart_example.cpp @@ -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; } diff --git a/doc/examples/QuickStart_example2_dynamic.cpp b/doc/examples/QuickStart_example2_dynamic.cpp index c304c934a..b46ecef99 100644 --- a/doc/examples/QuickStart_example2_dynamic.cpp +++ b/doc/examples/QuickStart_example2_dynamic.cpp @@ -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; } diff --git a/doc/examples/QuickStart_example2_fixed.cpp b/doc/examples/QuickStart_example2_fixed.cpp index 6d7d63d15..9fcddcdd6 100644 --- a/doc/examples/QuickStart_example2_fixed.cpp +++ b/doc/examples/QuickStart_example2_fixed.cpp @@ -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; } |