covariance_ellipsoid.hpp
Go to the documentation of this file.
1 
16 /*****************************************************************************
17 ** Ifdefs
18 *****************************************************************************/
19 
20 #ifndef ECL_STATISTICS_COVARIANCE_ELLIPSOID_HPP_
21 #define ECL_STATISTICS_COVARIANCE_ELLIPSOID_HPP_
22 
23 /*****************************************************************************
24 ** Includes
25 *****************************************************************************/
26 
27 #include <cmath>
28 #include <ecl/linear_algebra.hpp>
29 #include <ecl/config/macros.hpp>
30 
31 /*****************************************************************************
32 ** Namespaces
33 *****************************************************************************/
34 
35 namespace ecl {
36 
37 /*****************************************************************************
38 ** Interface [CovarianceEllipsoid]
39 *****************************************************************************/
47 template<typename T, int N>
49 private:
57  virtual ~CovarianceEllipsoid() {};
58 };
59 
60 /*****************************************************************************
61 ** Interface [CovarianceEllipsoid2f]
62 *****************************************************************************/
98 template<>
100 public:
108 
118  CovarianceEllipsoid(const ecl::linear_algebra::Matrix2f& M);
119 
120  virtual ~CovarianceEllipsoid() {};
121 
131  void compute(const ecl::linear_algebra::Matrix2f& M);
132 
140  const ecl::linear_algebra::Vector2f& lengths() { return ellipse_lengths; }
148  const ecl::linear_algebra::Matrix2f& axes() { return ellipse_axes; }
149 
158  double rotation();
174  ecl::linear_algebra::Vector2f intercepts();
175 
176  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
177 
178 private:
179  ecl::linear_algebra::Vector2f ellipse_lengths;
180  ecl::linear_algebra::Matrix2f ellipse_axes;
181 };
182 
183 
184 
216 template<>
218 public:
226 
237  CovarianceEllipsoid(const ecl::linear_algebra::Matrix3f& M, const bool sort = true);
238 
239  virtual ~CovarianceEllipsoid() {};
240 
254  void compute(const ecl::linear_algebra::Matrix3f& M, const bool sort = true);
255 
263  const ecl::linear_algebra::Vector3f& lengths() { return ellipse_lengths; }
272  const ecl::linear_algebra::Matrix3f& axes() { return ellipse_axes; }
273 
274  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
275 
276 private:
277  ecl::linear_algebra::Vector3f ellipse_lengths;
278  ecl::linear_algebra::Matrix3f ellipse_axes;
279 };
280 
281 /*****************************************************************************
282 ** Interface [CovarianceEllipsoid2d]
283 *****************************************************************************/
319 template<>
321 public:
329 
339  CovarianceEllipsoid(const ecl::linear_algebra::Matrix2d& M);
340 
341  virtual ~CovarianceEllipsoid() {};
342 
352  void compute(const ecl::linear_algebra::Matrix2d& M);
353 
361  const ecl::linear_algebra::Vector2d& lengths() { return ellipse_lengths; }
369  const ecl::linear_algebra::Matrix2d& axes() { return ellipse_axes; }
370 
379  double rotation();
395  ecl::linear_algebra::Vector2d intercepts();
396 
397  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
398 
399 private:
400  ecl::linear_algebra::Vector2d ellipse_lengths;
401  ecl::linear_algebra::Matrix2d ellipse_axes;
402 };
403 
404 
405 
437 template<>
439 public:
447 
458  CovarianceEllipsoid(const ecl::linear_algebra::Matrix3d& M, const bool sort = true);
459 
460  virtual ~CovarianceEllipsoid() {};
461 
475  void compute(const ecl::linear_algebra::Matrix3d& M, const bool sort = true);
476 
484  const ecl::linear_algebra::Vector3d& lengths() { return ellipse_lengths; }
493  const ecl::linear_algebra::Matrix3d& axes() { return ellipse_axes; }
494 
495  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
496 
497 private:
498  ecl::linear_algebra::Vector3d ellipse_lengths;
499  ecl::linear_algebra::Matrix3d ellipse_axes;
500 };
501 
502 /*****************************************************************************
503 ** Convenience Typedefs
504 *****************************************************************************/
529 
538 
539 
540 } // namespace ecl
541 
542 #endif /* ECL_STATISTICS_COVARIANCE_ELLIPSOID_HPP_ */
Specialisation of covariance ellipsoids in three dimensions.
ecl::linear_algebra::Matrix2d ellipse_axes
const ecl::linear_algebra::Matrix3f & axes()
Returns the ellipse axes/covariance eigen vectors.
Specialisation of covariance ellipsoids in three dimensions.
const ecl::linear_algebra::Vector3d & lengths()
Returns the precomputed ellipsoid minor/major axis lengths.
CovarianceEllipsoid< float, 3 > CovarianceEllipsoid3f
Convenience typedef for 3f covariance ellipsoids.
ecl::linear_algebra::Vector2d ellipse_lengths
Specialisation of covariance ellipsoids in two dimensions.
ecl::linear_algebra::Vector3d ellipse_lengths
const ecl::linear_algebra::Matrix2f & axes()
Returns the ellipse axes/covariance eigen vectors.
CovarianceEllipsoid< float, 2 > CovarianceEllipsoid2f
Convenience typedef for 2f covariance ellipsoids.
ecl::linear_algebra::Matrix3d ellipse_axes
CovarianceEllipsoid< double, 2 > CovarianceEllipsoid2d
Convenience typedef for 2d covariance ellipsoids.
const ecl::linear_algebra::Vector3f & lengths()
Returns the precomputed ellipsoid minor/major axis lengths.
const ecl::linear_algebra::Matrix2d & axes()
Returns the ellipse axes/covariance eigen vectors.
Parent template for covariance ellipsoids.
const ecl::linear_algebra::Vector2f & lengths()
Returns the precomputed ellipsoid minor/major axis lengths.
const ecl::linear_algebra::Vector2d & lengths()
Returns the precomputed ellipsoid minor/major axis lengths.
const ecl::linear_algebra::Matrix3d & axes()
Returns the ellipse axes/covariance eigen vectors.
ecl::linear_algebra::Vector2f ellipse_lengths
ecl::linear_algebra::Vector3f ellipse_lengths
CovarianceEllipsoid()
Prevents usage of this template class directly.
CovarianceEllipsoid< double, 3 > CovarianceEllipsoid3d
Convenience typedef for 3d covariance ellipsoids.
ecl::linear_algebra::Matrix2f ellipse_axes
Specialisation of covariance ellipsoids in two dimensions.
#define ECL_PUBLIC
ecl::linear_algebra::Matrix3f ellipse_axes


ecl_statistics
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:40