diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2009-12-01 13:16:51 +0100 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2009-12-01 13:16:51 +0100 |
commit | b08d5b2d2c73c095706cd2442878b960ef46df1f (patch) | |
tree | 39c0d3e24515c7f90be25b57107ac1072f18d869 /Eigen | |
parent | 2bf354da80d15a7a1e7ad9f58f375a21c6e721aa (diff) |
Even more NestByValue cleanup...
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/Sparse | 1 | ||||
-rw-r--r-- | Eigen/src/Core/ExpressionMaker.h | 6 | ||||
-rw-r--r-- | Eigen/src/Core/util/BlasUtil.h | 14 | ||||
-rw-r--r-- | Eigen/src/LU/FullPivLU.h | 2 | ||||
-rw-r--r-- | Eigen/src/LU/PartialPivLU.h | 2 | ||||
-rw-r--r-- | Eigen/src/QR/ColPivHouseholderQR.h | 2 | ||||
-rw-r--r-- | Eigen/src/QR/FullPivHouseholderQR.h | 2 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseDiagonalProduct.h | 6 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseExpressionMaker.h | 6 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseMatrixBase.h | 11 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseNestByValue.h | 84 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseUtil.h | 3 |
12 files changed, 11 insertions, 128 deletions
diff --git a/Eigen/Sparse b/Eigen/Sparse index 96bd61419..a319405e6 100644 --- a/Eigen/Sparse +++ b/Eigen/Sparse @@ -84,7 +84,6 @@ namespace Eigen { #include "src/Sparse/SparseUtil.h" #include "src/Sparse/SparseMatrixBase.h" -#include "src/Sparse/SparseNestByValue.h" #include "src/Sparse/CompressedStorage.h" #include "src/Sparse/AmbiVector.h" #include "src/Sparse/RandomSetter.h" diff --git a/Eigen/src/Core/ExpressionMaker.h b/Eigen/src/Core/ExpressionMaker.h index 1d265b63c..7e2b81d4a 100644 --- a/Eigen/src/Core/ExpressionMaker.h +++ b/Eigen/src/Core/ExpressionMaker.h @@ -37,12 +37,6 @@ template<typename XprType> struct ei_shape_of // matrix. Unless we change the overall design, here is a workaround. // There is an example in unsuported/Eigen/src/AutoDiff/AutoDiffScalar. -template<typename XprType, int Shape = ei_shape_of<XprType>::ret> -struct MakeNestByValue -{ - typedef NestByValue<XprType> Type; -}; - template<typename Func, typename XprType, int Shape = ei_shape_of<XprType>::ret> struct MakeCwiseUnaryOp { diff --git a/Eigen/src/Core/util/BlasUtil.h b/Eigen/src/Core/util/BlasUtil.h index 94154108c..a012a6e12 100644 --- a/Eigen/src/Core/util/BlasUtil.h +++ b/Eigen/src/Core/util/BlasUtil.h @@ -214,20 +214,6 @@ struct ei_blas_traits<CwiseUnaryOp<ei_scalar_opposite_op<Scalar>, NestedXpr> > { return - Base::extractScalarFactor(x._expression()); } }; -// pop NestByValue -template<typename NestedXpr> -struct ei_blas_traits<NestByValue<NestedXpr> > - : ei_blas_traits<NestedXpr> -{ - typedef typename NestedXpr::Scalar Scalar; - typedef ei_blas_traits<NestedXpr> Base; - typedef NestByValue<NestedXpr> XprType; - typedef typename Base::ExtractType ExtractType; - static inline ExtractType extract(const XprType& x) { return Base::extract(static_cast<const NestedXpr&>(x)); } - static inline Scalar extractScalarFactor(const XprType& x) - { return Base::extractScalarFactor(static_cast<const NestedXpr&>(x)); } -}; - // pop/push transpose template<typename NestedXpr> struct ei_blas_traits<Transpose<NestedXpr> > diff --git a/Eigen/src/LU/FullPivLU.h b/Eigen/src/LU/FullPivLU.h index 8d18e65f7..974106509 100644 --- a/Eigen/src/LU/FullPivLU.h +++ b/Eigen/src/LU/FullPivLU.h @@ -356,7 +356,7 @@ template<typename _MatrixType> class FullPivLU ei_assert(m_isInitialized && "LU is not initialized."); ei_assert(m_lu.rows() == m_lu.cols() && "You can't take the inverse of a non-square matrix!"); return ei_solve_retval<FullPivLU,typename MatrixType::IdentityReturnType> - (*this, MatrixType::Identity(m_lu.rows(), m_lu.cols()).nestByValue()); + (*this, MatrixType::Identity(m_lu.rows(), m_lu.cols())); } inline int rows() const { return m_lu.rows(); } diff --git a/Eigen/src/LU/PartialPivLU.h b/Eigen/src/LU/PartialPivLU.h index 84bc165df..577daa345 100644 --- a/Eigen/src/LU/PartialPivLU.h +++ b/Eigen/src/LU/PartialPivLU.h @@ -147,7 +147,7 @@ template<typename _MatrixType> class PartialPivLU { ei_assert(m_isInitialized && "PartialPivLU is not initialized."); return ei_solve_retval<PartialPivLU,typename MatrixType::IdentityReturnType> - (*this, MatrixType::Identity(m_lu.rows(), m_lu.cols()).nestByValue()); + (*this, MatrixType::Identity(m_lu.rows(), m_lu.cols())); } /** \returns the determinant of the matrix of which diff --git a/Eigen/src/QR/ColPivHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h index 614aa0295..c4fc34f93 100644 --- a/Eigen/src/QR/ColPivHouseholderQR.h +++ b/Eigen/src/QR/ColPivHouseholderQR.h @@ -219,7 +219,7 @@ template<typename _MatrixType> class ColPivHouseholderQR { ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return ei_solve_retval<ColPivHouseholderQR,typename MatrixType::IdentityReturnType> - (*this, MatrixType::Identity(m_qr.rows(), m_qr.cols()).nestByValue()); + (*this, MatrixType::Identity(m_qr.rows(), m_qr.cols())); } inline int rows() const { return m_qr.rows(); } diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h index db57ba088..ae4e4aa4d 100644 --- a/Eigen/src/QR/FullPivHouseholderQR.h +++ b/Eigen/src/QR/FullPivHouseholderQR.h @@ -221,7 +221,7 @@ template<typename _MatrixType> class FullPivHouseholderQR { ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return ei_solve_retval<FullPivHouseholderQR,typename MatrixType::IdentityReturnType> - (*this, MatrixType::Identity(m_qr.rows(), m_qr.cols()).nestByValue()); + (*this, MatrixType::Identity(m_qr.rows(), m_qr.cols())); } inline int rows() const { return m_qr.rows(); } diff --git a/Eigen/src/Sparse/SparseDiagonalProduct.h b/Eigen/src/Sparse/SparseDiagonalProduct.h index f12ccb929..e9ba47f70 100644 --- a/Eigen/src/Sparse/SparseDiagonalProduct.h +++ b/Eigen/src/Sparse/SparseDiagonalProduct.h @@ -154,16 +154,16 @@ class ei_sparse_diagonal_product_inner_iterator_selector : public SparseCwiseBinaryOp< ei_scalar_product_op<typename Rhs::Scalar>, SparseInnerVectorSet<Lhs,1>, - NestByValue<Transpose<typename Rhs::DiagonalVectorType> > >::InnerIterator + Transpose<typename Rhs::DiagonalVectorType> >::InnerIterator { typedef typename SparseCwiseBinaryOp< ei_scalar_product_op<typename Rhs::Scalar>, SparseInnerVectorSet<Lhs,1>, - NestByValue<Transpose<typename Rhs::DiagonalVectorType> > >::InnerIterator Base; + Transpose<typename Rhs::DiagonalVectorType> >::InnerIterator Base; public: inline ei_sparse_diagonal_product_inner_iterator_selector( const SparseDiagonalProductType& expr, int outer) - : Base(expr.lhs().innerVector(outer) .cwise()* expr.rhs().diagonal().transpose().nestByValue(), 0) + : Base(expr.lhs().innerVector(outer) .cwise()* expr.rhs().diagonal().transpose(), 0) {} }; diff --git a/Eigen/src/Sparse/SparseExpressionMaker.h b/Eigen/src/Sparse/SparseExpressionMaker.h index 1fdcbb1f2..8e31d55ef 100644 --- a/Eigen/src/Sparse/SparseExpressionMaker.h +++ b/Eigen/src/Sparse/SparseExpressionMaker.h @@ -25,12 +25,6 @@ #ifndef EIGEN_SPARSE_EXPRESSIONMAKER_H #define EIGEN_SPARSE_EXPRESSIONMAKER_H -template<typename XprType> -struct MakeNestByValue<XprType,IsSparse> -{ - typedef SparseNestByValue<XprType> Type; -}; - template<typename Func, typename XprType> struct MakeCwiseUnaryOp<Func,XprType,IsSparse> { diff --git a/Eigen/src/Sparse/SparseMatrixBase.h b/Eigen/src/Sparse/SparseMatrixBase.h index 2fd314708..cbbaf6b8b 100644 --- a/Eigen/src/Sparse/SparseMatrixBase.h +++ b/Eigen/src/Sparse/SparseMatrixBase.h @@ -100,7 +100,7 @@ template<typename Derived> class SparseMatrixBase : public AnyMatrixBase<Derived typedef SparseCwiseUnaryOp<ei_scalar_imag_op<Scalar>, Derived> ImagReturnType; /** \internal the return type of MatrixBase::adjoint() */ typedef typename ei_meta_if<NumTraits<Scalar>::IsComplex, - SparseCwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, SparseNestByValue<Eigen::SparseTranspose<Derived> > >, + SparseCwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::SparseTranspose<Derived> >, SparseTranspose<Derived> >::ret AdjointReturnType; @@ -356,7 +356,7 @@ template<typename Derived> class SparseMatrixBase : public AnyMatrixBase<Derived SparseTranspose<Derived> transpose() { return derived(); } const SparseTranspose<Derived> transpose() const { return derived(); } // void transposeInPlace(); - const AdjointReturnType adjoint() const { return transpose().nestByValue(); } + const AdjointReturnType adjoint() const { return transpose(); } // sub-vector SparseInnerVectorSet<Derived,1> row(int i); @@ -528,9 +528,6 @@ template<typename Derived> class SparseMatrixBase : public AnyMatrixBase<Derived */ // inline int stride(void) const { return derived().stride(); } - inline const SparseNestByValue<Derived> nestByValue() const; - - ConjugateReturnType conjugate() const; const RealReturnType real() const; const ImagReturnType imag() const; @@ -583,11 +580,11 @@ template<typename Derived> class SparseMatrixBase : public AnyMatrixBase<Derived const MatrixBase<ElseDerived>& elseMatrix) const; template<typename ThenDerived> - inline const Select<Derived,ThenDerived, NestByValue<typename ThenDerived::ConstantReturnType> > + inline const Select<Derived,ThenDerived, typename ThenDerived::ConstantReturnType> select(const MatrixBase<ThenDerived>& thenMatrix, typename ThenDerived::Scalar elseScalar) const; template<typename ElseDerived> - inline const Select<Derived, NestByValue<typename ElseDerived::ConstantReturnType>, ElseDerived > + inline const Select<Derived, typename ElseDerived::ConstantReturnType, ElseDerived > select(typename ElseDerived::Scalar thenScalar, const MatrixBase<ElseDerived>& elseMatrix) const; template<int p> RealScalar lpNorm() const; diff --git a/Eigen/src/Sparse/SparseNestByValue.h b/Eigen/src/Sparse/SparseNestByValue.h deleted file mode 100644 index b48277232..000000000 --- a/Eigen/src/Sparse/SparseNestByValue.h +++ /dev/null @@ -1,84 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2009 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 -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 3 of the License, or (at your option) any later version. -// -// Alternatively, you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and a copy of the GNU General Public License along with -// Eigen. If not, see <http://www.gnu.org/licenses/>. - -#ifndef EIGEN_SPARSENESTBYVALUE_H -#define EIGEN_SPARSENESTBYVALUE_H - -/** \class SparseNestByValue - * - * \brief Expression which must be nested by value - * - * \param ExpressionType the type of the object of which we are requiring nesting-by-value - * - * This class is the return type of MatrixBase::nestByValue() - * and most of the time this is the only way it is used. - * - * \sa SparseMatrixBase::nestByValue(), class NestByValue - */ -template<typename ExpressionType> -struct ei_traits<SparseNestByValue<ExpressionType> > : public ei_traits<ExpressionType> -{}; - -template<typename ExpressionType> class SparseNestByValue - : public SparseMatrixBase<SparseNestByValue<ExpressionType> > -{ - public: - - typedef typename ExpressionType::InnerIterator InnerIterator; - - EIGEN_SPARSE_GENERIC_PUBLIC_INTERFACE(SparseNestByValue) - - inline SparseNestByValue(const ExpressionType& matrix) : m_expression(matrix) {} - - EIGEN_STRONG_INLINE int rows() const { return m_expression.rows(); } - EIGEN_STRONG_INLINE int cols() const { return m_expression.cols(); } - - operator const ExpressionType&() const { return m_expression; } - - protected: - const ExpressionType m_expression; -}; - -/** \returns an expression of the temporary version of *this. - */ -template<typename Derived> -inline const SparseNestByValue<Derived> -SparseMatrixBase<Derived>::nestByValue() const -{ - return SparseNestByValue<Derived>(derived()); -} - -// template<typename MatrixType> -// class SparseNestByValue<MatrixType>::InnerIterator : public MatrixType::InnerIterator -// { -// typedef typename MatrixType::InnerIterator Base; -// public: -// -// EIGEN_STRONG_INLINE InnerIterator(const SparseNestByValue& expr, int outer) -// : Base(expr.m_expression, outer) -// {} -// }; - -#endif // EIGEN_SPARSENESTBYVALUE_H diff --git a/Eigen/src/Sparse/SparseUtil.h b/Eigen/src/Sparse/SparseUtil.h index b5fc7c7b7..52781aa46 100644 --- a/Eigen/src/Sparse/SparseUtil.h +++ b/Eigen/src/Sparse/SparseUtil.h @@ -106,7 +106,6 @@ template<typename _Scalar, int _Flags = 0> class DynamicSparseMatrix; template<typename _Scalar, int _Flags = 0> class SparseVector; template<typename _Scalar, int _Flags = 0> class MappedSparseMatrix; -template<typename MatrixType> class SparseNestByValue; template<typename MatrixType> class SparseTranspose; template<typename MatrixType, int Size> class SparseInnerVectorSet; template<typename Derived> class SparseCwise; @@ -147,6 +146,4 @@ template<typename T> class ei_eval<T,IsSparse> typedef SparseMatrix<_Scalar, _Flags> type; }; -template<typename T> struct ei_must_nest_by_value<SparseNestByValue<T> > { enum { ret = true }; }; - #endif // EIGEN_SPARSEUTIL_H |