diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-01-22 10:15:41 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-01-22 10:15:41 +0100 |
commit | d40c110053c13692ffc0df25fca292d98996d496 (patch) | |
tree | bcd5aeb0665e47168bb5cb53e5e935da1614bb7d /Eigen/src/Core/CwiseUnaryView.h | |
parent | f1a025185a25e53eb1c4817141c0523cf48f70bc (diff) |
lot of cleaning:
- clean the *_PUBLIC_INTERFACE_*
- update Diagonal, ReturnByValue, ForceAlignedAccess, UnaryView, etc. to support array
- many other small stuff
Diffstat (limited to 'Eigen/src/Core/CwiseUnaryView.h')
-rw-r--r-- | Eigen/src/Core/CwiseUnaryView.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Eigen/src/Core/CwiseUnaryView.h b/Eigen/src/Core/CwiseUnaryView.h index 2ff5d3d45..2198ed226 100644 --- a/Eigen/src/Core/CwiseUnaryView.h +++ b/Eigen/src/Core/CwiseUnaryView.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // -// Copyright (C) 2009 Gael Guennebaud <g.gael@free.fr> +// Copyright (C) 2009-2010 Gael Guennebaud <g.gael@free.fr> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -72,12 +72,14 @@ class CwiseUnaryView : ei_no_assignment_operator, EIGEN_STRONG_INLINE int rows() const { return m_matrix.rows(); } EIGEN_STRONG_INLINE int cols() const { return m_matrix.cols(); } - /** \internal used for introspection */ - const ViewOp& _functor() const { return m_functor; } + /** \returns the functor representing unary operation */ + const ViewOp& functor() const { return m_functor; } + /** \returns the nested expression */ const typename ei_cleantype<typename MatrixType::Nested>::type& nestedExpression() const { return m_matrix; } + /** \returns the nested expression */ typename ei_cleantype<typename MatrixType::Nested>::type& nestedExpression() { return m_matrix.const_cast_derived(); } @@ -88,36 +90,34 @@ class CwiseUnaryView : ei_no_assignment_operator, }; template<typename ViewOp, typename MatrixType> -class CwiseUnaryViewImpl<ViewOp,MatrixType,Dense> : public MatrixBase<CwiseUnaryView<ViewOp, MatrixType> > +class CwiseUnaryViewImpl<ViewOp,MatrixType,Dense> + : public MatrixType::template MakeBase< CwiseUnaryView<ViewOp, MatrixType> >::Type { - const typename ei_cleantype<typename MatrixType::Nested>::type& nestedExpression() const - { return derived().nestedExpression(); } - typename ei_cleantype<typename MatrixType::Nested>::type& nestedExpression() - { return derived().nestedExpression(); } + typedef CwiseUnaryView<ViewOp, MatrixType> Derived; public: - typedef CwiseUnaryView<ViewOp, MatrixType> Derived; - EIGEN_DENSE_PUBLIC_INTERFACE( Derived ) + typedef typename MatrixType::template MakeBase< CwiseUnaryView<ViewOp, MatrixType> >::Type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Derived) EIGEN_STRONG_INLINE const Scalar coeff(int row, int col) const { - return derived()._functor()(nestedExpression().coeff(row, col)); + return derived().functor()(derived().nestedExpression().coeff(row, col)); } EIGEN_STRONG_INLINE const Scalar coeff(int index) const { - return derived()._functor()(nestedExpression().coeff(index)); + return derived().functor()(derived().nestedExpression().coeff(index)); } EIGEN_STRONG_INLINE Scalar& coeffRef(int row, int col) { - return derived()._functor()(nestedExpression().const_cast_derived().coeffRef(row, col)); + return derived().functor()(const_cast_derived().nestedExpression().coeffRef(row, col)); } EIGEN_STRONG_INLINE Scalar& coeffRef(int index) { - return derived()._functor()(nestedExpression().const_cast_derived().coeffRef(index)); + return derived().functor()(const_cast_derived().nestedExpression().coeffRef(index)); } }; |