aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2009-12-02 11:08:44 +0100
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2009-12-02 11:08:44 +0100
commit84551d067ea37be1db1eddb2a89fbc5a2e8d04e7 (patch)
tree7233d77973e6450ed65c9ecd98adfd13186982b0 /Eigen
parentc05ae35441fc45ea7fd738a62657a1fb0cb097d2 (diff)
parent95861fbd6cbf9ec6634f2903d06f7ff5320a4f2a (diff)
merge
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/Sparse1
-rw-r--r--Eigen/src/Array/Select.h8
-rw-r--r--Eigen/src/Array/VectorwiseOp.h14
-rw-r--r--Eigen/src/Cholesky/LLT.h8
-rw-r--r--Eigen/src/Core/BandMatrix.h2
-rw-r--r--Eigen/src/Core/Cwise.h2
-rw-r--r--Eigen/src/Core/ExpressionMaker.h6
-rw-r--r--Eigen/src/Core/MatrixBase.h15
-rw-r--r--Eigen/src/Core/ProductBase.h8
-rw-r--r--Eigen/src/Core/Transpose.h14
-rw-r--r--Eigen/src/Core/TriangularMatrix.h16
-rw-r--r--Eigen/src/Core/util/BlasUtil.h14
-rw-r--r--Eigen/src/Core/util/XprHelper.h42
-rw-r--r--Eigen/src/Eigenvalues/HessenbergDecomposition.h6
-rw-r--r--Eigen/src/Eigenvalues/Tridiagonalization.h13
-rw-r--r--Eigen/src/Geometry/Homogeneous.h11
-rw-r--r--Eigen/src/Geometry/Transform.h2
-rw-r--r--Eigen/src/Householder/HouseholderSequence.h2
-rw-r--r--Eigen/src/LU/FullPivLU.h6
-rw-r--r--Eigen/src/LU/PartialPivLU.h6
-rw-r--r--Eigen/src/QR/ColPivHouseholderQR.h6
-rw-r--r--Eigen/src/QR/FullPivHouseholderQR.h6
-rw-r--r--Eigen/src/Sparse/DynamicSparseMatrix.h7
-rw-r--r--Eigen/src/Sparse/SparseCwise.h2
-rw-r--r--Eigen/src/Sparse/SparseDiagonalProduct.h9
-rw-r--r--Eigen/src/Sparse/SparseExpressionMaker.h6
-rw-r--r--Eigen/src/Sparse/SparseMatrix.h7
-rw-r--r--Eigen/src/Sparse/SparseMatrixBase.h11
-rw-r--r--Eigen/src/Sparse/SparseNestByValue.h84
-rw-r--r--Eigen/src/Sparse/SparseUtil.h3
-rw-r--r--Eigen/src/Sparse/SparseVector.h7
31 files changed, 130 insertions, 214 deletions
diff --git a/Eigen/Sparse b/Eigen/Sparse
index b22698e7c..35e252d01 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/Array/Select.h b/Eigen/src/Array/Select.h
index 46c4a22ec..bc55147fd 100644
--- a/Eigen/src/Array/Select.h
+++ b/Eigen/src/Array/Select.h
@@ -131,11 +131,11 @@ MatrixBase<Derived>::select(const MatrixBase<ThenDerived>& thenMatrix,
*/
template<typename Derived>
template<typename ThenDerived>
-inline const Select<Derived,ThenDerived, NestByValue<typename ThenDerived::ConstantReturnType> >
+inline const Select<Derived,ThenDerived, typename ThenDerived::ConstantReturnType>
MatrixBase<Derived>::select(const MatrixBase<ThenDerived>& thenMatrix,
typename ThenDerived::Scalar elseScalar) const
{
- return Select<Derived,ThenDerived,NestByValue<typename ThenDerived::ConstantReturnType> >(
+ return Select<Derived,ThenDerived,typename ThenDerived::ConstantReturnType>(
derived(), thenMatrix.derived(), ThenDerived::Constant(rows(),cols(),elseScalar));
}
@@ -148,11 +148,11 @@ MatrixBase<Derived>::select(const MatrixBase<ThenDerived>& thenMatrix,
*/
template<typename Derived>
template<typename ElseDerived>
-inline const Select<Derived, NestByValue<typename ElseDerived::ConstantReturnType>, ElseDerived >
+inline const Select<Derived, typename ElseDerived::ConstantReturnType, ElseDerived >
MatrixBase<Derived>::select(typename ElseDerived::Scalar thenScalar,
const MatrixBase<ElseDerived>& elseMatrix) const
{
- return Select<Derived,NestByValue<typename ElseDerived::ConstantReturnType>,ElseDerived>(
+ return Select<Derived,typename ElseDerived::ConstantReturnType,ElseDerived>(
derived(), ElseDerived::Constant(rows(),cols(),thenScalar), elseMatrix.derived());
}
diff --git a/Eigen/src/Array/VectorwiseOp.h b/Eigen/src/Array/VectorwiseOp.h
index 7193e6f68..71b83eaad 100644
--- a/Eigen/src/Array/VectorwiseOp.h
+++ b/Eigen/src/Array/VectorwiseOp.h
@@ -436,22 +436,22 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
template<typename OtherDerived>
CwiseBinaryOp<ei_scalar_sum_op<Scalar>,
ExpressionType,
- NestByValue<typename ExtendedType<OtherDerived>::Type> >
+ typename ExtendedType<OtherDerived>::Type>
operator+(const MatrixBase<OtherDerived>& other) const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived);
- return m_matrix + extendedTo(other).nestByValue();
+ return m_matrix + extendedTo(other);
}
/** Returns the expression of the difference between each subvector of \c *this and the vector \a other */
template<typename OtherDerived>
CwiseBinaryOp<ei_scalar_difference_op<Scalar>,
ExpressionType,
- NestByValue<typename ExtendedType<OtherDerived>::Type> >
+ typename ExtendedType<OtherDerived>::Type>
operator-(const MatrixBase<OtherDerived>& other) const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived);
- return m_matrix - extendedTo(other).nestByValue();
+ return m_matrix - extendedTo(other);
}
/////////// Geometry module ///////////
@@ -478,10 +478,10 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
Direction==Horizontal ? 1 : int(ei_traits<ExpressionType>::ColsAtCompileTime)>
HNormalized_Factors;
typedef CwiseBinaryOp<ei_scalar_quotient_op<typename ei_traits<ExpressionType>::Scalar>,
- NestByValue<HNormalized_Block>,
- NestByValue<Replicate<NestByValue<HNormalized_Factors>,
+ HNormalized_Block,
+ Replicate<HNormalized_Factors,
Direction==Vertical ? HNormalized_SizeMinusOne : 1,
- Direction==Horizontal ? HNormalized_SizeMinusOne : 1> > >
+ Direction==Horizontal ? HNormalized_SizeMinusOne : 1> >
HNormalizedReturnType;
const HNormalizedReturnType hnormalized() const;
diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h
index a1706e53e..ad737aaeb 100644
--- a/Eigen/src/Cholesky/LLT.h
+++ b/Eigen/src/Cholesky/LLT.h
@@ -224,18 +224,18 @@ template<> struct ei_llt_inplace<UpperTriangular>
template<typename MatrixType> struct LLT_Traits<MatrixType,LowerTriangular>
{
typedef TriangularView<MatrixType, LowerTriangular> MatrixL;
- typedef TriangularView<NestByValue<typename MatrixType::AdjointReturnType>, UpperTriangular> MatrixU;
+ typedef TriangularView<typename MatrixType::AdjointReturnType, UpperTriangular> MatrixU;
inline static MatrixL getL(const MatrixType& m) { return m; }
- inline static MatrixU getU(const MatrixType& m) { return m.adjoint().nestByValue(); }
+ inline static MatrixU getU(const MatrixType& m) { return m.adjoint(); }
static bool inplace_decomposition(MatrixType& m)
{ return ei_llt_inplace<LowerTriangular>::blocked(m); }
};
template<typename MatrixType> struct LLT_Traits<MatrixType,UpperTriangular>
{
- typedef TriangularView<NestByValue<typename MatrixType::AdjointReturnType>, LowerTriangular> MatrixL;
+ typedef TriangularView<typename MatrixType::AdjointReturnType, LowerTriangular> MatrixL;
typedef TriangularView<MatrixType, UpperTriangular> MatrixU;
- inline static MatrixL getL(const MatrixType& m) { return m.adjoint().nestByValue(); }
+ inline static MatrixL getL(const MatrixType& m) { return m.adjoint(); }
inline static MatrixU getU(const MatrixType& m) { return m; }
static bool inplace_decomposition(MatrixType& m)
{ return ei_llt_inplace<UpperTriangular>::blocked(m); }
diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h
index 85bd8dba7..7943e6280 100644
--- a/Eigen/src/Core/BandMatrix.h
+++ b/Eigen/src/Core/BandMatrix.h
@@ -141,7 +141,7 @@ class BandMatrix : public AnyMatrixBase<BandMatrix<_Scalar,Rows,Cols,Supers,Subs
};
typedef Block<DataType,1, DiagonalSize> BuildType;
typedef typename ei_meta_if<Conjugate,
- CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>,NestByValue<BuildType> >,
+ CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>,BuildType >,
BuildType>::ret Type;
};
diff --git a/Eigen/src/Core/Cwise.h b/Eigen/src/Core/Cwise.h
index 4b143325e..80414782e 100644
--- a/Eigen/src/Core/Cwise.h
+++ b/Eigen/src/Core/Cwise.h
@@ -52,7 +52,7 @@
* convenient macro to defined the return type of a cwise comparison to a scalar */
#define EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(OP) \
CwiseBinaryOp<OP<typename ei_traits<ExpressionType>::Scalar>, ExpressionType, \
- NestByValue<typename ExpressionType::ConstantReturnType> >
+ typename ExpressionType::ConstantReturnType >
/** \class Cwise
*
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/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index 9f62ceb8f..03d8d5f55 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -248,7 +248,7 @@ template<typename Derived> class MatrixBase
typedef CwiseUnaryView<ei_scalar_imag_op<Scalar>, Derived> NonConstImagReturnType;
/** \internal the return type of MatrixBase::adjoint() */
typedef typename ei_meta_if<NumTraits<Scalar>::IsComplex,
- CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<Derived> > >,
+ CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<Derived> >,
Transpose<Derived>
>::ret AdjointReturnType;
/** \internal the return type of MatrixBase::eigenvalues() */
@@ -445,11 +445,11 @@ template<typename Derived> class MatrixBase
Derived& lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,DerivedA,Transpose<DerivedB> >& other);
template<typename OtherDerived>
- Derived& lazyAssign(const CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<OtherDerived> > >& other);
+ Derived& lazyAssign(const CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<OtherDerived> >& other);
template<typename DerivedA, typename DerivedB>
- Derived& lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<DerivedA> > >,DerivedB>& other);
+ Derived& lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<DerivedA> >,DerivedB>& other);
template<typename DerivedA, typename DerivedB>
- Derived& lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,DerivedA,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<DerivedB> > > >& other);
+ Derived& lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,DerivedA,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<DerivedB> > >& other);
#endif
RowXpr row(int i);
@@ -622,7 +622,6 @@ template<typename Derived> class MatrixBase
inline const NestByValue<Derived> nestByValue() const;
-
ConjugateReturnType conjugate() const;
RealReturnType real() const;
NonConstRealReturnType real();
@@ -694,11 +693,11 @@ template<typename Derived> class MatrixBase
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;
@@ -766,7 +765,7 @@ template<typename Derived> class MatrixBase
ei_traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
ei_traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> StartMinusOne;
typedef CwiseUnaryOp<ei_scalar_quotient1_op<typename ei_traits<Derived>::Scalar>,
- NestByValue<StartMinusOne> > HNormalizedReturnType;
+ StartMinusOne > HNormalizedReturnType;
const HNormalizedReturnType hnormalized() const;
typedef Homogeneous<Derived,MatrixBase<Derived>::ColsAtCompileTime==1?Vertical:Horizontal> HomogeneousReturnType;
diff --git a/Eigen/src/Core/ProductBase.h b/Eigen/src/Core/ProductBase.h
index 57183ac52..955e87feb 100644
--- a/Eigen/src/Core/ProductBase.h
+++ b/Eigen/src/Core/ProductBase.h
@@ -111,14 +111,6 @@ class ProductBase : public MatrixBase<Derived>
template<typename Dest>
inline void scaleAndAddTo(Dest& dst,Scalar alpha) const { derived().scaleAndAddTo(dst,alpha); }
- PlainMatrixType eval() const
- {
- PlainMatrixType res(rows(), cols());
- res.setZero();
- derived().evalTo(res);
- return res;
- }
-
EIGEN_DEPRECATED const Flagged<ProductBase, 0, EvalBeforeAssigningBit> lazy() const
{ return *this; }
diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h
index 990aa3807..79aef9fa7 100644
--- a/Eigen/src/Core/Transpose.h
+++ b/Eigen/src/Core/Transpose.h
@@ -186,7 +186,7 @@ template<typename Derived>
inline const typename MatrixBase<Derived>::AdjointReturnType
MatrixBase<Derived>::adjoint() const
{
- return transpose().nestByValue();
+ return transpose();
}
/***************************************************************************
@@ -326,31 +326,31 @@ lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,DerivedA,Transpose<Deriv
template<typename Derived>
template<typename OtherDerived> Derived&
MatrixBase<Derived>::
-lazyAssign(const CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<OtherDerived> > >& other)
+lazyAssign(const CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<OtherDerived> >& other)
{
ei_assert(ei_extract_data(other) != ei_extract_data(derived())
&& "aliasing detected during tranposition, please use adjointInPlace()");
- return lazyAssign(static_cast<const MatrixBase<CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<OtherDerived> > > >& >(other));
+ return lazyAssign(static_cast<const MatrixBase<CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<OtherDerived> > >& >(other));
}
template<typename Derived>
template<typename DerivedA, typename DerivedB>
Derived& MatrixBase<Derived>::
-lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<DerivedA> > >,DerivedB>& other)
+lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<DerivedA> >,DerivedB>& other)
{
ei_assert(ei_extract_data(derived()) != ei_extract_data(other.lhs())
&& "aliasing detected during tranposition, please evaluate your expression");
- return lazyAssign(static_cast<const MatrixBase<CwiseBinaryOp<ei_scalar_sum_op<Scalar>,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<DerivedA> > >,DerivedB> >& >(other));
+ return lazyAssign(static_cast<const MatrixBase<CwiseBinaryOp<ei_scalar_sum_op<Scalar>,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<DerivedA> >,DerivedB> >& >(other));
}
template<typename Derived>
template<typename DerivedA, typename DerivedB>
Derived& MatrixBase<Derived>::
-lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,DerivedA,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<DerivedB> > > >& other)
+lazyAssign(const CwiseBinaryOp<ei_scalar_sum_op<Scalar>,DerivedA,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<DerivedB> > >& other)
{
ei_assert(ei_extract_data(derived()) != ei_extract_data(other.rhs())
&& "aliasing detected during tranposition, please evaluate your expression");
- return lazyAssign(static_cast<const MatrixBase<CwiseBinaryOp<ei_scalar_sum_op<Scalar>,DerivedA,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, NestByValue<Eigen::Transpose<DerivedB> > > > >& >(other));
+ return lazyAssign(static_cast<const MatrixBase<CwiseBinaryOp<ei_scalar_sum_op<Scalar>,DerivedA,CwiseUnaryOp<ei_scalar_conjugate_op<Scalar>, Eigen::Transpose<DerivedB> > > >& >(other));
}
#endif
diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h
index e5d7367d8..aaf781d1f 100644
--- a/Eigen/src/Core/TriangularMatrix.h
+++ b/Eigen/src/Core/TriangularMatrix.h
@@ -222,18 +222,18 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
/** \sa MatrixBase::adjoint() */
- inline TriangularView<NestByValue<typename MatrixType::AdjointReturnType>,TransposeMode> adjoint()
- { return m_matrix.adjoint().nestByValue(); }
+ inline TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> adjoint()
+ { return m_matrix.adjoint(); }
/** \sa MatrixBase::adjoint() const */
- inline const TriangularView<NestByValue<typename MatrixType::AdjointReturnType>,TransposeMode> adjoint() const
- { return m_matrix.adjoint().nestByValue(); }
+ inline const TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> adjoint() const
+ { return m_matrix.adjoint(); }
/** \sa MatrixBase::transpose() */
- inline TriangularView<NestByValue<Transpose<MatrixType> >,TransposeMode> transpose()
- { return m_matrix.transpose().nestByValue(); }
+ inline TriangularView<Transpose<MatrixType>,TransposeMode> transpose()
+ { return m_matrix.transpose(); }
/** \sa MatrixBase::transpose() const */
- inline const TriangularView<NestByValue<Transpose<MatrixType> >,TransposeMode> transpose() const
- { return m_matrix.transpose().nestByValue(); }
+ inline const TriangularView<Transpose<MatrixType>,TransposeMode> transpose() const
+ { return m_matrix.transpose(); }
DenseMatrixType toDenseMatrix() const
{
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/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h
index be4266f85..659b3d7d1 100644
--- a/Eigen/src/Core/util/XprHelper.h
+++ b/Eigen/src/Core/util/XprHelper.h
@@ -168,8 +168,35 @@ template<typename T> struct ei_plain_matrix_type_row_major
> type;
};
+// we should be able to get rid of this one too
template<typename T> struct ei_must_nest_by_value { enum { ret = false }; };
-template<typename T> struct ei_must_nest_by_value<NestByValue<T> > { enum { ret = true }; };
+
+/**
+* The reference selector for template expressions. The idea is that we don't
+* need to use references for expressions since they are light weight proxy
+* objects which should generate no copying overhead.
+**/
+template <typename T>
+struct ei_ref_selector
+{
+ typedef T type;
+};
+
+/**
+* Matrices on the other hand side should only be copied, when it is sure
+* we gain by copying (see arithmetic cost check and eval before nesting flag).
+* Note: This is an optimization measure that comprises potential (though little)
+* to create erroneous code. Any user, utilizing ei_nested outside of
+* Eigen needs to take care that no references to temporaries are
+* stored or that this potential danger is at least communicated
+* to the user.
+**/
+template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
+struct ei_ref_selector< Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
+{
+ typedef Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> MatrixType;
+ typedef MatrixType const& type;
+};
/** \internal Determines how a given expression should be nested into another one.
* For example, when you do a * (b+c), Eigen will determine how the expression b+c should be
@@ -195,15 +222,12 @@ template<typename T, int n=1, typename PlainMatrixType = typename ei_eval<T>::ty
CostEval = (n+1) * int(NumTraits<typename ei_traits<T>::Scalar>::ReadCost),
CostNoEval = (n-1) * int(ei_traits<T>::CoeffReadCost)
};
+
typedef typename ei_meta_if<
- ei_must_nest_by_value<T>::ret,
- T,
- typename ei_meta_if<
- (int(ei_traits<T>::Flags) & EvalBeforeNestingBit)
- || ( int(CostEval) <= int(CostNoEval) ),
+ ( int(ei_traits<T>::Flags) & EvalBeforeNestingBit ) ||
+ ( int(CostEval) <= int(CostNoEval) ),
PlainMatrixType,
- const T&
- >::ret
+ typename ei_ref_selector<T>::type
>::ret type;
};
@@ -256,7 +280,7 @@ template<typename ExpressionType> struct HNormalizedReturnType {
ei_traits<ExpressionType>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
ei_traits<ExpressionType>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> StartMinusOne;
typedef CwiseUnaryOp<ei_scalar_quotient1_op<typename ei_traits<ExpressionType>::Scalar>,
- NestByValue<StartMinusOne> > Type;
+ StartMinusOne > Type;
};
template<typename XprType, typename CastType> struct ei_cast_return_type
diff --git a/Eigen/src/Eigenvalues/HessenbergDecomposition.h b/Eigen/src/Eigenvalues/HessenbergDecomposition.h
index cce76b288..9f7df49bc 100644
--- a/Eigen/src/Eigenvalues/HessenbergDecomposition.h
+++ b/Eigen/src/Eigenvalues/HessenbergDecomposition.h
@@ -58,10 +58,10 @@ template<typename _MatrixType> class HessenbergDecomposition
typedef Matrix<RealScalar, Size, 1> DiagonalType;
typedef Matrix<RealScalar, SizeMinusOne, 1> SubDiagonalType;
- typedef typename NestByValue<Diagonal<MatrixType,0> >::RealReturnType DiagonalReturnType;
+ typedef typename Diagonal<MatrixType,0>::RealReturnType DiagonalReturnType;
- typedef typename NestByValue<Diagonal<
- NestByValue<Block<MatrixType,SizeMinusOne,SizeMinusOne> >,0 > >::RealReturnType SubDiagonalReturnType;
+ typedef typename Diagonal<
+ Block<MatrixType,SizeMinusOne,SizeMinusOne>,0 >::RealReturnType SubDiagonalReturnType;
/** This constructor initializes a HessenbergDecomposition object for
* further use with HessenbergDecomposition::compute()
diff --git a/Eigen/src/Eigenvalues/Tridiagonalization.h b/Eigen/src/Eigenvalues/Tridiagonalization.h
index 04b9f72d7..d8dcfb047 100644
--- a/Eigen/src/Eigenvalues/Tridiagonalization.h
+++ b/Eigen/src/Eigenvalues/Tridiagonalization.h
@@ -61,15 +61,15 @@ template<typename _MatrixType> class Tridiagonalization
typedef Matrix<RealScalar, SizeMinusOne, 1> SubDiagonalType;
typedef typename ei_meta_if<NumTraits<Scalar>::IsComplex,
- typename NestByValue<Diagonal<MatrixType,0> >::RealReturnType,
+ typename Diagonal<MatrixType,0>::RealReturnType,
Diagonal<MatrixType,0>
>::ret DiagonalReturnType;
typedef typename ei_meta_if<NumTraits<Scalar>::IsComplex,
- typename NestByValue<Diagonal<
- NestByValue<Block<MatrixType,SizeMinusOne,SizeMinusOne> >,0 > >::RealReturnType,
+ typename Diagonal<
+ Block<MatrixType,SizeMinusOne,SizeMinusOne>,0 >::RealReturnType,
Diagonal<
- NestByValue<Block<MatrixType,SizeMinusOne,SizeMinusOne> >,0 >
+ Block<MatrixType,SizeMinusOne,SizeMinusOne>,0 >
>::ret SubDiagonalReturnType;
/** This constructor initializes a Tridiagonalization object for
@@ -144,7 +144,7 @@ template<typename MatrixType>
const typename Tridiagonalization<MatrixType>::DiagonalReturnType
Tridiagonalization<MatrixType>::diagonal(void) const
{
- return m_matrix.diagonal().nestByValue();
+ return m_matrix.diagonal();
}
/** \returns an expression of the sub-diagonal vector */
@@ -153,8 +153,7 @@ const typename Tridiagonalization<MatrixType>::SubDiagonalReturnType
Tridiagonalization<MatrixType>::subDiagonal(void) const
{
int n = m_matrix.rows();
- return Block<MatrixType,SizeMinusOne,SizeMinusOne>(m_matrix, 1, 0, n-1,n-1)
- .nestByValue().diagonal().nestByValue();
+ return Block<MatrixType,SizeMinusOne,SizeMinusOne>(m_matrix, 1, 0, n-1,n-1).diagonal();
}
/** constructs and returns the tridiagonal matrix T.
diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h
index 035d213b7..ffa828f71 100644
--- a/Eigen/src/Geometry/Homogeneous.h
+++ b/Eigen/src/Geometry/Homogeneous.h
@@ -175,7 +175,7 @@ MatrixBase<Derived>::hnormalized() const
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived);
return StartMinusOne(derived(),0,0,
ColsAtCompileTime==1?size()-1:1,
- ColsAtCompileTime==1?1:size()-1).nestByValue() / coeff(size()-1);
+ ColsAtCompileTime==1?1:size()-1) / coeff(size()-1);
}
/** \geometry_module
@@ -192,18 +192,17 @@ VectorwiseOp<ExpressionType,Direction>::hnormalized() const
{
return HNormalized_Block(_expression(),0,0,
Direction==Vertical ? _expression().rows()-1 : _expression().rows(),
- Direction==Horizontal ? _expression().cols()-1 : _expression().cols()).nestByValue()
- .cwise()/
- Replicate<NestByValue<HNormalized_Factors>,
+ Direction==Horizontal ? _expression().cols()-1 : _expression().cols()).cwise()/
+ Replicate<HNormalized_Factors,
Direction==Vertical ? HNormalized_SizeMinusOne : 1,
Direction==Horizontal ? HNormalized_SizeMinusOne : 1>
(HNormalized_Factors(_expression(),
Direction==Vertical ? _expression().rows()-1:0,
Direction==Horizontal ? _expression().cols()-1:0,
Direction==Vertical ? 1 : _expression().rows(),
- Direction==Horizontal ? 1 : _expression().cols()).nestByValue(),
+ Direction==Horizontal ? 1 : _expression().cols()),
Direction==Vertical ? _expression().rows()-1 : 1,
- Direction==Horizontal ? _expression().cols()-1 : 1).nestByValue();
+ Direction==Horizontal ? _expression().cols()-1 : 1);
}
template<typename MatrixType,typename Lhs>
diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h
index d478675bd..363fa9dc4 100644
--- a/Eigen/src/Geometry/Transform.h
+++ b/Eigen/src/Geometry/Transform.h
@@ -187,7 +187,7 @@ public:
/** type of read/write reference to the affine part of the transformation */
typedef typename ei_meta_if<int(Mode)==int(AffineCompact),
MatrixType&,
- NestByValue<Block<MatrixType,Dim,HDim> > >::ret AffinePartNested;
+ Block<MatrixType,Dim,HDim> >::ret AffinePartNested;
/** type of a vector */
typedef Matrix<Scalar,Dim,1> VectorType;
/** type of a read/write reference to the translation part of the rotation */
diff --git a/Eigen/src/Householder/HouseholderSequence.h b/Eigen/src/Householder/HouseholderSequence.h
index 85aa90362..afeb758b3 100644
--- a/Eigen/src/Householder/HouseholderSequence.h
+++ b/Eigen/src/Householder/HouseholderSequence.h
@@ -69,7 +69,7 @@ template<typename VectorsType, typename CoeffsType> class HouseholderSequence
typedef HouseholderSequence<VectorsType,
typename ei_meta_if<NumTraits<Scalar>::IsComplex,
- NestByValue<typename ei_cleantype<typename CoeffsType::ConjugateReturnType>::type >,
+ typename ei_cleantype<typename CoeffsType::ConjugateReturnType>::type,
CoeffsType>::ret> ConjugateReturnType;
HouseholderSequence(const VectorsType& v, const CoeffsType& h, bool trans = false)
diff --git a/Eigen/src/LU/FullPivLU.h b/Eigen/src/LU/FullPivLU.h
index e79e3ad23..1358c9490 100644
--- a/Eigen/src/LU/FullPivLU.h
+++ b/Eigen/src/LU/FullPivLU.h
@@ -352,12 +352,12 @@ template<typename _MatrixType> class FullPivLU
*
* \sa MatrixBase::inverse()
*/
- inline const ei_solve_retval<FullPivLU,NestByValue<typename MatrixType::IdentityReturnType> > inverse() const
+ inline const ei_solve_retval<FullPivLU,typename MatrixType::IdentityReturnType> inverse() const
{
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,NestByValue<typename MatrixType::IdentityReturnType> >
- (*this, MatrixType::Identity(m_lu.rows(), m_lu.cols()).nestByValue());
+ return ei_solve_retval<FullPivLU,typename MatrixType::IdentityReturnType>
+ (*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 975f79287..577daa345 100644
--- a/Eigen/src/LU/PartialPivLU.h
+++ b/Eigen/src/LU/PartialPivLU.h
@@ -143,11 +143,11 @@ template<typename _MatrixType> class PartialPivLU
*
* \sa MatrixBase::inverse(), LU::inverse()
*/
- inline const ei_solve_retval<PartialPivLU,NestByValue<typename MatrixType::IdentityReturnType> > inverse() const
+ inline const ei_solve_retval<PartialPivLU,typename MatrixType::IdentityReturnType> inverse() const
{
ei_assert(m_isInitialized && "PartialPivLU is not initialized.");
- return ei_solve_retval<PartialPivLU,NestByValue<typename MatrixType::IdentityReturnType> >
- (*this, MatrixType::Identity(m_lu.rows(), m_lu.cols()).nestByValue());
+ return ei_solve_retval<PartialPivLU,typename MatrixType::IdentityReturnType>
+ (*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 b6135ac0b..9c1e56dc6 100644
--- a/Eigen/src/QR/ColPivHouseholderQR.h
+++ b/Eigen/src/QR/ColPivHouseholderQR.h
@@ -224,12 +224,12 @@ template<typename _MatrixType> class ColPivHouseholderQR
* Use isInvertible() to first determine whether this matrix is invertible.
*/
inline const
- ei_solve_retval<ColPivHouseholderQR, NestByValue<typename MatrixType::IdentityReturnType> >
+ ei_solve_retval<ColPivHouseholderQR, typename MatrixType::IdentityReturnType>
inverse() const
{
ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized.");
- return ei_solve_retval<ColPivHouseholderQR,NestByValue<typename MatrixType::IdentityReturnType> >
- (*this, MatrixType::Identity(m_qr.rows(), m_qr.cols()).nestByValue());
+ return ei_solve_retval<ColPivHouseholderQR,typename MatrixType::IdentityReturnType>
+ (*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 ac0108046..ae4e4aa4d 100644
--- a/Eigen/src/QR/FullPivHouseholderQR.h
+++ b/Eigen/src/QR/FullPivHouseholderQR.h
@@ -216,12 +216,12 @@ template<typename _MatrixType> class FullPivHouseholderQR
* \note If this matrix is not invertible, the returned matrix has undefined coefficients.
* Use isInvertible() to first determine whether this matrix is invertible.
*/ inline const
- ei_solve_retval<FullPivHouseholderQR, NestByValue<typename MatrixType::IdentityReturnType> >
+ ei_solve_retval<FullPivHouseholderQR, typename MatrixType::IdentityReturnType>
inverse() const
{
ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized.");
- return ei_solve_retval<FullPivHouseholderQR,NestByValue<typename MatrixType::IdentityReturnType> >
- (*this, MatrixType::Identity(m_qr.rows(), m_qr.cols()).nestByValue());
+ return ei_solve_retval<FullPivHouseholderQR,typename MatrixType::IdentityReturnType>
+ (*this, MatrixType::Identity(m_qr.rows(), m_qr.cols()));
}
inline int rows() const { return m_qr.rows(); }
diff --git a/Eigen/src/Sparse/DynamicSparseMatrix.h b/Eigen/src/Sparse/DynamicSparseMatrix.h
index 15135f9db..189a56bd0 100644
--- a/Eigen/src/Sparse/DynamicSparseMatrix.h
+++ b/Eigen/src/Sparse/DynamicSparseMatrix.h
@@ -57,6 +57,13 @@ struct ei_traits<DynamicSparseMatrix<_Scalar, _Flags> >
};
};
+template<typename _Scalar, int _Options>
+struct ei_ref_selector< DynamicSparseMatrix<_Scalar, _Options> >
+{
+ typedef DynamicSparseMatrix<_Scalar, _Options> MatrixType;
+ typedef MatrixType const& type;
+};
+
template<typename _Scalar, int _Flags>
class DynamicSparseMatrix
: public SparseMatrixBase<DynamicSparseMatrix<_Scalar, _Flags> >
diff --git a/Eigen/src/Sparse/SparseCwise.h b/Eigen/src/Sparse/SparseCwise.h
index dd745fe7c..bf8f2355c 100644
--- a/Eigen/src/Sparse/SparseCwise.h
+++ b/Eigen/src/Sparse/SparseCwise.h
@@ -52,7 +52,7 @@
* convenient macro to defined the return type of a cwise comparison to a scalar */
/*#define EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(OP) \
CwiseBinaryOp<OP<typename ei_traits<ExpressionType>::Scalar>, ExpressionType, \
- NestByValue<typename ExpressionType::ConstantReturnType> >*/
+ typename ExpressionType::ConstantReturnType >*/
template<typename ExpressionType> class SparseCwise
{
diff --git a/Eigen/src/Sparse/SparseDiagonalProduct.h b/Eigen/src/Sparse/SparseDiagonalProduct.h
index 5fb149a2c..e9ba47f70 100644
--- a/Eigen/src/Sparse/SparseDiagonalProduct.h
+++ b/Eigen/src/Sparse/SparseDiagonalProduct.h
@@ -85,8 +85,7 @@ class SparseDiagonalProduct
typedef ei_sparse_diagonal_product_inner_iterator_selector
<_LhsNested,_RhsNested,SparseDiagonalProduct,LhsMode,RhsMode> InnerIterator;
- template<typename _Lhs, typename _Rhs>
- EIGEN_STRONG_INLINE SparseDiagonalProduct(const _Lhs& lhs, const _Rhs& rhs)
+ EIGEN_STRONG_INLINE SparseDiagonalProduct(const Lhs& lhs, const Rhs& rhs)
: m_lhs(lhs), m_rhs(rhs)
{
ei_assert(lhs.cols() == rhs.rows() && "invalid sparse matrix * diagonal matrix product");
@@ -155,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/SparseMatrix.h b/Eigen/src/Sparse/SparseMatrix.h
index 7010602b7..36fa123fb 100644
--- a/Eigen/src/Sparse/SparseMatrix.h
+++ b/Eigen/src/Sparse/SparseMatrix.h
@@ -57,6 +57,13 @@ struct ei_traits<SparseMatrix<_Scalar, _Options> >
};
template<typename _Scalar, int _Options>
+struct ei_ref_selector<SparseMatrix<_Scalar, _Options> >
+{
+ typedef SparseMatrix<_Scalar, _Options> MatrixType;
+ typedef MatrixType const& type;
+};
+
+template<typename _Scalar, int _Options>
class SparseMatrix
: public SparseMatrixBase<SparseMatrix<_Scalar, _Options> >
{
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
diff --git a/Eigen/src/Sparse/SparseVector.h b/Eigen/src/Sparse/SparseVector.h
index 8c8728b87..1fa1980b2 100644
--- a/Eigen/src/Sparse/SparseVector.h
+++ b/Eigen/src/Sparse/SparseVector.h
@@ -52,6 +52,13 @@ struct ei_traits<SparseVector<_Scalar, _Options> >
};
template<typename _Scalar, int _Options>
+struct ei_ref_selector< SparseVector<_Scalar, _Options> >
+{
+ typedef SparseVector<_Scalar, _Options> MatrixType;
+ typedef MatrixType const& type;
+};
+
+template<typename _Scalar, int _Options>
class SparseVector
: public SparseMatrixBase<SparseVector<_Scalar, _Options> >
{