mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-29 09:05:55 +01:00
cleaner Eigen expression integration and constructor inheritance for StatArray and derived
This commit is contained in:
parent
f7345ea717
commit
b53b47fcda
@ -42,8 +42,6 @@ public:
|
|||||||
using Base::Base;
|
using Base::Base;
|
||||||
Dataset(void);
|
Dataset(void);
|
||||||
Dataset(const std::string &listFileName, const std::string &dataName);
|
Dataset(const std::string &listFileName, const std::string &dataName);
|
||||||
template <typename Derived>
|
|
||||||
Dataset(const Eigen::EigenBase<Derived> &dataset);
|
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~Dataset(void);
|
virtual ~Dataset(void);
|
||||||
// IO
|
// IO
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
#define BEGIN_NAMESPACE namespace Latan {
|
#define BEGIN_NAMESPACE namespace Latan {
|
||||||
#define END_NAMESPACE }
|
#define END_NAMESPACE }
|
||||||
|
|
||||||
|
// macro utilities
|
||||||
|
#define unique_arg(...) __VA_ARGS__
|
||||||
|
|
||||||
// attribute to switch off unused warnings with gcc
|
// attribute to switch off unused warnings with gcc
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define __dumb __attribute__((unused))
|
#define __dumb __attribute__((unused))
|
||||||
@ -35,7 +38,18 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// max length for paths
|
// max length for paths
|
||||||
#define MAX_PATH_LENGTH 512
|
#define MAX_PATH_LENGTH 512u
|
||||||
|
|
||||||
|
// copy/assignement from Eigen expression
|
||||||
|
#define EIGEN_EXPR_CTOR(ctorName, Class, Base, EigenBase) \
|
||||||
|
template <typename Derived>\
|
||||||
|
ctorName(const Eigen::EigenBase<Derived> &m): Base(m) {};\
|
||||||
|
template<typename Derived>\
|
||||||
|
Class & operator=(const Eigen::EigenBase<Derived> &m)\
|
||||||
|
{\
|
||||||
|
this->Base::operator=(m);\
|
||||||
|
return *this;\
|
||||||
|
}
|
||||||
|
|
||||||
BEGIN_NAMESPACE
|
BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
@ -34,17 +34,11 @@ public:
|
|||||||
// constructors
|
// constructors
|
||||||
DMat(void);
|
DMat(void);
|
||||||
DMat(const unsigned int nRow, const unsigned int nCol);
|
DMat(const unsigned int nRow, const unsigned int nCol);
|
||||||
template <typename Derived>
|
EIGEN_EXPR_CTOR(DMat, DMat, Base, MatrixBase);
|
||||||
DMat(const Eigen::EigenBase<Derived> &m);
|
|
||||||
// IO
|
// IO
|
||||||
virtual IoType getType(void) const;
|
virtual IoType getType(void) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Derived>
|
|
||||||
DMat::DMat(const Eigen::EigenBase<Derived> &m)
|
|
||||||
: Base(m)
|
|
||||||
{}
|
|
||||||
|
|
||||||
END_NAMESPACE
|
END_NAMESPACE
|
||||||
|
|
||||||
#endif // Latan_Mat_hpp_
|
#endif // Latan_Mat_hpp_
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <latan/Global.hpp>
|
#include <latan/Global.hpp>
|
||||||
#include <latan/IoObject.hpp>
|
#include <latan/IoObject.hpp>
|
||||||
|
|
||||||
#define RLXG_STATE_SIZE 105
|
#define RLXG_STATE_SIZE 105u
|
||||||
|
|
||||||
BEGIN_NAMESPACE
|
BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
@ -41,10 +41,7 @@ private:
|
|||||||
typedef StatArray<T, SAMPLE_OFFSET> Base;
|
typedef StatArray<T, SAMPLE_OFFSET> Base;
|
||||||
public:
|
public:
|
||||||
// constructors
|
// constructors
|
||||||
Sample(void);
|
using Base::Base;
|
||||||
Sample(const unsigned int nSample);
|
|
||||||
template <typename Derived>
|
|
||||||
Sample(const Eigen::EigenBase<Derived> &s);
|
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~Sample(void);
|
virtual ~Sample(void);
|
||||||
};
|
};
|
||||||
|
@ -38,8 +38,8 @@ public:
|
|||||||
// constructors
|
// constructors
|
||||||
StatArray(void);
|
StatArray(void);
|
||||||
StatArray(const unsigned int size);
|
StatArray(const unsigned int size);
|
||||||
template <typename Derived>
|
EIGEN_EXPR_CTOR(StatArray, unique_arg(StatArray<T, offset>), Base,
|
||||||
StatArray(const Eigen::EigenBase<Derived> &s);
|
ArrayBase);
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~StatArray(void);
|
virtual ~StatArray(void);
|
||||||
// access
|
// access
|
||||||
|
Loading…
x
Reference in New Issue
Block a user