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>
48 class ECL_PUBLIC CovarianceEllipsoid {
49 private:
56  CovarianceEllipsoid() {};
57  virtual ~CovarianceEllipsoid() {};
58 };
59 
60 /*****************************************************************************
61 ** Interface [CovarianceEllipsoid2f]
62 *****************************************************************************/
98 template<>
99 class ECL_PUBLIC CovarianceEllipsoid<float,2> {
100 public:
107  CovarianceEllipsoid();
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<>
217 class ECL_PUBLIC CovarianceEllipsoid<float,3> {
218 public:
225  CovarianceEllipsoid();
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<>
320 class ECL_PUBLIC CovarianceEllipsoid<double,2> {
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<>
438 class ECL_PUBLIC CovarianceEllipsoid<double,3> {
439 public:
446  CovarianceEllipsoid();
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_ */
ecl::CovarianceEllipsoid3f
CovarianceEllipsoid< float, 3 > CovarianceEllipsoid3f
Convenience typedef for 3f covariance ellipsoids.
Definition: covariance_ellipsoid.hpp:534
ecl::CovarianceEllipsoid
Parent template for covariance ellipsoids.
Definition: covariance_ellipsoid.hpp:54
ecl::CovarianceEllipsoid< float, 2 >
Specialisation of covariance ellipsoids in two dimensions.
Definition: covariance_ellipsoid.hpp:105
ecl::CovarianceEllipsoid2d
CovarianceEllipsoid< double, 2 > CovarianceEllipsoid2d
Convenience typedef for 2d covariance ellipsoids.
Definition: covariance_ellipsoid.hpp:526
linear_algebra.hpp
ecl::CovarianceEllipsoid2f
CovarianceEllipsoid< float, 2 > CovarianceEllipsoid2f
Convenience typedef for 2f covariance ellipsoids.
Definition: covariance_ellipsoid.hpp:518
ecl::CovarianceEllipsoid< double, 3 >
Specialisation of covariance ellipsoids in three dimensions.
Definition: covariance_ellipsoid.hpp:444
ecl::CovarianceEllipsoid3d
CovarianceEllipsoid< double, 3 > CovarianceEllipsoid3d
Convenience typedef for 3d covariance ellipsoids.
Definition: covariance_ellipsoid.hpp:543
ecl::CovarianceEllipsoid< float, 3 >
Specialisation of covariance ellipsoids in three dimensions.
Definition: covariance_ellipsoid.hpp:223
ecl::CovarianceEllipsoid< double, 2 >
Specialisation of covariance ellipsoids in two dimensions.
Definition: covariance_ellipsoid.hpp:326
macros.hpp
ecl
ECL_PUBLIC
#define ECL_PUBLIC


ecl_statistics
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:31