mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Found a way to have eval() be a member function of class EiObject, instead of a global function.
CCMAIL:bensch128@yahoo.com
This commit is contained in:
@@ -28,13 +28,14 @@
|
||||
|
||||
#include "Util.h"
|
||||
|
||||
template<typename _Scalar, typename Derived> class EiObject
|
||||
template<typename _Scalar, typename _Derived> class EiObject
|
||||
{
|
||||
static const int RowsAtCompileTime = Derived::RowsAtCompileTime,
|
||||
ColsAtCompileTime = Derived::ColsAtCompileTime;
|
||||
static const int RowsAtCompileTime = _Derived::RowsAtCompileTime,
|
||||
ColsAtCompileTime = _Derived::ColsAtCompileTime;
|
||||
public:
|
||||
typedef typename EiForwardDecl<Derived>::Ref Ref;
|
||||
typedef typename EiForwardDecl<_Derived>::Ref Ref;
|
||||
typedef _Scalar Scalar;
|
||||
typedef _Derived Derived;
|
||||
|
||||
int rows() const { return static_cast<const Derived *>(this)->_rows(); }
|
||||
int cols() const { return static_cast<const Derived *>(this)->_cols(); }
|
||||
@@ -109,6 +110,8 @@ template<typename _Scalar, typename Derived> class EiObject
|
||||
|
||||
Scalar& operator()(int row, int col = 0)
|
||||
{ return write(row, col); }
|
||||
|
||||
EiEval<EiObject> eval() const;
|
||||
};
|
||||
|
||||
template<typename Scalar, typename Derived>
|
||||
|
||||
Reference in New Issue
Block a user