diff options
author | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2010-07-12 22:45:57 +0100 |
---|---|---|
committer | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2010-07-12 22:45:57 +0100 |
commit | 140ad0908d9646c3c44dfe65ee4274c12c324770 (patch) | |
tree | a1f345d22368148e2b1dd45e01f13f09eac8f407 /doc/examples/Tutorial_ArrayClass_cwise_other.cpp | |
parent | 8e776c94c173e3c8ea7ec32648f8b2f09bf09b37 (diff) |
Tutorial page 3: add more cwise operations, condense rest.
Diffstat (limited to 'doc/examples/Tutorial_ArrayClass_cwise_other.cpp')
-rw-r--r-- | doc/examples/Tutorial_ArrayClass_cwise_other.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/examples/Tutorial_ArrayClass_cwise_other.cpp b/doc/examples/Tutorial_ArrayClass_cwise_other.cpp new file mode 100644 index 000000000..d9046c63d --- /dev/null +++ b/doc/examples/Tutorial_ArrayClass_cwise_other.cpp @@ -0,0 +1,19 @@ +#include <Eigen/Dense> +#include <iostream> + +using namespace Eigen; +using namespace std; + +int main() +{ + ArrayXf a = ArrayXf::Random(5); + a *= 2; + cout << "a =" << endl + << a << endl; + cout << "a.abs() =" << endl + << a.abs() << endl; + cout << "a.abs().sqrt() =" << endl + << a.abs().sqrt() << endl; + cout << "a.min(a.abs().sqrt()) =" << endl + << a.min(a.abs().sqrt()) << endl; +} |