aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/examples
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-08-31 17:30:09 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-08-31 17:30:09 +0000
commit994629721a3e72e83b2df597d5f78d1dc9398c09 (patch)
tree110769ae85411d5eaa6b1d85250d9bc4580058b9 /doc/examples
parentd74916e4fe970030a1074fcf35328c3b49c1f899 (diff)
update of the geometry tutorial
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/Tutorial_simple_example_dynamic_size.cpp9
-rw-r--r--doc/examples/Tutorial_simple_example_fixed_size.cpp3
2 files changed, 7 insertions, 5 deletions
diff --git a/doc/examples/Tutorial_simple_example_dynamic_size.cpp b/doc/examples/Tutorial_simple_example_dynamic_size.cpp
index 19cfa6af5..5aecc8746 100644
--- a/doc/examples/Tutorial_simple_example_dynamic_size.cpp
+++ b/doc/examples/Tutorial_simple_example_dynamic_size.cpp
@@ -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";
}
diff --git a/doc/examples/Tutorial_simple_example_fixed_size.cpp b/doc/examples/Tutorial_simple_example_fixed_size.cpp
index 71bf1bafb..043a84831 100644
--- a/doc/examples/Tutorial_simple_example_fixed_size.cpp
+++ b/doc/examples/Tutorial_simple_example_fixed_size.cpp
@@ -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;
}