mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-08 01:39:03 +08:00
fix several const qualifier issues: double ones, meaningless ones, some missing ones, etc.
(note that const qualifiers are set by internall::nested)
This commit is contained in:
parent
bc7b251cd9
commit
fe85b7ebc6
@ -419,16 +419,16 @@ template<> struct ldlt_inplace<Upper>
|
||||
|
||||
template<typename MatrixType> struct LDLT_Traits<MatrixType,Lower>
|
||||
{
|
||||
typedef TriangularView<MatrixType, UnitLower> MatrixL;
|
||||
typedef TriangularView<typename MatrixType::AdjointReturnType, UnitUpper> MatrixU;
|
||||
typedef TriangularView<const MatrixType, UnitLower> MatrixL;
|
||||
typedef TriangularView<const typename MatrixType::AdjointReturnType, UnitUpper> MatrixU;
|
||||
static inline MatrixL getL(const MatrixType& m) { return m; }
|
||||
static inline MatrixU getU(const MatrixType& m) { return m.adjoint(); }
|
||||
};
|
||||
|
||||
template<typename MatrixType> struct LDLT_Traits<MatrixType,Upper>
|
||||
{
|
||||
typedef TriangularView<typename MatrixType::AdjointReturnType, UnitLower> MatrixL;
|
||||
typedef TriangularView<MatrixType, UnitUpper> MatrixU;
|
||||
typedef TriangularView<const typename MatrixType::AdjointReturnType, UnitLower> MatrixL;
|
||||
typedef TriangularView<const MatrixType, UnitUpper> MatrixU;
|
||||
static inline MatrixL getL(const MatrixType& m) { return m.adjoint(); }
|
||||
static inline MatrixU getU(const MatrixType& m) { return m; }
|
||||
};
|
||||
|
@ -357,8 +357,8 @@ template<typename Scalar> struct llt_inplace<Scalar, Upper>
|
||||
|
||||
template<typename MatrixType> struct LLT_Traits<MatrixType,Lower>
|
||||
{
|
||||
typedef TriangularView<MatrixType, Lower> MatrixL;
|
||||
typedef TriangularView<typename MatrixType::AdjointReturnType, Upper> MatrixU;
|
||||
typedef TriangularView<const MatrixType, Lower> MatrixL;
|
||||
typedef TriangularView<const typename MatrixType::AdjointReturnType, Upper> MatrixU;
|
||||
static inline MatrixL getL(const MatrixType& m) { return m; }
|
||||
static inline MatrixU getU(const MatrixType& m) { return m.adjoint(); }
|
||||
static bool inplace_decomposition(MatrixType& m)
|
||||
@ -367,8 +367,8 @@ template<typename MatrixType> struct LLT_Traits<MatrixType,Lower>
|
||||
|
||||
template<typename MatrixType> struct LLT_Traits<MatrixType,Upper>
|
||||
{
|
||||
typedef TriangularView<typename MatrixType::AdjointReturnType, Lower> MatrixL;
|
||||
typedef TriangularView<MatrixType, Upper> MatrixU;
|
||||
typedef TriangularView<const typename MatrixType::AdjointReturnType, Lower> MatrixL;
|
||||
typedef TriangularView<const MatrixType, Upper> MatrixU;
|
||||
static inline MatrixL getL(const MatrixType& m) { return m.adjoint(); }
|
||||
static inline MatrixU getU(const MatrixType& m) { return m; }
|
||||
static bool inplace_decomposition(MatrixType& m)
|
||||
|
@ -159,7 +159,7 @@ template<typename Derived> class ArrayBase
|
||||
/** \returns an \link MatrixBase Matrix \endlink expression of this array
|
||||
* \sa MatrixBase::array() */
|
||||
MatrixWrapper<Derived> matrix() { return derived(); }
|
||||
const MatrixWrapper<Derived> matrix() const { return derived(); }
|
||||
const MatrixWrapper<const Derived> matrix() const { return derived(); }
|
||||
|
||||
// template<typename Dest>
|
||||
// inline void evalTo(Dest& dst) const { dst = matrix(); }
|
||||
|
@ -61,7 +61,7 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
|
||||
|
||||
typedef typename internal::nested<ExpressionType>::type NestedExpressionType;
|
||||
|
||||
inline ArrayWrapper(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||
inline ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||
|
||||
inline Index rows() const { return m_expression.rows(); }
|
||||
inline Index cols() const { return m_expression.cols(); }
|
||||
@ -71,7 +71,7 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
|
||||
inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||
inline const Scalar* data() const { return m_expression.data(); }
|
||||
|
||||
inline const CoeffReturnType coeff(Index row, Index col) const
|
||||
inline CoeffReturnType coeff(Index row, Index col) const
|
||||
{
|
||||
return m_expression.coeff(row, col);
|
||||
}
|
||||
@ -86,7 +86,7 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
|
||||
return m_expression.const_cast_derived().coeffRef(row, col);
|
||||
}
|
||||
|
||||
inline const CoeffReturnType coeff(Index index) const
|
||||
inline CoeffReturnType coeff(Index index) const
|
||||
{
|
||||
return m_expression.coeff(index);
|
||||
}
|
||||
@ -135,7 +135,7 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
|
||||
}
|
||||
|
||||
protected:
|
||||
const NestedExpressionType m_expression;
|
||||
NestedExpressionType m_expression;
|
||||
};
|
||||
|
||||
/** \class MatrixWrapper
|
||||
@ -174,7 +174,7 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> >
|
||||
|
||||
typedef typename internal::nested<ExpressionType>::type NestedExpressionType;
|
||||
|
||||
inline MatrixWrapper(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||
inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {}
|
||||
|
||||
inline Index rows() const { return m_expression.rows(); }
|
||||
inline Index cols() const { return m_expression.cols(); }
|
||||
@ -184,7 +184,7 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> >
|
||||
inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||
inline const Scalar* data() const { return m_expression.data(); }
|
||||
|
||||
inline const CoeffReturnType coeff(Index row, Index col) const
|
||||
inline CoeffReturnType coeff(Index row, Index col) const
|
||||
{
|
||||
return m_expression.coeff(row, col);
|
||||
}
|
||||
@ -199,7 +199,7 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> >
|
||||
return m_expression.derived().coeffRef(row, col);
|
||||
}
|
||||
|
||||
inline const CoeffReturnType coeff(Index index) const
|
||||
inline CoeffReturnType coeff(Index index) const
|
||||
{
|
||||
return m_expression.coeff(index);
|
||||
}
|
||||
@ -245,7 +245,7 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> >
|
||||
}
|
||||
|
||||
protected:
|
||||
const NestedExpressionType m_expression;
|
||||
NestedExpressionType m_expression;
|
||||
};
|
||||
|
||||
#endif // EIGEN_ARRAYWRAPPER_H
|
||||
|
@ -361,7 +361,7 @@ class Block<XprType,BlockRows,BlockCols, InnerPanel,true>
|
||||
: m_xpr.innerStride();
|
||||
}
|
||||
|
||||
const typename XprType::Nested m_xpr;
|
||||
typename XprType::Nested m_xpr;
|
||||
int m_outerStride;
|
||||
};
|
||||
|
||||
|
@ -167,8 +167,8 @@ class CwiseBinaryOp : internal::no_assignment_operator,
|
||||
const BinaryOp& functor() const { return m_functor; }
|
||||
|
||||
protected:
|
||||
const LhsNested m_lhs;
|
||||
const RhsNested m_rhs;
|
||||
LhsNested m_lhs;
|
||||
RhsNested m_rhs;
|
||||
const BinaryOp m_functor;
|
||||
};
|
||||
|
||||
|
@ -95,7 +95,7 @@ class CwiseUnaryOp : internal::no_assignment_operator,
|
||||
nestedExpression() { return m_xpr.const_cast_derived(); }
|
||||
|
||||
protected:
|
||||
const typename XprType::Nested m_xpr;
|
||||
typename XprType::Nested m_xpr;
|
||||
const UnaryOp m_functor;
|
||||
};
|
||||
|
||||
|
@ -97,7 +97,7 @@ class CwiseUnaryView : internal::no_assignment_operator,
|
||||
|
||||
protected:
|
||||
// FIXME changed from MatrixType::Nested because of a weird compilation error with sun CC
|
||||
const typename internal::nested<MatrixType>::type m_matrix;
|
||||
typename internal::nested<MatrixType>::type m_matrix;
|
||||
ViewOp m_functor;
|
||||
};
|
||||
|
||||
|
@ -376,12 +376,13 @@ template<typename Derived> class DenseBase
|
||||
inline Derived& operator*=(const Scalar& other);
|
||||
inline Derived& operator/=(const Scalar& other);
|
||||
|
||||
typedef typename internal::add_const_on_value_type<typename internal::eval<Derived>::type>::type EvalReturnType;
|
||||
/** \returns the matrix or vector obtained by evaluating this expression.
|
||||
*
|
||||
* Notice that in the case of a plain matrix or vector (not an expression) this function just returns
|
||||
* a const reference, in order to avoid a useless copy.
|
||||
*/
|
||||
EIGEN_STRONG_INLINE const typename internal::eval<Derived>::type eval() const
|
||||
EIGEN_STRONG_INLINE EvalReturnType eval() const
|
||||
{
|
||||
// Even though MSVC does not honor strong inlining when the return type
|
||||
// is a dynamic matrix, we desperately need strong inlining for fixed
|
||||
|
@ -2,6 +2,7 @@
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2007-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
// Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
|
||||
//
|
||||
// Eigen is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
@ -154,7 +155,7 @@ template<typename MatrixType, int DiagIndex> class Diagonal
|
||||
}
|
||||
|
||||
protected:
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
const internal::variable_if_dynamic<Index, DiagIndex> m_index;
|
||||
|
||||
private:
|
||||
|
@ -72,7 +72,7 @@ class DiagonalBase : public EigenBase<Derived>
|
||||
const DiagonalProduct<MatrixDerived, Derived, OnTheLeft>
|
||||
operator*(const MatrixBase<MatrixDerived> &matrix) const;
|
||||
|
||||
inline const DiagonalWrapper<CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const DiagonalVectorType> >
|
||||
inline const DiagonalWrapper<const CwiseUnaryOp<internal::scalar_inverse_op<Scalar>, const DiagonalVectorType> >
|
||||
inverse() const
|
||||
{
|
||||
return diagonal().cwiseInverse();
|
||||
@ -251,13 +251,13 @@ class DiagonalWrapper
|
||||
#endif
|
||||
|
||||
/** Constructor from expression of diagonal coefficients to wrap. */
|
||||
inline DiagonalWrapper(const DiagonalVectorType& diagonal) : m_diagonal(diagonal) {}
|
||||
inline DiagonalWrapper(DiagonalVectorType& diagonal) : m_diagonal(diagonal) {}
|
||||
|
||||
/** \returns a const reference to the wrapped expression of diagonal coefficients. */
|
||||
const DiagonalVectorType& diagonal() const { return m_diagonal; }
|
||||
|
||||
protected:
|
||||
const typename DiagonalVectorType::Nested m_diagonal;
|
||||
typename DiagonalVectorType::Nested m_diagonal;
|
||||
};
|
||||
|
||||
/** \returns a pseudo-expression of a diagonal matrix with *this as vector of diagonal coefficients
|
||||
|
@ -107,8 +107,8 @@ class DiagonalProduct : internal::no_assignment_operator,
|
||||
m_diagonal.diagonal().template packet<DiagonalVectorPacketLoadMode>(id));
|
||||
}
|
||||
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
const typename DiagonalType::Nested m_diagonal;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
typename DiagonalType::Nested m_diagonal;
|
||||
};
|
||||
|
||||
/** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal.
|
||||
|
@ -35,8 +35,8 @@ struct isApprox_selector
|
||||
static bool run(const Derived& x, const OtherDerived& y, typename Derived::RealScalar prec)
|
||||
{
|
||||
using std::min;
|
||||
const typename internal::nested<Derived,2>::type nested(x);
|
||||
const typename internal::nested<OtherDerived,2>::type otherNested(y);
|
||||
typename internal::nested<Derived,2>::type nested(x);
|
||||
typename internal::nested<OtherDerived,2>::type otherNested(y);
|
||||
return (nested - otherNested).cwiseAbs2().sum() <= prec * prec * (min)(nested.cwiseAbs2().sum(), otherNested.cwiseAbs2().sum());
|
||||
}
|
||||
};
|
||||
|
@ -410,8 +410,8 @@ template<> struct gemv_selector<OnTheRight,ColMajor,true>
|
||||
typedef typename ProductType::RhsBlasTraits RhsBlasTraits;
|
||||
typedef Map<Matrix<ResScalar,Dynamic,1>, Aligned> MappedDest;
|
||||
|
||||
const ActualLhsType actualLhs = LhsBlasTraits::extract(prod.lhs());
|
||||
const ActualRhsType actualRhs = RhsBlasTraits::extract(prod.rhs());
|
||||
ActualLhsType actualLhs = LhsBlasTraits::extract(prod.lhs());
|
||||
ActualRhsType actualRhs = RhsBlasTraits::extract(prod.rhs());
|
||||
|
||||
ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs())
|
||||
* RhsBlasTraits::extractScalarFactor(prod.rhs());
|
||||
@ -452,7 +452,7 @@ template<> struct gemv_selector<OnTheRight,ColMajor,true>
|
||||
general_matrix_vector_product
|
||||
<Index,LhsScalar,ColMajor,LhsBlasTraits::NeedToConjugate,RhsScalar,RhsBlasTraits::NeedToConjugate>::run(
|
||||
actualLhs.rows(), actualLhs.cols(),
|
||||
&actualLhs.coeffRef(0,0), actualLhs.outerStride(),
|
||||
actualLhs.data(), actualLhs.outerStride(),
|
||||
actualRhs.data(), actualRhs.innerStride(),
|
||||
actualDestPtr, 1,
|
||||
compatibleAlpha);
|
||||
@ -511,9 +511,9 @@ template<> struct gemv_selector<OnTheRight,RowMajor,true>
|
||||
general_matrix_vector_product
|
||||
<Index,LhsScalar,RowMajor,LhsBlasTraits::NeedToConjugate,RhsScalar,RhsBlasTraits::NeedToConjugate>::run(
|
||||
actualLhs.rows(), actualLhs.cols(),
|
||||
&actualLhs.coeffRef(0,0), actualLhs.outerStride(),
|
||||
actualLhs.data(), actualLhs.outerStride(),
|
||||
actualRhsPtr, 1,
|
||||
&dest.coeffRef(0,0), dest.innerStride(),
|
||||
dest.data(), dest.innerStride(),
|
||||
actualAlpha);
|
||||
}
|
||||
};
|
||||
|
@ -171,7 +171,7 @@ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat&
|
||||
return s;
|
||||
}
|
||||
|
||||
const typename Derived::Nested m = _m;
|
||||
typename Derived::Nested m = _m;
|
||||
typedef typename Derived::Scalar Scalar;
|
||||
typedef typename Derived::Index Index;
|
||||
|
||||
|
@ -330,7 +330,7 @@ template<typename Derived> class MatrixBase
|
||||
/** \returns an \link ArrayBase Array \endlink expression of this matrix
|
||||
* \sa ArrayBase::matrix() */
|
||||
ArrayWrapper<Derived> array() { return derived(); }
|
||||
const ArrayWrapper<Derived> array() const { return derived(); }
|
||||
const ArrayWrapper<const Derived> array() const { return derived(); }
|
||||
|
||||
/////////// LU module ///////////
|
||||
|
||||
|
@ -511,7 +511,7 @@ class PermutationWrapper : public PermutationBase<PermutationWrapper<_IndicesTyp
|
||||
|
||||
protected:
|
||||
|
||||
const typename IndicesType::Nested m_indices;
|
||||
typename IndicesType::Nested m_indices;
|
||||
};
|
||||
|
||||
/** \returns the matrix with the permutation applied to the columns.
|
||||
@ -608,7 +608,7 @@ struct permut_matrix_product_retval
|
||||
|
||||
protected:
|
||||
const PermutationType& m_permutation;
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
};
|
||||
|
||||
/* Template partial specialization for transposed/inverse permutations */
|
||||
|
@ -179,8 +179,8 @@ class ProductBase : public MatrixBase<Derived>
|
||||
|
||||
protected:
|
||||
|
||||
const LhsNested m_lhs;
|
||||
const RhsNested m_rhs;
|
||||
LhsNested m_lhs;
|
||||
RhsNested m_rhs;
|
||||
|
||||
mutable PlainObject m_result;
|
||||
};
|
||||
|
@ -128,7 +128,7 @@ template<typename MatrixType,int RowFactor,int ColFactor> class Replicate
|
||||
}
|
||||
|
||||
protected:
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
const internal::variable_if_dynamic<Index, RowFactor> m_rowFactor;
|
||||
const internal::variable_if_dynamic<Index, ColFactor> m_colFactor;
|
||||
};
|
||||
|
@ -190,7 +190,7 @@ template<typename MatrixType, int Direction> class Reverse
|
||||
}
|
||||
|
||||
protected:
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
};
|
||||
|
||||
/** \returns an expression of the reverse of *this.
|
||||
|
@ -117,9 +117,9 @@ class Select : internal::no_assignment_operator,
|
||||
}
|
||||
|
||||
protected:
|
||||
const typename ConditionMatrixType::Nested m_condition;
|
||||
const typename ThenMatrixType::Nested m_then;
|
||||
const typename ElseMatrixType::Nested m_else;
|
||||
typename ConditionMatrixType::Nested m_condition;
|
||||
typename ThenMatrixType::Nested m_then;
|
||||
typename ElseMatrixType::Nested m_else;
|
||||
};
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ template<typename MatrixType, unsigned int UpLo> class SelfAdjointView
|
||||
};
|
||||
typedef typename MatrixType::PlainObject PlainObject;
|
||||
|
||||
inline SelfAdjointView(const MatrixType& matrix) : m_matrix(matrix)
|
||||
inline SelfAdjointView(MatrixType& matrix) : m_matrix(matrix)
|
||||
{}
|
||||
|
||||
inline Index rows() const { return m_matrix.rows(); }
|
||||
@ -199,7 +199,7 @@ template<typename MatrixType, unsigned int UpLo> class SelfAdjointView
|
||||
#endif
|
||||
|
||||
protected:
|
||||
const MatrixTypeNested m_matrix;
|
||||
MatrixTypeNested m_matrix;
|
||||
};
|
||||
|
||||
|
||||
|
@ -100,7 +100,7 @@ struct triangular_solver_selector<Lhs,Rhs,Side,Mode,NoUnrolling,Dynamic>
|
||||
typedef typename LhsProductTraits::DirectLinearAccessType ActualLhsType;
|
||||
static void run(const Lhs& lhs, Rhs& rhs)
|
||||
{
|
||||
const ActualLhsType actualLhs = LhsProductTraits::extract(lhs);
|
||||
typename internal::add_const_on_value_type<ActualLhsType>::type actualLhs = LhsProductTraits::extract(lhs);
|
||||
triangular_solve_matrix<Scalar,Index,Side,Mode,LhsProductTraits::NeedToConjugate,(int(Lhs::Flags) & RowMajorBit) ? RowMajor : ColMajor,
|
||||
(Rhs::Flags&RowMajorBit) ? RowMajor : ColMajor>
|
||||
::run(lhs.rows(), Side==OnTheLeft? rhs.cols() : rhs.rows(), &actualLhs.coeffRef(0,0), actualLhs.outerStride(), &rhs.coeffRef(0,0), rhs.outerStride());
|
||||
@ -255,7 +255,7 @@ template<int Side, typename TriangularType, typename Rhs> struct triangular_solv
|
||||
|
||||
protected:
|
||||
const TriangularType& m_triangularMatrix;
|
||||
const typename Rhs::Nested m_rhs;
|
||||
typename Rhs::Nested m_rhs;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
@ -53,6 +53,15 @@ template<typename ExpressionType> class SwapWrapper
|
||||
inline Index outerStride() const { return m_expression.outerStride(); }
|
||||
inline Index innerStride() const { return m_expression.innerStride(); }
|
||||
|
||||
typedef typename internal::conditional<
|
||||
internal::is_lvalue<ExpressionType>::value,
|
||||
Scalar,
|
||||
const Scalar
|
||||
>::type ScalarWithConstIfNotLvalue;
|
||||
|
||||
inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||
inline const Scalar* data() const { return m_expression.data(); }
|
||||
|
||||
inline Scalar& coeffRef(Index row, Index col)
|
||||
{
|
||||
return m_expression.const_cast_derived().coeffRef(row, col);
|
||||
|
@ -91,7 +91,7 @@ template<typename MatrixType> class Transpose
|
||||
nestedExpression() { return m_matrix.const_cast_derived(); }
|
||||
|
||||
protected:
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
@ -152,12 +152,12 @@ template<typename MatrixType> class TransposeImpl<MatrixType,Dense>
|
||||
return derived().nestedExpression().coeffRef(index);
|
||||
}
|
||||
|
||||
inline const CoeffReturnType coeff(Index row, Index col) const
|
||||
inline CoeffReturnType coeff(Index row, Index col) const
|
||||
{
|
||||
return derived().nestedExpression().coeff(col, row);
|
||||
}
|
||||
|
||||
inline const CoeffReturnType coeff(Index index) const
|
||||
inline CoeffReturnType coeff(Index index) const
|
||||
{
|
||||
return derived().nestedExpression().coeff(index);
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ struct transposition_matrix_product_retval
|
||||
|
||||
protected:
|
||||
const TranspositionType& m_transpositions;
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
|
@ -273,11 +273,8 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
||||
inline const TriangularView<MatrixConjugateReturnType,Mode> conjugate() const
|
||||
{ return m_matrix.conjugate(); }
|
||||
|
||||
/** \sa MatrixBase::adjoint() */
|
||||
inline TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> adjoint()
|
||||
{ return m_matrix.adjoint(); }
|
||||
/** \sa MatrixBase::adjoint() const */
|
||||
inline const TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> adjoint() const
|
||||
inline const TriangularView<const typename MatrixType::AdjointReturnType,TransposeMode> adjoint() const
|
||||
{ return m_matrix.adjoint(); }
|
||||
|
||||
/** \sa MatrixBase::transpose() */
|
||||
@ -288,7 +285,9 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
||||
}
|
||||
/** \sa MatrixBase::transpose() const */
|
||||
inline const TriangularView<Transpose<MatrixType>,TransposeMode> transpose() const
|
||||
{ return m_matrix.transpose(); }
|
||||
{
|
||||
return m_matrix.transpose();
|
||||
}
|
||||
|
||||
/** Efficient triangular matrix times vector/matrix product */
|
||||
template<typename OtherDerived>
|
||||
@ -375,7 +374,8 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
||||
template<typename OtherDerived>
|
||||
void swap(MatrixBase<OtherDerived> const & other)
|
||||
{
|
||||
TriangularView<SwapWrapper<MatrixType>,Mode>(const_cast<MatrixType&>(m_matrix)).lazyAssign(other.derived());
|
||||
SwapWrapper<MatrixType> swaper(const_cast<MatrixType&>(m_matrix));
|
||||
TriangularView<SwapWrapper<MatrixType>,Mode>(swaper).lazyAssign(other.derived());
|
||||
}
|
||||
|
||||
Scalar determinant() const
|
||||
@ -433,7 +433,7 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
|
||||
template<typename ProductDerived, typename Lhs, typename Rhs>
|
||||
EIGEN_STRONG_INLINE TriangularView& assignProduct(const ProductBase<ProductDerived, Lhs,Rhs>& prod, const Scalar& alpha);
|
||||
|
||||
const MatrixTypeNested m_matrix;
|
||||
MatrixTypeNested m_matrix;
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -110,7 +110,7 @@ class PartialReduxExpr : internal::no_assignment_operator,
|
||||
}
|
||||
|
||||
protected:
|
||||
const MatrixTypeNested m_matrix;
|
||||
MatrixTypeNested m_matrix;
|
||||
const MemberOp m_functor;
|
||||
};
|
||||
|
||||
|
@ -224,8 +224,8 @@ class CoeffBasedProduct
|
||||
{ return reinterpret_cast<const LazyCoeffBasedProductType&>(*this).diagonal(index); }
|
||||
|
||||
protected:
|
||||
const LhsNested m_lhs;
|
||||
const RhsNested m_rhs;
|
||||
typename internal::add_const_on_value_type<LhsNested>::type m_lhs;
|
||||
typename internal::add_const_on_value_type<RhsNested>::type m_rhs;
|
||||
|
||||
mutable PlainObject m_result;
|
||||
};
|
||||
|
@ -412,8 +412,8 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
|
||||
{
|
||||
eigen_assert(dst.rows()==m_lhs.rows() && dst.cols()==m_rhs.cols());
|
||||
|
||||
const ActualLhsType lhs = LhsBlasTraits::extract(m_lhs);
|
||||
const ActualRhsType rhs = RhsBlasTraits::extract(m_rhs);
|
||||
typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(m_lhs);
|
||||
typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(m_rhs);
|
||||
|
||||
Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs)
|
||||
* RhsBlasTraits::extractScalarFactor(m_rhs);
|
||||
|
@ -201,13 +201,13 @@ TriangularView<MatrixType,UpLo>& TriangularView<MatrixType,UpLo>::assignProduct(
|
||||
typedef internal::blas_traits<Lhs> LhsBlasTraits;
|
||||
typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhs;
|
||||
typedef typename internal::remove_all<ActualLhs>::type _ActualLhs;
|
||||
const ActualLhs actualLhs = LhsBlasTraits::extract(prod.lhs());
|
||||
typename internal::add_const_on_value_type<ActualLhs>::type actualLhs = LhsBlasTraits::extract(prod.lhs());
|
||||
|
||||
typedef typename internal::remove_all<typename ProductDerived::RhsNested>::type Rhs;
|
||||
typedef internal::blas_traits<Rhs> RhsBlasTraits;
|
||||
typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhs;
|
||||
typedef typename internal::remove_all<ActualRhs>::type _ActualRhs;
|
||||
const ActualRhs actualRhs = RhsBlasTraits::extract(prod.rhs());
|
||||
typename internal::add_const_on_value_type<ActualRhs>::type actualRhs = RhsBlasTraits::extract(prod.rhs());
|
||||
|
||||
typename ProductDerived::Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs().derived()) * RhsBlasTraits::extractScalarFactor(prod.rhs().derived());
|
||||
|
||||
|
@ -400,8 +400,8 @@ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,RhsMode,false>
|
||||
{
|
||||
eigen_assert(dst.rows()==m_lhs.rows() && dst.cols()==m_rhs.cols());
|
||||
|
||||
const ActualLhsType lhs = LhsBlasTraits::extract(m_lhs);
|
||||
const ActualRhsType rhs = RhsBlasTraits::extract(m_rhs);
|
||||
typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(m_lhs);
|
||||
typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(m_rhs);
|
||||
|
||||
Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs)
|
||||
* RhsBlasTraits::extractScalarFactor(m_rhs);
|
||||
|
@ -201,8 +201,8 @@ struct SelfadjointProductMatrix<Lhs,LhsMode,false,Rhs,0,true>
|
||||
|
||||
eigen_assert(dest.rows()==m_lhs.rows() && dest.cols()==m_rhs.cols());
|
||||
|
||||
const ActualLhsType lhs = LhsBlasTraits::extract(m_lhs);
|
||||
const ActualRhsType rhs = RhsBlasTraits::extract(m_rhs);
|
||||
typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(m_lhs);
|
||||
typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(m_rhs);
|
||||
|
||||
Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs)
|
||||
* RhsBlasTraits::extractScalarFactor(m_rhs);
|
||||
|
@ -72,7 +72,7 @@ struct selfadjoint_product_selector<MatrixType,OtherType,UpLo,true>
|
||||
typedef internal::blas_traits<OtherType> OtherBlasTraits;
|
||||
typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType;
|
||||
typedef typename internal::remove_all<ActualOtherType>::type _ActualOtherType;
|
||||
const ActualOtherType actualOther = OtherBlasTraits::extract(other.derived());
|
||||
typename internal::add_const_on_value_type<ActualOtherType>::type actualOther = OtherBlasTraits::extract(other.derived());
|
||||
|
||||
Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived());
|
||||
|
||||
@ -105,7 +105,7 @@ struct selfadjoint_product_selector<MatrixType,OtherType,UpLo,false>
|
||||
typedef internal::blas_traits<OtherType> OtherBlasTraits;
|
||||
typedef typename OtherBlasTraits::DirectLinearAccessType ActualOtherType;
|
||||
typedef typename internal::remove_all<ActualOtherType>::type _ActualOtherType;
|
||||
const ActualOtherType actualOther = OtherBlasTraits::extract(other.derived());
|
||||
typename internal::add_const_on_value_type<ActualOtherType>::type actualOther = OtherBlasTraits::extract(other.derived());
|
||||
|
||||
Scalar actualAlpha = alpha * OtherBlasTraits::extractScalarFactor(other.derived());
|
||||
|
||||
|
@ -76,12 +76,12 @@ SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo>
|
||||
typedef internal::blas_traits<DerivedU> UBlasTraits;
|
||||
typedef typename UBlasTraits::DirectLinearAccessType ActualUType;
|
||||
typedef typename internal::remove_all<ActualUType>::type _ActualUType;
|
||||
const ActualUType actualU = UBlasTraits::extract(u.derived());
|
||||
typename internal::add_const_on_value_type<ActualUType>::type actualU = UBlasTraits::extract(u.derived());
|
||||
|
||||
typedef internal::blas_traits<DerivedV> VBlasTraits;
|
||||
typedef typename VBlasTraits::DirectLinearAccessType ActualVType;
|
||||
typedef typename internal::remove_all<ActualVType>::type _ActualVType;
|
||||
const ActualVType actualV = VBlasTraits::extract(v.derived());
|
||||
typename internal::add_const_on_value_type<ActualVType>::type actualV = VBlasTraits::extract(v.derived());
|
||||
|
||||
// If MatrixType is row major, then we use the routine for lower triangular in the upper triangular case and
|
||||
// vice versa, and take the complex conjugate of all coefficients and vector entries.
|
||||
|
@ -378,8 +378,8 @@ struct TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,false>
|
||||
|
||||
template<typename Dest> void scaleAndAddTo(Dest& dst, Scalar alpha) const
|
||||
{
|
||||
const ActualLhsType lhs = LhsBlasTraits::extract(m_lhs);
|
||||
const ActualRhsType rhs = RhsBlasTraits::extract(m_rhs);
|
||||
typename internal::add_const_on_value_type<ActualLhsType>::type lhs = LhsBlasTraits::extract(m_lhs);
|
||||
typename internal::add_const_on_value_type<ActualRhsType>::type rhs = RhsBlasTraits::extract(m_rhs);
|
||||
|
||||
Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs)
|
||||
* RhsBlasTraits::extractScalarFactor(m_rhs);
|
||||
|
@ -232,8 +232,8 @@ template<> struct trmv_selector<ColMajor>
|
||||
typedef typename ProductType::RhsBlasTraits RhsBlasTraits;
|
||||
typedef Map<Matrix<ResScalar,Dynamic,1>, Aligned> MappedDest;
|
||||
|
||||
const ActualLhsType actualLhs = LhsBlasTraits::extract(prod.lhs());
|
||||
const ActualRhsType actualRhs = RhsBlasTraits::extract(prod.rhs());
|
||||
typename internal::add_const_on_value_type<ActualLhsType>::type actualLhs = LhsBlasTraits::extract(prod.lhs());
|
||||
typename internal::add_const_on_value_type<ActualRhsType>::type actualRhs = RhsBlasTraits::extract(prod.rhs());
|
||||
|
||||
ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs())
|
||||
* RhsBlasTraits::extractScalarFactor(prod.rhs());
|
||||
|
@ -175,7 +175,7 @@ template<typename XprType> struct blas_traits
|
||||
ExtractType,
|
||||
typename _ExtractType::PlainObject
|
||||
>::type DirectLinearAccessType;
|
||||
static inline const ExtractType extract(const XprType& x) { return x; }
|
||||
static inline ExtractType extract(const XprType& x) { return x; }
|
||||
static inline const Scalar extractScalarFactor(const XprType&) { return Scalar(1); }
|
||||
};
|
||||
|
||||
@ -192,7 +192,7 @@ struct blas_traits<CwiseUnaryOp<scalar_conjugate_op<Scalar>, NestedXpr> >
|
||||
IsComplex = NumTraits<Scalar>::IsComplex,
|
||||
NeedToConjugate = Base::NeedToConjugate ? 0 : IsComplex
|
||||
};
|
||||
static inline const ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
||||
static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
||||
static inline Scalar extractScalarFactor(const XprType& x) { return conj(Base::extractScalarFactor(x.nestedExpression())); }
|
||||
};
|
||||
|
||||
@ -204,7 +204,7 @@ struct blas_traits<CwiseUnaryOp<scalar_multiple_op<Scalar>, NestedXpr> >
|
||||
typedef blas_traits<NestedXpr> Base;
|
||||
typedef CwiseUnaryOp<scalar_multiple_op<Scalar>, NestedXpr> XprType;
|
||||
typedef typename Base::ExtractType ExtractType;
|
||||
static inline const ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
||||
static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
||||
static inline Scalar extractScalarFactor(const XprType& x)
|
||||
{ return x.functor().m_other * Base::extractScalarFactor(x.nestedExpression()); }
|
||||
};
|
||||
@ -217,7 +217,7 @@ struct blas_traits<CwiseUnaryOp<scalar_opposite_op<Scalar>, NestedXpr> >
|
||||
typedef blas_traits<NestedXpr> Base;
|
||||
typedef CwiseUnaryOp<scalar_opposite_op<Scalar>, NestedXpr> XprType;
|
||||
typedef typename Base::ExtractType ExtractType;
|
||||
static inline const ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
||||
static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
||||
static inline Scalar extractScalarFactor(const XprType& x)
|
||||
{ return - Base::extractScalarFactor(x.nestedExpression()); }
|
||||
};
|
||||
@ -239,7 +239,7 @@ struct blas_traits<Transpose<NestedXpr> >
|
||||
enum {
|
||||
IsTransposed = Base::IsTransposed ? 0 : 1
|
||||
};
|
||||
static inline const ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
||||
static inline ExtractType extract(const XprType& x) { return Base::extract(x.nestedExpression()); }
|
||||
static inline Scalar extractScalarFactor(const XprType& x) { return Base::extractScalarFactor(x.nestedExpression()); }
|
||||
};
|
||||
|
||||
@ -252,7 +252,7 @@ template<typename T, bool HasUsableDirectAccess=blas_traits<T>::HasUsableDirectA
|
||||
struct extract_data_selector {
|
||||
static const typename T::Scalar* run(const T& m)
|
||||
{
|
||||
return const_cast<typename T::Scalar*>(&blas_traits<T>::extract(m).coeffRef(0,0)); // FIXME this should be .data()
|
||||
return blas_traits<T>::extract(m).data();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -260,30 +260,27 @@ template<typename T> struct plain_matrix_type_row_major
|
||||
// we should be able to get rid of this one too
|
||||
template<typename T> struct must_nest_by_value { enum { ret = false }; };
|
||||
|
||||
template<class T>
|
||||
struct is_reference
|
||||
{
|
||||
enum { ret = false };
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct is_reference<T&>
|
||||
{
|
||||
enum { ret = true };
|
||||
};
|
||||
|
||||
/**
|
||||
* \internal The reference selector for template expressions. The idea is that we don't
|
||||
/** \internal 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.
|
||||
**/
|
||||
* objects which should generate no copying overhead. */
|
||||
template <typename T>
|
||||
struct ref_selector
|
||||
{
|
||||
typedef typename conditional<
|
||||
bool(traits<T>::Flags & NestByRefBit),
|
||||
T const&,
|
||||
T
|
||||
const T
|
||||
>::type type;
|
||||
};
|
||||
|
||||
/** \internal Adds the const qualifier on the value-type of T2 if and only if T1 is a const type */
|
||||
template<typename T1, typename T2>
|
||||
struct transfer_constness
|
||||
{
|
||||
typedef typename conditional<
|
||||
bool(internal::is_const<T1>::value),
|
||||
typename internal::add_const_on_value_type<T2>::type,
|
||||
T2
|
||||
>::type type;
|
||||
};
|
||||
|
||||
@ -297,6 +294,8 @@ struct ref_selector
|
||||
* \param T the type of the expression being nested
|
||||
* \param n the number of coefficient accesses in the nested expression for each coefficient access in the bigger expression.
|
||||
*
|
||||
* Note that if no evaluation occur, then the constness of T is preserved.
|
||||
*
|
||||
* Example. Suppose that a, b, and c are of type Matrix3d. The user forms the expression a*(b+c).
|
||||
* b+c is an expression "sum of matrices", which we will denote by S. In order to determine how to nest it,
|
||||
* the Product expression uses: nested<S, 3>::ret, which turns out to be Matrix3d because the internal logic of
|
||||
|
@ -97,13 +97,13 @@ template<typename _MatrixType> class Tridiagonalization
|
||||
typedef internal::TridiagonalizationMatrixTReturnType<MatrixTypeRealView> MatrixTReturnType;
|
||||
|
||||
typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
|
||||
const typename Diagonal<const MatrixType>::RealReturnType,
|
||||
typename internal::add_const_on_value_type<typename Diagonal<const MatrixType>::RealReturnType>::type,
|
||||
const Diagonal<const MatrixType>
|
||||
>::type DiagonalReturnType;
|
||||
|
||||
typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
|
||||
const typename Diagonal<
|
||||
Block<const MatrixType,SizeMinusOne,SizeMinusOne> >::RealReturnType,
|
||||
typename internal::add_const_on_value_type<typename Diagonal<
|
||||
Block<const MatrixType,SizeMinusOne,SizeMinusOne> >::RealReturnType>::type,
|
||||
const Diagonal<
|
||||
Block<const MatrixType,SizeMinusOne,SizeMinusOne> >
|
||||
>::type SubDiagonalReturnType;
|
||||
@ -560,7 +560,7 @@ template<typename MatrixType> struct TridiagonalizationMatrixTReturnType
|
||||
Index cols() const { return m_matrix.cols(); }
|
||||
|
||||
protected:
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
|
@ -190,7 +190,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
|
||||
template<typename Derived>
|
||||
inline bool contains(const MatrixBase<Derived>& a_p) const
|
||||
{
|
||||
const typename internal::nested<Derived,2>::type p(a_p.derived());
|
||||
typename internal::nested<Derived,2>::type p(a_p.derived());
|
||||
return (m_min.array()<=p.array()).all() && (p.array()<=m_max.array()).all();
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
|
||||
template<typename Derived>
|
||||
inline AlignedBox& extend(const MatrixBase<Derived>& a_p)
|
||||
{
|
||||
const typename internal::nested<Derived,2>::type p(a_p.derived());
|
||||
typename internal::nested<Derived,2>::type p(a_p.derived());
|
||||
m_min = m_min.cwiseMin(p);
|
||||
m_max = m_max.cwiseMax(p);
|
||||
return *this;
|
||||
|
@ -121,7 +121,7 @@ template<typename MatrixType,int _Direction> class Homogeneous
|
||||
}
|
||||
|
||||
protected:
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
};
|
||||
|
||||
/** \geometry_module
|
||||
@ -216,8 +216,8 @@ template<typename Scalar, int Dim, int Mode,int Options>
|
||||
struct take_matrix_for_product<Transform<Scalar, Dim, Mode, Options> >
|
||||
{
|
||||
typedef Transform<Scalar, Dim, Mode, Options> TransformType;
|
||||
typedef typename TransformType::ConstAffinePart type;
|
||||
static const type run (const TransformType& x) { return x.affine(); }
|
||||
typedef typename internal::add_const<typename TransformType::ConstAffinePart>::type type;
|
||||
static type run (const TransformType& x) { return x.affine(); }
|
||||
};
|
||||
|
||||
template<typename Scalar, int Dim, int Options>
|
||||
@ -270,8 +270,8 @@ struct homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
|
||||
.template replicate<MatrixType::ColsAtCompileTime>(m_rhs.cols());
|
||||
}
|
||||
|
||||
const typename LhsMatrixTypeCleaned::Nested m_lhs;
|
||||
const typename MatrixType::Nested m_rhs;
|
||||
typename LhsMatrixTypeCleaned::Nested m_lhs;
|
||||
typename MatrixType::Nested m_rhs;
|
||||
};
|
||||
|
||||
template<typename MatrixType,typename Rhs>
|
||||
@ -309,8 +309,8 @@ struct homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs>
|
||||
.template replicate<MatrixType::RowsAtCompileTime>(m_lhs.rows());
|
||||
}
|
||||
|
||||
const typename MatrixType::Nested m_lhs;
|
||||
const typename Rhs::Nested m_rhs;
|
||||
typename MatrixType::Nested m_lhs;
|
||||
typename Rhs::Nested m_rhs;
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
|
@ -43,8 +43,8 @@ MatrixBase<Derived>::cross(const MatrixBase<OtherDerived>& other) const
|
||||
|
||||
// Note that there is no need for an expression here since the compiler
|
||||
// optimize such a small temporary very well (even within a complex expression)
|
||||
const typename internal::nested<Derived,2>::type lhs(derived());
|
||||
const typename internal::nested<OtherDerived,2>::type rhs(other.derived());
|
||||
typename internal::nested<Derived,2>::type lhs(derived());
|
||||
typename internal::nested<OtherDerived,2>::type rhs(other.derived());
|
||||
return typename cross_product_return_type<OtherDerived>::type(
|
||||
internal::conj(lhs.coeff(1) * rhs.coeff(2) - lhs.coeff(2) * rhs.coeff(1)),
|
||||
internal::conj(lhs.coeff(2) * rhs.coeff(0) - lhs.coeff(0) * rhs.coeff(2)),
|
||||
|
@ -64,7 +64,7 @@ void apply_block_householder_on_the_left(MatrixType& mat, const VectorsType& vec
|
||||
Matrix<typename MatrixType::Scalar, TFactorSize, TFactorSize> T(nbVecs,nbVecs);
|
||||
make_block_householder_triangular_factor(T, vectors, hCoeffs);
|
||||
|
||||
const TriangularView<VectorsType, UnitLower>& V(vectors);
|
||||
const TriangularView<const VectorsType, UnitLower>& V(vectors);
|
||||
|
||||
// A -= V T V^* A
|
||||
Matrix<typename MatrixType::Scalar,VectorsType::ColsAtCompileTime,MatrixType::ColsAtCompileTime,0,
|
||||
|
@ -286,7 +286,7 @@ struct inverse_impl : public ReturnByValue<inverse_impl<MatrixType> >
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename internal::eval<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename remove_all<MatrixTypeNested>::type MatrixTypeNestedCleaned;
|
||||
const MatrixTypeNested m_matrix;
|
||||
MatrixTypeNested m_matrix;
|
||||
|
||||
inverse_impl(const MatrixType& matrix)
|
||||
: m_matrix(matrix)
|
||||
|
@ -150,7 +150,7 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
|
||||
elen[i] = 0; // Ek of node i is empty
|
||||
degree[i] = len[i]; // degree of node i
|
||||
}
|
||||
mark = cs_wclear<Index>(0, 0, w, n); /* clear w */
|
||||
mark = internal::cs_wclear<Index>(0, 0, w, n); /* clear w */
|
||||
elen[n] = -2; /* n is a dead element */
|
||||
Cp[n] = -1; /* n is a root of assembly tree */
|
||||
w[n] = 0; /* n is a dead element */
|
||||
@ -265,7 +265,7 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
|
||||
elen[k] = -2; /* k is now an element */
|
||||
|
||||
/* --- Find set differences ----------------------------------------- */
|
||||
mark = cs_wclear<Index>(mark, lemax, w, n); /* clear w if necessary */
|
||||
mark = internal::cs_wclear<Index>(mark, lemax, w, n); /* clear w if necessary */
|
||||
for(pk = pk1; pk < pk2; pk++) /* scan 1: find |Le\Lk| */
|
||||
{
|
||||
i = Ci[pk];
|
||||
@ -348,7 +348,7 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
|
||||
} /* scan2 is done */
|
||||
degree[k] = dk; /* finalize |Lk| */
|
||||
lemax = std::max<Index>(lemax, dk);
|
||||
mark = cs_wclear<Index>(mark+lemax, lemax, w, n); /* clear w */
|
||||
mark = internal::cs_wclear<Index>(mark+lemax, lemax, w, n); /* clear w */
|
||||
|
||||
/* --- Supernode detection ------------------------------------------ */
|
||||
for(pk = pk1; pk < pk2; pk++)
|
||||
@ -434,7 +434,7 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
|
||||
}
|
||||
for(k = 0, i = 0; i <= n; i++) /* postorder the assembly tree */
|
||||
{
|
||||
if(Cp[i] == -1) k = cs_tdfs<Index>(i, k, head, next, perm.indices().data(), w);
|
||||
if(Cp[i] == -1) k = internal::cs_tdfs<Index>(i, k, head, next, perm.indices().data(), w);
|
||||
}
|
||||
|
||||
perm.indices().conservativeResize(n);
|
||||
|
@ -577,9 +577,9 @@ public:
|
||||
Index cols() const { return m_qr.rows(); }
|
||||
|
||||
protected:
|
||||
const typename MatrixType::Nested m_qr;
|
||||
const typename HCoeffsType::Nested m_hCoeffs;
|
||||
const typename IntColVectorType::Nested m_rowsTranspositions;
|
||||
typename MatrixType::Nested m_qr;
|
||||
typename HCoeffsType::Nested m_hCoeffs;
|
||||
typename IntColVectorType::Nested m_rowsTranspositions;
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
|
@ -267,7 +267,7 @@ class SparseInnerVectorSet<SparseMatrix<_Scalar, _Options, _Index>, Size>
|
||||
|
||||
protected:
|
||||
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
Index m_outerStart;
|
||||
const internal::variable_if_dynamic<Index, Size> m_outerSize;
|
||||
|
||||
|
@ -255,7 +255,7 @@ class sparse_cwise_binary_op_inner_iterator_selector<scalar_product_op<T>, Lhs,
|
||||
EIGEN_STRONG_INLINE operator bool() const { return m_lhsIter; }
|
||||
|
||||
protected:
|
||||
const RhsNested m_rhs;
|
||||
RhsNested m_rhs;
|
||||
LhsIterator m_lhsIter;
|
||||
const BinaryFunc m_functor;
|
||||
const Index m_outer;
|
||||
|
@ -38,11 +38,11 @@ struct SparseSparseProductReturnType
|
||||
|
||||
typedef typename internal::conditional<TransposeLhs,
|
||||
SparseMatrix<Scalar,0>,
|
||||
const typename internal::nested<Lhs,Rhs::RowsAtCompileTime>::type>::type LhsNested;
|
||||
typename internal::nested<Lhs,Rhs::RowsAtCompileTime>::type>::type LhsNested;
|
||||
|
||||
typedef typename internal::conditional<TransposeRhs,
|
||||
SparseMatrix<Scalar,0>,
|
||||
const typename internal::nested<Rhs,Lhs::RowsAtCompileTime>::type>::type RhsNested;
|
||||
typename internal::nested<Rhs,Lhs::RowsAtCompileTime>::type>::type RhsNested;
|
||||
|
||||
typedef SparseSparseProduct<LhsNested, RhsNested> Type;
|
||||
};
|
||||
|
@ -145,7 +145,7 @@ template<typename MatrixType, unsigned int UpLo> class SparseSelfAdjointView
|
||||
|
||||
protected:
|
||||
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
typename MatrixType::Nested m_matrix;
|
||||
mutable VectorI m_countPerRow;
|
||||
mutable VectorI m_countPerCol;
|
||||
};
|
||||
@ -448,7 +448,7 @@ class SparseSymmetricPermutationProduct
|
||||
}
|
||||
|
||||
protected:
|
||||
const MatrixTypeNested m_matrix;
|
||||
MatrixTypeNested m_matrix;
|
||||
const Perm& m_perm;
|
||||
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ template<typename MatrixType, int Mode> class SparseTriangularView
|
||||
template<typename OtherDerived> void solveInPlace(SparseMatrixBase<OtherDerived>& other) const;
|
||||
|
||||
protected:
|
||||
const MatrixTypeNested m_matrix;
|
||||
MatrixTypeNested m_matrix;
|
||||
};
|
||||
|
||||
template<typename MatrixType, int Mode>
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
inline Index outerSize() const { return m_matrix.outerSize(); }
|
||||
|
||||
protected:
|
||||
const MatrixTypeNested m_matrix;
|
||||
MatrixTypeNested m_matrix;
|
||||
Scalar m_reference;
|
||||
typename NumTraits<Scalar>::Real m_epsilon;
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ template<typename _DecompositionType, typename Rhs> struct solve_retval_base
|
||||
|
||||
protected:
|
||||
const DecompositionType& m_dec;
|
||||
const typename Rhs::Nested m_rhs;
|
||||
typename Rhs::Nested m_rhs;
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
|
@ -61,7 +61,7 @@ template<typename _DecompositionType, typename Rhs> struct sparse_solve_retval_b
|
||||
|
||||
protected:
|
||||
const DecompositionType& m_dec;
|
||||
const typename Rhs::Nested m_rhs;
|
||||
typename Rhs::Nested m_rhs;
|
||||
};
|
||||
|
||||
#define EIGEN_MAKE_SPARSE_SOLVE_HELPERS(DecompositionType,Rhs) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user