Renamed cleantype to remove_all since it is close to remove_{const|pointer|reference}.

This commit is contained in:
Hauke Heibel 2010-10-26 16:47:01 +02:00
parent 2fbb9932b0
commit c738cd56eb
38 changed files with 124 additions and 124 deletions

View File

@ -39,7 +39,7 @@
namespace internal {
template<typename ExpressionType>
struct traits<ArrayWrapper<ExpressionType> >
: public traits<typename cleantype<typename ExpressionType::Nested>::type >
: public traits<typename remove_all<typename ExpressionType::Nested>::type >
{
typedef ArrayXpr XprKind;
};
@ -127,7 +127,7 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
namespace internal {
template<typename ExpressionType>
struct traits<MatrixWrapper<ExpressionType> >
: public traits<typename cleantype<typename ExpressionType::Nested>::type >
: public traits<typename remove_all<typename ExpressionType::Nested>::type >
{
typedef MatrixXpr XprKind;
};

View File

@ -52,7 +52,7 @@ struct traits<CwiseBinaryOp<BinaryOp, Lhs, Rhs> >
{
// we must not inherit from traits<Lhs> since it has
// the potential to cause problems with MSVC
typedef typename cleantype<Lhs>::type Ancestor;
typedef typename remove_all<Lhs>::type Ancestor;
typedef typename traits<Ancestor>::XprKind XprKind;
enum {
RowsAtCompileTime = traits<Ancestor>::RowsAtCompileTime,
@ -146,14 +146,14 @@ class CwiseBinaryOp : internal::no_assignment_operator,
EIGEN_STRONG_INLINE Index rows() const {
// return the fixed size type if available to enable compile time optimizations
if (internal::traits<typename internal::cleantype<LhsNested>::type>::RowsAtCompileTime==Dynamic)
if (internal::traits<typename internal::remove_all<LhsNested>::type>::RowsAtCompileTime==Dynamic)
return m_rhs.rows();
else
return m_lhs.rows();
}
EIGEN_STRONG_INLINE Index cols() const {
// return the fixed size type if available to enable compile time optimizations
if (internal::traits<typename internal::cleantype<LhsNested>::type>::ColsAtCompileTime==Dynamic)
if (internal::traits<typename internal::remove_all<LhsNested>::type>::ColsAtCompileTime==Dynamic)
return m_rhs.cols();
else
return m_lhs.cols();

View File

@ -87,11 +87,11 @@ class CwiseUnaryOp : internal::no_assignment_operator,
const UnaryOp& functor() const { return m_functor; }
/** \returns the nested expression */
const typename internal::cleantype<typename XprType::Nested>::type&
const typename internal::remove_all<typename XprType::Nested>::type&
nestedExpression() const { return m_xpr; }
/** \returns the nested expression */
typename internal::cleantype<typename XprType::Nested>::type&
typename internal::remove_all<typename XprType::Nested>::type&
nestedExpression() { return m_xpr.const_cast_derived(); }
protected:

View File

@ -48,7 +48,7 @@ struct traits<CwiseUnaryView<ViewOp, MatrixType> >
ViewOp(typename traits<MatrixType>::Scalar)
>::type Scalar;
typedef typename MatrixType::Nested MatrixTypeNested;
typedef typename cleantype<MatrixTypeNested>::type _MatrixTypeNested;
typedef typename remove_all<MatrixTypeNested>::type _MatrixTypeNested;
enum {
Flags = (traits<_MatrixTypeNested>::Flags & (HereditaryBits | LvalueBit | LinearAccessBit | DirectAccessBit)),
CoeffReadCost = traits<_MatrixTypeNested>::CoeffReadCost + functor_traits<ViewOp>::Cost,
@ -88,11 +88,11 @@ class CwiseUnaryView : internal::no_assignment_operator,
const ViewOp& functor() const { return m_functor; }
/** \returns the nested expression */
const typename internal::cleantype<typename MatrixType::Nested>::type&
const typename internal::remove_all<typename MatrixType::Nested>::type&
nestedExpression() const { return m_matrix; }
/** \returns the nested expression */
typename internal::cleantype<typename MatrixType::Nested>::type&
typename internal::remove_all<typename MatrixType::Nested>::type&
nestedExpression() { return m_matrix.const_cast_derived(); }
protected:

View File

@ -60,7 +60,7 @@ class NoAlias
typedef SelfCwiseBinaryOp<internal::scalar_sum_op<Scalar>, ExpressionType, OtherDerived> SelfAdder;
SelfAdder tmp(m_expression);
typedef typename internal::nested<OtherDerived>::type OtherDerivedNested;
typedef typename internal::cleantype<OtherDerivedNested>::type _OtherDerivedNested;
typedef typename internal::remove_all<OtherDerivedNested>::type _OtherDerivedNested;
internal::assign_selector<SelfAdder,_OtherDerivedNested,false>::run(tmp,OtherDerivedNested(other.derived()));
return m_expression;
}
@ -72,7 +72,7 @@ class NoAlias
typedef SelfCwiseBinaryOp<internal::scalar_difference_op<Scalar>, ExpressionType, OtherDerived> SelfAdder;
SelfAdder tmp(m_expression);
typedef typename internal::nested<OtherDerived>::type OtherDerivedNested;
typedef typename internal::cleantype<OtherDerivedNested>::type _OtherDerivedNested;
typedef typename internal::remove_all<OtherDerivedNested>::type _OtherDerivedNested;
internal::assign_selector<SelfAdder,_OtherDerivedNested,false>::run(tmp,OtherDerivedNested(other.derived()));
return m_expression;
}

View File

@ -340,7 +340,7 @@ template<typename PermutationType, typename MatrixType, int Side, bool Transpose
struct permut_matrix_product_retval
: public ReturnByValue<permut_matrix_product_retval<PermutationType, MatrixType, Side, Transposed> >
{
typedef typename cleantype<typename MatrixType::Nested>::type MatrixTypeNestedCleaned;
typedef typename remove_all<typename MatrixType::Nested>::type MatrixTypeNestedCleaned;
permut_matrix_product_retval(const PermutationType& perm, const MatrixType& matrix)
: m_permutation(perm), m_matrix(matrix)

View File

@ -59,8 +59,8 @@ template<int Rows, int Cols, int Depth> struct product_type_selector;
template<typename Lhs, typename Rhs> struct product_type
{
typedef typename cleantype<Lhs>::type _Lhs;
typedef typename cleantype<Rhs>::type _Rhs;
typedef typename remove_all<Lhs>::type _Lhs;
typedef typename remove_all<Rhs>::type _Rhs;
enum {
Rows = _Lhs::MaxRowsAtCompileTime,
Cols = _Rhs::MaxColsAtCompileTime,

View File

@ -35,8 +35,8 @@ template<typename Derived, typename _Lhs, typename _Rhs>
struct traits<ProductBase<Derived,_Lhs,_Rhs> >
{
typedef MatrixXpr XprKind;
typedef typename cleantype<_Lhs>::type Lhs;
typedef typename cleantype<_Rhs>::type Rhs;
typedef typename remove_all<_Lhs>::type Lhs;
typedef typename remove_all<_Rhs>::type Rhs;
typedef typename scalar_product_traits<typename Lhs::Scalar, typename Rhs::Scalar>::ReturnType Scalar;
typedef typename promote_storage_type<typename traits<Lhs>::StorageKind,
typename traits<Rhs>::StorageKind>::ret StorageKind;
@ -80,16 +80,16 @@ class ProductBase : public MatrixBase<Derived>
EIGEN_DENSE_PUBLIC_INTERFACE(ProductBase)
protected:
typedef typename Lhs::Nested LhsNested;
typedef typename internal::cleantype<LhsNested>::type _LhsNested;
typedef typename internal::remove_all<LhsNested>::type _LhsNested;
typedef internal::blas_traits<_LhsNested> LhsBlasTraits;
typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType;
typedef typename internal::cleantype<ActualLhsType>::type _ActualLhsType;
typedef typename internal::remove_all<ActualLhsType>::type _ActualLhsType;
typedef typename Rhs::Nested RhsNested;
typedef typename internal::cleantype<RhsNested>::type _RhsNested;
typedef typename internal::remove_all<RhsNested>::type _RhsNested;
typedef internal::blas_traits<_RhsNested> RhsBlasTraits;
typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType;
typedef typename internal::cleantype<ActualRhsType>::type _ActualRhsType;
typedef typename internal::remove_all<ActualRhsType>::type _ActualRhsType;
// Diagonal of a product: no need to evaluate the arguments because they are going to be evaluated only once
typedef CoeffBasedProduct<LhsNested, RhsNested, 0> FullyLazyCoeffBaseProductType;

View File

@ -325,7 +325,7 @@ template<typename Func>
EIGEN_STRONG_INLINE typename internal::result_of<Func(typename internal::traits<Derived>::Scalar)>::type
DenseBase<Derived>::redux(const Func& func) const
{
typedef typename internal::cleantype<typename Derived::Nested>::type ThisNested;
typedef typename internal::remove_all<typename Derived::Nested>::type ThisNested;
return internal::redux_impl<Func, ThisNested>
::run(derived(), func);
}

View File

@ -57,9 +57,9 @@ struct traits<Select<ConditionMatrixType, ThenMatrixType, ElseMatrixType> >
MaxRowsAtCompileTime = ConditionMatrixType::MaxRowsAtCompileTime,
MaxColsAtCompileTime = ConditionMatrixType::MaxColsAtCompileTime,
Flags = (unsigned int)ThenMatrixType::Flags & ElseMatrixType::Flags & HereditaryBits,
CoeffReadCost = traits<typename cleantype<ConditionMatrixNested>::type>::CoeffReadCost
+ EIGEN_SIZE_MAX(traits<typename cleantype<ThenMatrixNested>::type>::CoeffReadCost,
traits<typename cleantype<ElseMatrixNested>::type>::CoeffReadCost)
CoeffReadCost = traits<typename remove_all<ConditionMatrixNested>::type>::CoeffReadCost
+ EIGEN_SIZE_MAX(traits<typename remove_all<ThenMatrixNested>::type>::CoeffReadCost,
traits<typename remove_all<ElseMatrixNested>::type>::CoeffReadCost)
};
};
}

View File

@ -80,11 +80,11 @@ template<typename MatrixType> class Transpose
inline Index cols() const { return m_matrix.rows(); }
/** \returns the nested expression */
const typename internal::cleantype<typename MatrixType::Nested>::type&
const typename internal::remove_all<typename MatrixType::Nested>::type&
nestedExpression() const { return m_matrix; }
/** \returns the nested expression */
typename internal::cleantype<typename MatrixType::Nested>::type&
typename internal::remove_all<typename MatrixType::Nested>::type&
nestedExpression() { return m_matrix.const_cast_derived(); }
protected:

View File

@ -225,7 +225,7 @@ template<typename TranspositionType, typename MatrixType, int Side, bool Transpo
struct transposition_matrix_product_retval
: public ReturnByValue<transposition_matrix_product_retval<TranspositionType, MatrixType, Side, Transposed> >
{
typedef typename cleantype<typename MatrixType::Nested>::type MatrixTypeNestedCleaned;
typedef typename remove_all<typename MatrixType::Nested>::type MatrixTypeNestedCleaned;
typedef typename TranspositionType::Index Index;
transposition_matrix_product_retval(const TranspositionType& tr, const MatrixType& matrix)

View File

@ -162,8 +162,8 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
protected:
typedef typename MatrixType::Nested MatrixTypeNested;
typedef typename internal::cleantype<MatrixTypeNested>::type _MatrixTypeNested;
typedef typename internal::cleantype<typename MatrixType::ConjugateReturnType>::type MatrixConjugateReturnType;
typedef typename internal::remove_all<MatrixTypeNested>::type _MatrixTypeNested;
typedef typename internal::remove_all<typename MatrixType::ConjugateReturnType>::type MatrixConjugateReturnType;
public:
using Base::evalToLazy;

View File

@ -55,7 +55,7 @@ struct traits<PartialReduxExpr<MatrixType, MemberOp, Direction> >
typedef typename traits<MatrixType>::XprKind XprKind;
typedef typename MatrixType::Scalar InputScalar;
typedef typename nested<MatrixType>::type MatrixTypeNested;
typedef typename cleantype<MatrixTypeNested>::type _MatrixTypeNested;
typedef typename remove_all<MatrixTypeNested>::type _MatrixTypeNested;
enum {
RowsAtCompileTime = Direction==Vertical ? 1 : MatrixType::RowsAtCompileTime,
ColsAtCompileTime = Direction==Horizontal ? 1 : MatrixType::ColsAtCompileTime,

View File

@ -51,8 +51,8 @@ template<typename LhsNested, typename RhsNested, int NestingFlags>
struct traits<CoeffBasedProduct<LhsNested,RhsNested,NestingFlags> >
{
typedef MatrixXpr XprKind;
typedef typename cleantype<LhsNested>::type _LhsNested;
typedef typename cleantype<RhsNested>::type _RhsNested;
typedef typename remove_all<LhsNested>::type _LhsNested;
typedef typename remove_all<RhsNested>::type _RhsNested;
typedef typename scalar_product_traits<typename _LhsNested::Scalar, typename _RhsNested::Scalar>::ReturnType Scalar;
typedef typename promote_storage_type<typename traits<_LhsNested>::StorageKind,
typename traits<_RhsNested>::StorageKind>::ret StorageKind;

View File

@ -203,7 +203,7 @@ SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo>
{
typedef internal::blas_traits<DerivedU> UBlasTraits;
typedef typename UBlasTraits::DirectLinearAccessType ActualUType;
typedef typename internal::cleantype<ActualUType>::type _ActualUType;
typedef typename internal::remove_all<ActualUType>::type _ActualUType;
const ActualUType actualU = UBlasTraits::extract(u.derived());
Scalar actualAlpha = alpha * UBlasTraits::extractScalarFactor(u.derived());

View File

@ -75,12 +75,12 @@ SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo>
{
typedef internal::blas_traits<DerivedU> UBlasTraits;
typedef typename UBlasTraits::DirectLinearAccessType ActualUType;
typedef typename internal::cleantype<ActualUType>::type _ActualUType;
typedef typename internal::remove_all<ActualUType>::type _ActualUType;
const ActualUType actualU = UBlasTraits::extract(u.derived());
typedef internal::blas_traits<DerivedV> VBlasTraits;
typedef typename VBlasTraits::DirectLinearAccessType ActualVType;
typedef typename internal::cleantype<ActualVType>::type _ActualVType;
typedef typename internal::remove_all<ActualVType>::type _ActualVType;
const ActualVType actualV = VBlasTraits::extract(v.derived());
Scalar actualAlpha = alpha * UBlasTraits::extractScalarFactor(u.derived())
@ -88,8 +88,8 @@ SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo>
enum { IsRowMajor = (internal::traits<MatrixType>::Flags&RowMajorBit) ? 1 : 0 };
internal::selfadjoint_rank2_update_selector<Scalar, Index,
typename internal::cleantype<typename internal::conj_expr_if<IsRowMajor ^ UBlasTraits::NeedToConjugate,_ActualUType>::type>::type,
typename internal::cleantype<typename internal::conj_expr_if<IsRowMajor ^ VBlasTraits::NeedToConjugate,_ActualVType>::type>::type,
typename internal::remove_all<typename internal::conj_expr_if<IsRowMajor ^ UBlasTraits::NeedToConjugate,_ActualUType>::type>::type,
typename internal::remove_all<typename internal::conj_expr_if<IsRowMajor ^ VBlasTraits::NeedToConjugate,_ActualVType>::type>::type,
(IsRowMajor ? int(UpLo==Upper ? Lower : Upper) : UpLo)>
::run(const_cast<Scalar*>(_expression().data()),_expression().outerStride(),actualU,actualV,actualAlpha);

View File

@ -59,12 +59,12 @@ template<typename T> struct remove_const<const T> { typedef T type; };
template<typename T> struct remove_const<T const &> { typedef T & type; };
template<typename T> struct remove_const<T const *> { typedef T * type; };
template<typename T> struct cleantype { typedef T type; };
template<typename T> struct cleantype<const T> { typedef typename cleantype<T>::type type; };
template<typename T> struct cleantype<const T&> { typedef typename cleantype<T>::type type; };
template<typename T> struct cleantype<T&> { typedef typename cleantype<T>::type type; };
template<typename T> struct cleantype<const T*> { typedef typename cleantype<T>::type type; };
template<typename T> struct cleantype<T*> { typedef typename cleantype<T>::type type; };
template<typename T> struct remove_all { typedef T type; };
template<typename T> struct remove_all<const T> { typedef typename remove_all<T>::type type; };
template<typename T> struct remove_all<const T&> { typedef typename remove_all<T>::type type; };
template<typename T> struct remove_all<T&> { typedef typename remove_all<T>::type type; };
template<typename T> struct remove_all<const T*> { typedef typename remove_all<T>::type type; };
template<typename T> struct remove_all<T*> { typedef typename remove_all<T>::type type; };
template<typename T> struct is_arithmetic { enum { value = false }; };
template<> struct is_arithmetic<float> { enum { value = true }; };
@ -209,7 +209,7 @@ template<typename T> struct scalar_product_traits<std::complex<T>, T>
// FIXME quick workaround around current limitation of result_of
// template<typename Scalar, typename ArgType0, typename ArgType1>
// struct result_of<scalar_product_op<Scalar>(ArgType0,ArgType1)> {
// typedef typename scalar_product_traits<typename cleantype<ArgType0>::type, typename cleantype<ArgType1>::type>::ReturnType type;
// typedef typename scalar_product_traits<typename remove_all<ArgType0>::type, typename remove_all<ArgType1>::type>::ReturnType type;
// };
template<typename T> struct is_diagonal

View File

@ -410,7 +410,7 @@ template<typename ExpressionType> struct HNormalizedReturnType {
template<typename XprType, typename CastType> struct cast_return_type
{
typedef typename XprType::Scalar CurrentScalarType;
typedef typename cleantype<CastType>::type _CastType;
typedef typename remove_all<CastType>::type _CastType;
typedef typename _CastType::Scalar NewScalarType;
typedef typename conditional<is_same<CurrentScalarType,NewScalarType>::value,
const XprType&,CastType>::type type;

View File

@ -233,7 +233,7 @@ template<typename MatrixType,typename Lhs>
struct homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
: public ReturnByValue<homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs> >
{
typedef typename cleantype<typename Lhs::Nested>::type LhsNested;
typedef typename remove_all<typename Lhs::Nested>::type LhsNested;
typedef typename MatrixType::Index Index;
homogeneous_left_product_impl(const Lhs& lhs, const MatrixType& rhs)
: m_lhs(lhs), m_rhs(rhs)
@ -272,7 +272,7 @@ template<typename MatrixType,typename Rhs>
struct homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs>
: public ReturnByValue<homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs> >
{
typedef typename cleantype<typename Rhs::Nested>::type RhsNested;
typedef typename remove_all<typename Rhs::Nested>::type RhsNested;
typedef typename MatrixType::Index Index;
homogeneous_right_product_impl(const MatrixType& lhs, const Rhs& rhs)
: m_lhs(lhs), m_rhs(rhs)

View File

@ -95,8 +95,8 @@ MatrixBase<Derived>::cross3(const MatrixBase<OtherDerived>& other) const
const OtherDerivedNested rhs(other.derived());
return internal::cross3_impl<Architecture::Target,
typename internal::cleantype<DerivedNested>::type,
typename internal::cleantype<OtherDerivedNested>::type>::run(lhs,rhs);
typename internal::remove_all<DerivedNested>::type,
typename internal::remove_all<OtherDerivedNested>::type>::run(lhs,rhs);
}
/** \returns a matrix expression of the cross product of each column or row

View File

@ -124,7 +124,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
typedef HouseholderSequence<
VectorsType,
typename internal::conditional<NumTraits<Scalar>::IsComplex,
typename internal::cleantype<typename CoeffsType::ConjugateReturnType>::type,
typename internal::remove_all<typename CoeffsType::ConjugateReturnType>::type,
CoeffsType>::type,
Side
> ConjugateReturnType;
@ -167,7 +167,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
// FIXME find a way to pass this temporary if the user want to
Matrix<Scalar, DestType::RowsAtCompileTime, 1,
AutoAlign|ColMajor, DestType::MaxRowsAtCompileTime, 1> temp(rows());
if( internal::is_same<typename internal::cleantype<VectorsType>::type,DestType>::value
if( internal::is_same<typename internal::remove_all<VectorsType>::type,DestType>::value
&& internal::extract_data(dst) == internal::extract_data(m_vectors))
{
// in-place

View File

@ -106,7 +106,7 @@ inline typename internal::traits<Derived>::Scalar MatrixBase<Derived>::determina
{
assert(rows() == cols());
typedef typename internal::nested<Derived,Base::RowsAtCompileTime>::type Nested;
return internal::determinant_impl<typename internal::cleantype<Nested>::type>::run(derived());
return internal::determinant_impl<typename internal::remove_all<Nested>::type>::run(derived());
}
#endif // EIGEN_DETERMINANT_H

View File

@ -159,7 +159,7 @@ struct compute_inverse<MatrixType, ResultType, 3>
static inline void run(const MatrixType& matrix, ResultType& result)
{
typedef typename ResultType::Scalar Scalar;
Matrix<Scalar,3,1> cofactors_col0;
Matrix<typename MatrixType::Scalar,3,1> cofactors_col0;
cofactors_col0.coeffRef(0) = cofactor_3x3<MatrixType,0,0>(matrix);
cofactors_col0.coeffRef(1) = cofactor_3x3<MatrixType,1,0>(matrix);
cofactors_col0.coeffRef(2) = cofactor_3x3<MatrixType,2,0>(matrix);
@ -284,8 +284,8 @@ template<typename MatrixType>
struct inverse_impl : public ReturnByValue<inverse_impl<MatrixType> >
{
typedef typename MatrixType::Index Index;
typedef typename eval<MatrixType>::type MatrixTypeNested;
typedef typename cleantype<MatrixTypeNested>::type MatrixTypeNestedCleaned;
typedef typename internal::eval<MatrixType>::type MatrixTypeNested;
typedef typename remove_all<MatrixTypeNested>::type MatrixTypeNestedCleaned;
const MatrixTypeNested m_matrix;
inverse_impl(const MatrixType& matrix)
@ -366,7 +366,7 @@ inline void MatrixBase<Derived>::computeInverseAndDetWithCheck(
// for larger sizes, evaluating has negligible cost and limits code size.
typedef typename internal::conditional<
RowsAtCompileTime == 2,
typename internal::cleantype<typename internal::nested<Derived, 2>::type>::type,
typename internal::remove_all<typename internal::nested<Derived, 2>::type>::type,
PlainObject
>::type MatrixType;
internal::compute_inverse_and_det_with_check<MatrixType, ResultType>::run

View File

@ -241,7 +241,7 @@ class SparseInnerVectorSet<SparseMatrix<_Scalar, _Options, _Index>, Size>
template<typename OtherDerived>
inline SparseInnerVectorSet& operator=(const SparseMatrixBase<OtherDerived>& other)
{
typedef typename internal::cleantype<typename MatrixType::Nested>::type _NestedMatrixType;
typedef typename internal::remove_all<typename MatrixType::Nested>::type _NestedMatrixType;
_NestedMatrixType& matrix = const_cast<_NestedMatrixType&>(m_matrix);;
// This assignement is slow if this vector set not empty
// and/or it is not at the end of the nonzeros of the underlying matrix.

View File

@ -56,8 +56,8 @@ struct traits<SparseDenseOuterProduct<Lhs,Rhs,Tr> >
typedef typename Lhs::Index Index;
typedef typename Lhs::Nested LhsNested;
typedef typename Rhs::Nested RhsNested;
typedef typename cleantype<LhsNested>::type _LhsNested;
typedef typename cleantype<RhsNested>::type _RhsNested;
typedef typename remove_all<LhsNested>::type _LhsNested;
typedef typename remove_all<RhsNested>::type _RhsNested;
enum {
LhsCoeffReadCost = traits<_LhsNested>::CoeffReadCost,
@ -163,8 +163,8 @@ class SparseTimeDenseProduct
template<typename Dest> void scaleAndAddTo(Dest& dest, Scalar alpha) const
{
typedef typename internal::cleantype<Lhs>::type _Lhs;
typedef typename internal::cleantype<Rhs>::type _Rhs;
typedef typename internal::remove_all<Lhs>::type _Lhs;
typedef typename internal::remove_all<Rhs>::type _Rhs;
typedef typename _Lhs::InnerIterator LhsInnerIterator;
enum { LhsIsRowMajor = (_Lhs::Flags&RowMajorBit)==RowMajorBit };
for(Index j=0; j<m_lhs.outerSize(); ++j)
@ -207,7 +207,7 @@ class DenseTimeSparseProduct
template<typename Dest> void scaleAndAddTo(Dest& dest, Scalar alpha) const
{
typedef typename internal::cleantype<Rhs>::type _Rhs;
typedef typename internal::remove_all<Rhs>::type _Rhs;
typedef typename _Rhs::InnerIterator RhsInnerIterator;
enum { RhsIsRowMajor = (_Rhs::Flags&RowMajorBit)==RowMajorBit };
for(Index j=0; j<m_rhs.outerSize(); ++j)

View File

@ -42,8 +42,8 @@ namespace internal {
template<typename Lhs, typename Rhs>
struct traits<SparseDiagonalProduct<Lhs, Rhs> >
{
typedef typename cleantype<Lhs>::type _Lhs;
typedef typename cleantype<Rhs>::type _Rhs;
typedef typename remove_all<Lhs>::type _Lhs;
typedef typename remove_all<Rhs>::type _Rhs;
typedef typename _Lhs::Scalar Scalar;
typedef typename promote_index_type<typename traits<Lhs>::Index,
typename traits<Rhs>::Index>::type Index;
@ -76,8 +76,8 @@ class SparseDiagonalProduct
typedef typename Lhs::Nested LhsNested;
typedef typename Rhs::Nested RhsNested;
typedef typename internal::cleantype<LhsNested>::type _LhsNested;
typedef typename internal::cleantype<RhsNested>::type _RhsNested;
typedef typename internal::remove_all<LhsNested>::type _LhsNested;
typedef typename internal::remove_all<RhsNested>::type _RhsNested;
enum {
LhsMode = internal::is_diagonal<_LhsNested>::ret ? internal::SDP_IsDiagonal

View File

@ -449,7 +449,7 @@ class SparseMatrix
// 2 - do the actual copy/eval
// Since each coeff of the rhs has to be evaluated twice, let's evaluate it if needed
typedef typename internal::nested<OtherDerived,2>::type OtherCopy;
typedef typename internal::cleantype<OtherCopy>::type _OtherCopy;
typedef typename internal::remove_all<OtherCopy>::type _OtherCopy;
OtherCopy otherCopy(other.derived());
resize(other.rows(), other.cols());

View File

@ -53,8 +53,8 @@ struct traits<SparseSparseProduct<LhsNested, RhsNested> >
{
typedef MatrixXpr XprKind;
// clean the nested types:
typedef typename cleantype<LhsNested>::type _LhsNested;
typedef typename cleantype<RhsNested>::type _RhsNested;
typedef typename remove_all<LhsNested>::type _LhsNested;
typedef typename remove_all<RhsNested>::type _RhsNested;
typedef typename _LhsNested::Scalar Scalar;
typedef typename promote_index_type<typename traits<_LhsNested>::Index,
typename traits<_RhsNested>::Index>::type Index;

View File

@ -165,8 +165,8 @@ class SparseSelfAdjointTimeDenseProduct
{
// TODO use alpha
eigen_assert(alpha==Scalar(1) && "alpha != 1 is not implemented yet, sorry");
typedef typename internal::cleantype<Lhs>::type _Lhs;
typedef typename internal::cleantype<Rhs>::type _Rhs;
typedef typename internal::remove_all<Lhs>::type _Lhs;
typedef typename internal::remove_all<Rhs>::type _Rhs;
typedef typename _Lhs::InnerIterator LhsInnerIterator;
enum {
LhsIsRowMajor = (_Lhs::Flags&RowMajorBit)==RowMajorBit,

View File

@ -30,8 +30,8 @@ namespace internal {
template<typename Lhs, typename Rhs, typename ResultType>
static void sparse_product_impl2(const Lhs& lhs, const Rhs& rhs, ResultType& res)
{
typedef typename cleantype<Lhs>::type::Scalar Scalar;
typedef typename cleantype<Lhs>::type::Index Index;
typedef typename remove_all<Lhs>::type::Scalar Scalar;
typedef typename remove_all<Lhs>::type::Index Index;
// make sure to call innerSize/outerSize since we fake the storage order.
Index rows = lhs.innerSize();
@ -116,8 +116,8 @@ static void sparse_product_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res)
{
// return sparse_product_impl2(lhs,rhs,res);
typedef typename cleantype<Lhs>::type::Scalar Scalar;
typedef typename cleantype<Lhs>::type::Index Index;
typedef typename remove_all<Lhs>::type::Scalar Scalar;
typedef typename remove_all<Lhs>::type::Index Index;
// make sure to call innerSize/outerSize since we fake the storage order.
Index rows = lhs.innerSize();
@ -169,12 +169,12 @@ struct sparse_product_selector;
template<typename Lhs, typename Rhs, typename ResultType>
struct sparse_product_selector<Lhs,Rhs,ResultType,ColMajor,ColMajor,ColMajor>
{
typedef typename traits<typename cleantype<Lhs>::type>::Scalar Scalar;
typedef typename traits<typename remove_all<Lhs>::type>::Scalar Scalar;
static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res)
{
// std::cerr << __LINE__ << "\n";
typename cleantype<ResultType>::type _res(res.rows(), res.cols());
typename remove_all<ResultType>::type _res(res.rows(), res.cols());
sparse_product_impl<Lhs,Rhs,ResultType>(lhs, rhs, _res);
res.swap(_res);
}
@ -201,7 +201,7 @@ struct sparse_product_selector<Lhs,Rhs,ResultType,RowMajor,RowMajor,RowMajor>
{
// std::cerr << __LINE__ << "\n";
// let's transpose the product to get a column x column product
typename cleantype<ResultType>::type _res(res.rows(), res.cols());
typename remove_all<ResultType>::type _res(res.rows(), res.cols());
sparse_product_impl<Rhs,Lhs,ResultType>(rhs, lhs, _res);
res.swap(_res);
}
@ -241,8 +241,8 @@ inline Derived& SparseMatrixBase<Derived>::operator=(const SparseSparseProduct<L
{
// std::cerr << "there..." << typeid(Lhs).name() << " " << typeid(Lhs).name() << " " << (Derived::Flags&&RowMajorBit) << "\n";
internal::sparse_product_selector<
typename internal::cleantype<Lhs>::type,
typename internal::cleantype<Rhs>::type,
typename internal::remove_all<Lhs>::type,
typename internal::remove_all<Rhs>::type,
Derived>::run(product.lhs(),product.rhs(),derived());
return derived();
}
@ -258,7 +258,7 @@ struct sparse_product_selector2;
template<typename Lhs, typename Rhs, typename ResultType>
struct sparse_product_selector2<Lhs,Rhs,ResultType,ColMajor,ColMajor,ColMajor>
{
typedef typename traits<typename cleantype<Lhs>::type>::Scalar Scalar;
typedef typename traits<typename remove_all<Lhs>::type>::Scalar Scalar;
static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res)
{
@ -313,7 +313,7 @@ struct sparse_product_selector2<Lhs,Rhs,ResultType,RowMajor,RowMajor,ColMajor>
template<typename Lhs, typename Rhs, typename ResultType>
struct sparse_product_selector2<Lhs,Rhs,ResultType,ColMajor,ColMajor,RowMajor>
{
typedef typename traits<typename cleantype<Lhs>::type>::Scalar Scalar;
typedef typename traits<typename remove_all<Lhs>::type>::Scalar Scalar;
static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res)
{
@ -379,8 +379,8 @@ inline void SparseMatrixBase<Derived>::_experimentalNewProduct(const Lhs& lhs, c
{
//derived().resize(lhs.rows(), rhs.cols());
internal::sparse_product_selector2<
typename internal::cleantype<Lhs>::type,
typename internal::cleantype<Rhs>::type,
typename internal::remove_all<Lhs>::type,
typename internal::remove_all<Rhs>::type,
Derived>::run(lhs,rhs,derived());
}

View File

@ -28,7 +28,7 @@
template<typename MatrixType> class TransposeImpl<MatrixType,Sparse>
: public SparseMatrixBase<Transpose<MatrixType> >
{
typedef typename internal::cleantype<typename MatrixType::Nested>::type _MatrixTypeNested;
typedef typename internal::remove_all<typename MatrixType::Nested>::type _MatrixTypeNested;
public:
EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>)

View File

@ -265,7 +265,7 @@ class SparseVector
// // Since each coeff of the rhs has to be evaluated twice, let's evauluate it if needed
// typedef typename internal::nested<OtherDerived,2>::type OtherCopy;
// OtherCopy otherCopy(other.derived());
// typedef typename internal::cleantype<OtherCopy>::type _OtherCopy;
// typedef typename internal::remove_all<OtherCopy>::type _OtherCopy;
//
// resize(other.rows(), other.cols());
// Eigen::Map<VectorXi>(m_outerIndex,outerSize()).setZero();

View File

@ -44,7 +44,7 @@ template<typename MatrixType>
class SparseView : public SparseMatrixBase<SparseView<MatrixType> >
{
typedef typename MatrixType::Nested MatrixTypeNested;
typedef typename internal::cleantype<MatrixTypeNested>::type _MatrixTypeNested;
typedef typename internal::remove_all<MatrixTypeNested>::type _MatrixTypeNested;
public:
EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView)

View File

@ -45,7 +45,7 @@ struct traits<solve_retval_base<DecompositionType, Rhs> >
template<typename _DecompositionType, typename Rhs> struct solve_retval_base
: public ReturnByValue<solve_retval_base<_DecompositionType, Rhs> >
{
typedef typename cleantype<typename Rhs::Nested>::type RhsNestedCleaned;
typedef typename remove_all<typename Rhs::Nested>::type RhsNestedCleaned;
typedef _DecompositionType DecompositionType;
typedef ReturnByValue<solve_retval_base> Base;
typedef typename Base::Index Index;

View File

@ -35,13 +35,13 @@ void test_meta()
VERIFY((!internal::is_same<float,float&>::value));
VERIFY((!internal::is_same<float,const float&>::value));
VERIFY(( internal::is_same<float,internal::cleantype<const float&>::type >::value));
VERIFY(( internal::is_same<float,internal::cleantype<const float*>::type >::value));
VERIFY(( internal::is_same<float,internal::cleantype<const float*&>::type >::value));
VERIFY(( internal::is_same<float,internal::cleantype<float**>::type >::value));
VERIFY(( internal::is_same<float,internal::cleantype<float**&>::type >::value));
VERIFY(( internal::is_same<float,internal::cleantype<float* const *&>::type >::value));
VERIFY(( internal::is_same<float,internal::cleantype<float* const>::type >::value));
VERIFY(( internal::is_same<float,internal::remove_all<const float&>::type >::value));
VERIFY(( internal::is_same<float,internal::remove_all<const float*>::type >::value));
VERIFY(( internal::is_same<float,internal::remove_all<const float*&>::type >::value));
VERIFY(( internal::is_same<float,internal::remove_all<float**>::type >::value));
VERIFY(( internal::is_same<float,internal::remove_all<float**&>::type >::value));
VERIFY(( internal::is_same<float,internal::remove_all<float* const *&>::type >::value));
VERIFY(( internal::is_same<float,internal::remove_all<float* const>::type >::value));
VERIFY(( internal::is_same<float*,internal::remove_const<const float*>::type >::value));
VERIFY(( internal::is_same<float&,internal::remove_const<const float&>::type >::value));

View File

@ -74,14 +74,14 @@ template<typename _DerType, bool Enable> struct auto_diff_special_op;
template<typename _DerType>
class AutoDiffScalar
: public internal::auto_diff_special_op
<_DerType, !internal::is_same<typename internal::traits<typename internal::cleantype<_DerType>::type>::Scalar,
typename NumTraits<typename internal::traits<typename internal::cleantype<_DerType>::type>::Scalar>::Real>::value>
<_DerType, !internal::is_same<typename internal::traits<typename internal::remove_all<_DerType>::type>::Scalar,
typename NumTraits<typename internal::traits<typename internal::remove_all<_DerType>::type>::Scalar>::Real>::value>
{
public:
typedef internal::auto_diff_special_op
<_DerType, !internal::is_same<typename internal::traits<typename internal::cleantype<_DerType>::type>::Scalar,
typename NumTraits<typename internal::traits<typename internal::cleantype<_DerType>::type>::Scalar>::Real>::value> Base;
typedef typename internal::cleantype<_DerType>::type DerType;
<_DerType, !internal::is_same<typename internal::traits<typename internal::remove_all<_DerType>::type>::Scalar,
typename NumTraits<typename internal::traits<typename internal::remove_all<_DerType>::type>::Scalar>::Real>::value> Base;
typedef typename internal::remove_all<_DerType>::type DerType;
typedef typename internal::traits<DerType>::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real Real;
@ -178,11 +178,11 @@ class AutoDiffScalar
}
template<typename OtherDerType>
inline const AutoDiffScalar<CwiseBinaryOp<internal::scalar_sum_op<Scalar>,DerType,typename internal::cleantype<OtherDerType>::type> >
inline const AutoDiffScalar<CwiseBinaryOp<internal::scalar_sum_op<Scalar>,DerType,typename internal::remove_all<OtherDerType>::type> >
operator+(const AutoDiffScalar<OtherDerType>& other) const
{
internal::make_coherent(m_derivatives, other.derivatives());
return AutoDiffScalar<CwiseBinaryOp<internal::scalar_sum_op<Scalar>,DerType,typename internal::cleantype<OtherDerType>::type> >(
return AutoDiffScalar<CwiseBinaryOp<internal::scalar_sum_op<Scalar>,DerType,typename internal::remove_all<OtherDerType>::type> >(
m_value + other.value(),
m_derivatives + other.derivatives());
}
@ -196,11 +196,11 @@ class AutoDiffScalar
}
template<typename OtherDerType>
inline const AutoDiffScalar<CwiseBinaryOp<internal::scalar_difference_op<Scalar>, DerType,typename internal::cleantype<OtherDerType>::type> >
inline const AutoDiffScalar<CwiseBinaryOp<internal::scalar_difference_op<Scalar>, DerType,typename internal::remove_all<OtherDerType>::type> >
operator-(const AutoDiffScalar<OtherDerType>& other) const
{
internal::make_coherent(m_derivatives, other.derivatives());
return AutoDiffScalar<CwiseBinaryOp<internal::scalar_difference_op<Scalar>, DerType,typename internal::cleantype<OtherDerType>::type> >(
return AutoDiffScalar<CwiseBinaryOp<internal::scalar_difference_op<Scalar>, DerType,typename internal::remove_all<OtherDerType>::type> >(
m_value - other.value(),
m_derivatives - other.derivatives());
}
@ -290,14 +290,14 @@ class AutoDiffScalar
inline const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>,
CwiseBinaryOp<internal::scalar_difference_op<Scalar>,
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, DerType>,
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::cleantype<OtherDerType>::type > > > >
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::remove_all<OtherDerType>::type > > > >
operator/(const AutoDiffScalar<OtherDerType>& other) const
{
internal::make_coherent(m_derivatives, other.derivatives());
return AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>,
CwiseBinaryOp<internal::scalar_difference_op<Scalar>,
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, DerType>,
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::cleantype<OtherDerType>::type > > > >(
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::remove_all<OtherDerType>::type > > > >(
m_value / other.value(),
((m_derivatives * other.value()) - (m_value * other.derivatives()))
* (Scalar(1)/(other.value()*other.value())));
@ -306,13 +306,13 @@ class AutoDiffScalar
template<typename OtherDerType>
inline const AutoDiffScalar<CwiseBinaryOp<internal::scalar_sum_op<Scalar>,
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, DerType>,
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::cleantype<OtherDerType>::type> > >
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::remove_all<OtherDerType>::type> > >
operator*(const AutoDiffScalar<OtherDerType>& other) const
{
internal::make_coherent(m_derivatives, other.derivatives());
return AutoDiffScalar<CwiseBinaryOp<internal::scalar_sum_op<Scalar>,
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, DerType>,
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::cleantype<OtherDerType>::type > > >(
CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::remove_all<OtherDerType>::type > > >(
m_value * other.value(),
(m_derivatives * other.value()) + (m_value * other.derivatives()));
}
@ -343,7 +343,7 @@ struct auto_diff_special_op<_DerType, true>
// : auto_diff_scalar_op<_DerType, typename NumTraits<Scalar>::Real,
// is_same<Scalar,typename NumTraits<Scalar>::Real>::value>
{
typedef typename cleantype<_DerType>::type DerType;
typedef typename remove_all<_DerType>::type DerType;
typedef typename traits<DerType>::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real Real;
@ -475,11 +475,11 @@ struct scalar_product_traits<AutoDiffScalar<DerType>,T>
#define EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(FUNC,CODE) \
template<typename DerType> \
inline const Eigen::AutoDiffScalar<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<typename Eigen::internal::traits<typename Eigen::internal::cleantype<DerType>::type>::Scalar>, typename Eigen::internal::cleantype<DerType>::type> > \
inline const Eigen::AutoDiffScalar<Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<typename Eigen::internal::traits<typename Eigen::internal::remove_all<DerType>::type>::Scalar>, typename Eigen::internal::remove_all<DerType>::type> > \
FUNC(const Eigen::AutoDiffScalar<DerType>& x) { \
using namespace Eigen; \
typedef typename internal::traits<typename internal::cleantype<DerType>::type>::Scalar Scalar; \
typedef AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::cleantype<DerType>::type> > ReturnType; \
typedef typename internal::traits<typename internal::remove_all<DerType>::type>::Scalar Scalar; \
typedef AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, typename internal::remove_all<DerType>::type> > ReturnType; \
CODE; \
}

View File

@ -36,8 +36,8 @@ struct SkylineProductReturnType {
template<typename LhsNested, typename RhsNested, int ProductMode>
struct internal::traits<SkylineProduct<LhsNested, RhsNested, ProductMode> > {
// clean the nested types:
typedef typename internal::cleantype<LhsNested>::type _LhsNested;
typedef typename internal::cleantype<RhsNested>::type _RhsNested;
typedef typename internal::remove_all<LhsNested>::type _LhsNested;
typedef typename internal::remove_all<RhsNested>::type _RhsNested;
typedef typename _LhsNested::Scalar Scalar;
enum {
@ -133,8 +133,8 @@ protected:
template<typename Lhs, typename Rhs, typename Dest>
EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, const Rhs& rhs, Dest& dst) {
typedef typename cleantype<Lhs>::type _Lhs;
typedef typename cleantype<Rhs>::type _Rhs;
typedef typename remove_all<Lhs>::type _Lhs;
typedef typename remove_all<Rhs>::type _Rhs;
typedef typename traits<Lhs>::Scalar Scalar;
enum {
@ -196,8 +196,8 @@ EIGEN_DONT_INLINE void skyline_row_major_time_dense_product(const Lhs& lhs, cons
template<typename Lhs, typename Rhs, typename Dest>
EIGEN_DONT_INLINE void skyline_col_major_time_dense_product(const Lhs& lhs, const Rhs& rhs, Dest& dst) {
typedef typename cleantype<Lhs>::type _Lhs;
typedef typename cleantype<Rhs>::type _Rhs;
typedef typename remove_all<Lhs>::type _Lhs;
typedef typename remove_all<Rhs>::type _Rhs;
typedef typename traits<Lhs>::Scalar Scalar;
enum {
@ -264,7 +264,7 @@ template<typename Lhs, typename Rhs, typename ResultType,
template<typename Lhs, typename Rhs, typename ResultType>
struct skyline_product_selector<Lhs, Rhs, ResultType, RowMajor> {
typedef typename traits<typename cleantype<Lhs>::type>::Scalar Scalar;
typedef typename traits<typename remove_all<Lhs>::type>::Scalar Scalar;
static void run(const Lhs& lhs, const Rhs& rhs, ResultType & res) {
skyline_row_major_time_dense_product<Lhs, Rhs, ResultType > (lhs, rhs, res);
@ -273,7 +273,7 @@ struct skyline_product_selector<Lhs, Rhs, ResultType, RowMajor> {
template<typename Lhs, typename Rhs, typename ResultType>
struct skyline_product_selector<Lhs, Rhs, ResultType, ColMajor> {
typedef typename traits<typename cleantype<Lhs>::type>::Scalar Scalar;
typedef typename traits<typename remove_all<Lhs>::type>::Scalar Scalar;
static void run(const Lhs& lhs, const Rhs& rhs, ResultType & res) {
skyline_col_major_time_dense_product<Lhs, Rhs, ResultType > (lhs, rhs, res);
@ -285,9 +285,9 @@ struct skyline_product_selector<Lhs, Rhs, ResultType, ColMajor> {
// template<typename Derived>
// template<typename Lhs, typename Rhs >
// Derived & MatrixBase<Derived>::lazyAssign(const SkylineProduct<Lhs, Rhs, SkylineTimeDenseProduct>& product) {
// typedef typename internal::cleantype<Lhs>::type _Lhs;
// internal::skyline_product_selector<typename internal::cleantype<Lhs>::type,
// typename internal::cleantype<Rhs>::type,
// typedef typename internal::remove_all<Lhs>::type _Lhs;
// internal::skyline_product_selector<typename internal::remove_all<Lhs>::type,
// typename internal::remove_all<Rhs>::type,
// Derived>::run(product.lhs(), product.rhs(), derived());
//
// return derived();