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/CwiseUnaryOp.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/CwiseUnaryOp.h')
-rw-r--r-- | Eigen/src/Core/CwiseUnaryOp.h | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/Eigen/src/Core/CwiseUnaryOp.h b/Eigen/src/Core/CwiseUnaryOp.h index 1abf0fffb..b51bd51af 100644 --- a/Eigen/src/Core/CwiseUnaryOp.h +++ b/Eigen/src/Core/CwiseUnaryOp.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // -// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr> +// Copyright (C) 2008-2010 Gael Guennebaud <g.gael@free.fr> // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com> // // Eigen is free software; you can redistribute it and/or @@ -74,16 +74,14 @@ class CwiseUnaryOp : 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 UnaryOp& _functor() const { return m_functor; } - - /** \internal used for introspection */ - const typename ei_cleantype<typename MatrixType::Nested>::type& - _expression() const { return m_matrix; } + /** \returns the functor representing the unary operation */ + const UnaryOp& 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(); } @@ -98,37 +96,33 @@ template<typename UnaryOp, typename MatrixType> class CwiseUnaryOpImpl<UnaryOp,MatrixType,Dense> : public MatrixType::template MakeBase< CwiseUnaryOp<UnaryOp, 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 CwiseUnaryOp<UnaryOp, MatrixType> Derived; public: - typedef CwiseUnaryOp<UnaryOp, MatrixType> Derived; typedef typename MatrixType::template MakeBase< CwiseUnaryOp<UnaryOp, MatrixType> >::Type Base; - _EIGEN_DENSE_PUBLIC_INTERFACE( Derived ) + 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)); } template<int LoadMode> EIGEN_STRONG_INLINE PacketScalar packet(int row, int col) const { - return derived()._functor().packetOp(nestedExpression().template packet<LoadMode>(row, col)); + return derived().functor().packetOp(derived().nestedExpression().template packet<LoadMode>(row, col)); } EIGEN_STRONG_INLINE const Scalar coeff(int index) const { - return derived()._functor()(nestedExpression().coeff(index)); + return derived().functor()(derived().nestedExpression().coeff(index)); } template<int LoadMode> EIGEN_STRONG_INLINE PacketScalar packet(int index) const { - return derived()._functor().packetOp(nestedExpression().template packet<LoadMode>(index)); + return derived().functor().packetOp(derived().nestedExpression().template packet<LoadMode>(index)); } }; |