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 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::ret> -struct MakeNestByValue -{ - typedef NestByValue Type; -}; - template::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, NestedXpr> > { return - Base::extractScalarFactor(x._expression()); } }; -// pop NestByValue -template -struct ei_blas_traits > - : ei_blas_traits -{ - typedef typename NestedXpr::Scalar Scalar; - typedef ei_blas_traits Base; - typedef NestByValue XprType; - typedef typename Base::ExtractType ExtractType; - static inline ExtractType extract(const XprType& x) { return Base::extract(static_cast(x)); } - static inline Scalar extractScalarFactor(const XprType& x) - { return Base::extractScalarFactor(static_cast(x)); } -}; - // pop/push transpose template struct ei_blas_traits > 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 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 - (*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 class PartialPivLU { ei_assert(m_isInitialized && "PartialPivLU is not initialized."); return ei_solve_retval - (*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 class ColPivHouseholderQR { ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return ei_solve_retval - (*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 class FullPivHouseholderQR { ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return ei_solve_retval - (*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, SparseInnerVectorSet, - NestByValue > >::InnerIterator + Transpose >::InnerIterator { typedef typename SparseCwiseBinaryOp< ei_scalar_product_op, SparseInnerVectorSet, - NestByValue > >::InnerIterator Base; + Transpose >::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 -struct MakeNestByValue -{ - typedef SparseNestByValue Type; -}; - template struct MakeCwiseUnaryOp { 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 class SparseMatrixBase : public AnyMatrixBase, Derived> ImagReturnType; /** \internal the return type of MatrixBase::adjoint() */ typedef typename ei_meta_if::IsComplex, - SparseCwiseUnaryOp, SparseNestByValue > >, + SparseCwiseUnaryOp, Eigen::SparseTranspose >, SparseTranspose >::ret AdjointReturnType; @@ -356,7 +356,7 @@ template class SparseMatrixBase : public AnyMatrixBase transpose() { return derived(); } const SparseTranspose transpose() const { return derived(); } // void transposeInPlace(); - const AdjointReturnType adjoint() const { return transpose().nestByValue(); } + const AdjointReturnType adjoint() const { return transpose(); } // sub-vector SparseInnerVectorSet row(int i); @@ -528,9 +528,6 @@ template class SparseMatrixBase : public AnyMatrixBase nestByValue() const; - - ConjugateReturnType conjugate() const; const RealReturnType real() const; const ImagReturnType imag() const; @@ -583,11 +580,11 @@ template class SparseMatrixBase : public AnyMatrixBase& elseMatrix) const; template - inline const Select > + inline const Select select(const MatrixBase& thenMatrix, typename ThenDerived::Scalar elseScalar) const; template - inline const Select, ElseDerived > + inline const Select select(typename ElseDerived::Scalar thenScalar, const MatrixBase& elseMatrix) const; template 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 -// Copyright (C) 2006-2008 Benoit Jacob -// -// 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 . - -#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 -struct ei_traits > : public ei_traits -{}; - -template class SparseNestByValue - : public SparseMatrixBase > -{ - 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 -inline const SparseNestByValue -SparseMatrixBase::nestByValue() const -{ - return SparseNestByValue(derived()); -} - -// template -// class SparseNestByValue::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 class DynamicSparseMatrix; template class SparseVector; template class MappedSparseMatrix; -template class SparseNestByValue; template class SparseTranspose; template class SparseInnerVectorSet; template class SparseCwise; @@ -147,6 +146,4 @@ template class ei_eval typedef SparseMatrix<_Scalar, _Flags> type; }; -template struct ei_must_nest_by_value > { enum { ret = true }; }; - #endif // EIGEN_SPARSEUTIL_H diff --git a/blas/common.h b/blas/common.h index 4be530da2..e7bfda570 100644 --- a/blas/common.h +++ b/blas/common.h @@ -79,14 +79,14 @@ template Block >, Dynamic, Dynamic> matrix(T* data, int rows, int cols, int stride) { - return Map >(data, stride, cols).nestByValue().block(0,0,rows,cols); + return Map >(data, stride, cols).block(0,0,rows,cols); } template Block >, Dynamic, 1> vector(T* data, int size, int incr) { - return Map >(data, size, incr).nestByValue().col(0); + return Map >(data, size, incr).col(0); } template diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index c4607c2b8..795dd6b4d 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -212,33 +212,33 @@ class AutoDiffScalar template inline const AutoDiffScalar, - typename MakeNestByValue, - typename MakeNestByValue, DerType>::Type>::Type, - typename MakeNestByValue, typename ei_cleantype::type>::Type>::Type >::Type >::Type >::Type > + typename MakeCwiseBinaryOp, + typename MakeCwiseUnaryOp, DerType>::Type, + typename MakeCwiseUnaryOp, typename ei_cleantype::type>::Type>::Type >::Type > operator/(const AutoDiffScalar& other) const { ei_make_coherent(m_derivatives, other.derivatives()); return AutoDiffScalar, - typename MakeNestByValue, - typename MakeNestByValue, DerType>::Type>::Type, - typename MakeNestByValue, typename ei_cleantype::type>::Type>::Type >::Type >::Type >::Type >( + typename MakeCwiseBinaryOp, + typename MakeCwiseUnaryOp, DerType>::Type, + typename MakeCwiseUnaryOp, typename ei_cleantype::type>::Type>::Type >::Type >( m_value / other.value(), - ((m_derivatives * other.value()).nestByValue() - (m_value * other.derivatives()).nestByValue()).nestByValue() + ((m_derivatives * other.value()) - (m_value * other.derivatives())) * (Scalar(1)/(other.value()*other.value()))); } template inline const AutoDiffScalar, - typename MakeNestByValue, DerType>::Type>::Type, - typename MakeNestByValue, typename ei_cleantype::type>::Type>::Type >::Type > + typename MakeCwiseUnaryOp, DerType>::Type, + typename MakeCwiseUnaryOp, typename ei_cleantype::type>::Type>::Type > operator*(const AutoDiffScalar& other) const { ei_make_coherent(m_derivatives, other.derivatives()); return AutoDiffScalar, - typename MakeNestByValue, DerType>::Type>::Type, - typename MakeNestByValue, typename ei_cleantype::type>::Type>::Type >::Type >( + typename MakeCwiseUnaryOp, DerType>::Type, + typename MakeCwiseUnaryOp, typename ei_cleantype::type>::Type>::Type >( m_value * other.value(), - (m_derivatives * other.value()).nestByValue() + (m_value * other.derivatives()).nestByValue()); + (m_derivatives * other.value()) + (m_value * other.derivatives())); } inline AutoDiffScalar& operator*=(const Scalar& other) diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h b/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h index 03c82b7e8..c0765d494 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h @@ -196,17 +196,17 @@ class AutoDiffVector // inline const AutoDiffVector< // CwiseBinaryOp, ValueType, OtherValueType> // CwiseBinaryOp, -// NestByValue, JacobianType> >, -// NestByValue, OtherJacobianType> > > > +// CwiseUnaryOp, JacobianType>, +// CwiseUnaryOp, OtherJacobianType> > > // operator*(const AutoDiffVector& other) const // { // return AutoDiffVector< // CwiseBinaryOp, ValueType, OtherValueType> // CwiseBinaryOp, -// NestByValue, JacobianType> >, -// NestByValue, OtherJacobianType> > > >( +// CwiseUnaryOp, JacobianType>, +// CwiseUnaryOp, OtherJacobianType> > >( // m_values.cwise() * other.values(), -// (m_jacobian * other.values()).nestByValue() + (m_values * other.jacobian()).nestByValue()); +// (m_jacobian * other.values()) + (m_values * other.jacobian())); // } inline AutoDiffVector& operator*=(const Scalar& other)