diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-12-17 13:37:00 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-12-17 13:37:00 +0100 |
commit | ebb28788292bc8e76a03044f64ea580b43e03bef (patch) | |
tree | 43063a6ace8c0ae8b23312ccb2d5f49c876d3146 /Eigen/src/plugins | |
parent | 4e9c227bd52732a75b35f4c01da4e033c2f1e49a (diff) |
finally add a Array class with storage via the introduction of a DenseStorageBase
base class shared by both Matrix and Array
Diffstat (limited to 'Eigen/src/plugins')
-rw-r--r-- | Eigen/src/plugins/ArrayCwiseBinaryOps.h | 18 | ||||
-rw-r--r-- | Eigen/src/plugins/ArrayCwiseUnaryOps.h | 6 | ||||
-rw-r--r-- | Eigen/src/plugins/MatrixCwiseBinaryOps.h | 19 |
3 files changed, 7 insertions, 36 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseBinaryOps.h b/Eigen/src/plugins/ArrayCwiseBinaryOps.h index 19cb909d7..5197d3c4f 100644 --- a/Eigen/src/plugins/ArrayCwiseBinaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseBinaryOps.h @@ -3,27 +3,13 @@ * * \sa MatrixBase::cwiseProduct */ - -#define EIGEN_CWISE_PRODUCT_RETURN_TYPE \ - CwiseBinaryOp< \ - ei_scalar_product_op< \ - typename ei_scalar_product_traits< \ - typename ei_traits<Derived>::Scalar, \ - typename ei_traits<OtherDerived>::Scalar \ - >::ReturnType \ - >, \ - Derived, \ - OtherDerived \ - > template<typename OtherDerived> -EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE +EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived) operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { - return EIGEN_CWISE_PRODUCT_RETURN_TYPE(derived(), other.derived()); + return EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived)(derived(), other.derived()); } -#undef EIGEN_CWISE_PRODUCT_RETURN_TYPE - /** \returns an expression of the coefficient-wise \< operator of *this and \a other * * Example: \include Cwise_less.cpp diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h index ce69a04b5..c5c568fea 100644 --- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h @@ -148,10 +148,10 @@ cube() const } #define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME,FUNCTOR) \ - inline const CwiseUnaryOp<std::binder1st<FUNCTOR<Scalar> >,Derived> \ + inline const CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >,Derived> \ METHOD_NAME(Scalar s) const { \ - return CwiseUnaryOp<std::binder1st<FUNCTOR<Scalar> >,Derived> \ - (derived(), std::bind1st(FUNCTOR<Scalar>(), s)); \ + return CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >,Derived> \ + (derived(), std::bind2nd(FUNCTOR<Scalar>(), s)); \ } EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator==, std::equal_to); diff --git a/Eigen/src/plugins/MatrixCwiseBinaryOps.h b/Eigen/src/plugins/MatrixCwiseBinaryOps.h index 2b9621977..1efe7b314 100644 --- a/Eigen/src/plugins/MatrixCwiseBinaryOps.h +++ b/Eigen/src/plugins/MatrixCwiseBinaryOps.h @@ -32,28 +32,13 @@ * * \sa class CwiseBinaryOp, cwiseAbs2 */ - -#define EIGEN_CWISE_PRODUCT_RETURN_TYPE \ - CwiseBinaryOp< \ - ei_scalar_product_op< \ - typename ei_scalar_product_traits< \ - typename ei_traits<Derived>::Scalar, \ - typename ei_traits<OtherDerived>::Scalar \ - >::ReturnType \ - >, \ - Derived, \ - OtherDerived \ - > - template<typename OtherDerived> -EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE +EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived) cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { - return EIGEN_CWISE_PRODUCT_RETURN_TYPE(derived(), other.derived()); + return EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived)(derived(), other.derived()); } -#undef EIGEN_CWISE_PRODUCT_RETURN_TYPE - /** \returns an expression of the coefficient-wise == operator of *this and \a other * * \warning this performs an exact comparison, which is generally a bad idea with floating-point types. |