COSC-4P80-Assignment-2/lib/eigen-3.4.0/doc/examples/Tutorial_ArrayClass_cwise_o...

20 lines
410 B
C++
Raw Normal View History

2024-10-21 16:42:03 -04:00
#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;
}