mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 08:55:37 +00:00
aliases for Eigen base types
This commit is contained in:
parent
3bebfb6e10
commit
a14e5eb20e
@ -47,11 +47,11 @@
|
||||
#define MAX_PATH_LENGTH 512u
|
||||
|
||||
// copy/assignement from Eigen expression
|
||||
#define EIGEN_EXPR_CTOR(ctorName, Class, Base, EigenBase) \
|
||||
#define EIGEN_EXPR_CTOR(ctorName, Class, Base, ExprType) \
|
||||
template <typename Derived>\
|
||||
ctorName(const Eigen::EigenBase<Derived> &m): Base(m) {}\
|
||||
ctorName(const ExprType<Derived> &m): Base(m) {}\
|
||||
template<typename Derived>\
|
||||
Class & operator=(const Eigen::EigenBase<Derived> &m)\
|
||||
Class & operator=(const ExprType<Derived> &m)\
|
||||
{\
|
||||
this->Base::operator=(m);\
|
||||
return *this;\
|
||||
@ -63,10 +63,16 @@ BEGIN_NAMESPACE
|
||||
const int dynamic = -1;
|
||||
|
||||
// array types
|
||||
template <typename Derived>
|
||||
using ArrayExpr = Eigen::ArrayBase<Derived>;
|
||||
|
||||
template <typename T, int nRow = dynamic, int nCol = dynamic>
|
||||
using Array = Eigen::Array<T, nRow, nCol>;
|
||||
|
||||
// matrix types
|
||||
template <typename Derived>
|
||||
using MatExpr = Eigen::MatrixBase<Derived>;
|
||||
|
||||
template <typename T, int nRow = dynamic, int nCol = dynamic>
|
||||
using Mat = Eigen::Matrix<T, nRow, nCol>;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
// constructors
|
||||
DMat(void) = default;
|
||||
DMat(const Index nRow, const Index nCol);
|
||||
EIGEN_EXPR_CTOR(DMat, DMat, Base, MatrixBase)
|
||||
EIGEN_EXPR_CTOR(DMat, DMat, Base, MatExpr)
|
||||
// destructor
|
||||
virtual ~DMat(void) = default;
|
||||
// IO
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
// constructors
|
||||
StatArray(void);
|
||||
explicit StatArray(const Index size);
|
||||
EIGEN_EXPR_CTOR(StatArray, unique_arg(StatArray<T, os>), Base, ArrayBase)
|
||||
EIGEN_EXPR_CTOR(StatArray, unique_arg(StatArray<T, os>), Base, ArrayExpr)
|
||||
// destructor
|
||||
virtual ~StatArray(void) = default;
|
||||
// access
|
||||
|
@ -40,7 +40,7 @@ class FitResult: public DVec
|
||||
public:
|
||||
// constructors
|
||||
FitResult(void) = default;
|
||||
EIGEN_EXPR_CTOR(FitResult, FitResult, Base, MatrixBase)
|
||||
EIGEN_EXPR_CTOR(FitResult, FitResult, Base, MatExpr)
|
||||
// destructor
|
||||
virtual ~FitResult(void) = default;
|
||||
// access
|
||||
|
Loading…
Reference in New Issue
Block a user