source: pacpussensors/trunk/Vislab/lib3dv/eigen/Eigen-install/doc/snippets/compile_MatrixBase_all.cpp@ 136

Last change on this file since 136 was 136, checked in by ldecherf, 7 years ago

Doc

File size: 693 bytes
Line 
1#include <Eigen/Dense>
2#include <iostream>
3
4using namespace Eigen;
5using namespace std;
6
7int main(int, char**)
8{
9 cout.precision(3);
10 Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones());
11Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs();
12// let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax:
13cout << "Is (" << p0.transpose() << ") inside the box: "
14 << ((boxMin.array()<p0.array()).all() && (boxMax.array()>p0.array()).all()) << endl;
15cout << "Is (" << p1.transpose() << ") inside the box: "
16 << ((boxMin.array()<p1.array()).all() && (boxMax.array()>p1.array()).all()) << endl;
17
18 return 0;
19}
Note: See TracBrowser for help on using the repository browser.