a couple of fixes after thye merge

This commit is contained in:
Gael Guennebaud 2009-12-23 09:07:01 +01:00
parent eaaba30cac
commit fcc3be5dce
7 changed files with 24 additions and 9 deletions

View File

@ -29,8 +29,9 @@
* *
*/ */
template<typename Derived, typename _Lhs, typename _Rhs> template<typename Derived, typename _Lhs, typename _Rhs>
struct ei_traits<ProductBase<Derived,_Lhs,_Rhs> > : ei_traits<typename ei_cleantype<_Lhs>::type> struct ei_traits<ProductBase<Derived,_Lhs,_Rhs> > //: ei_traits<typename ei_cleantype<_Lhs>::type>
{ {
typedef DenseStorageMatrix DenseStorageType;
typedef typename ei_cleantype<_Lhs>::type Lhs; typedef typename ei_cleantype<_Lhs>::type Lhs;
typedef typename ei_cleantype<_Rhs>::type Rhs; typedef typename ei_cleantype<_Rhs>::type Rhs;
typedef typename ei_scalar_product_traits<typename Lhs::Scalar, typename Rhs::Scalar>::ReturnType Scalar; typedef typename ei_scalar_product_traits<typename Lhs::Scalar, typename Rhs::Scalar>::ReturnType Scalar;
@ -172,7 +173,9 @@ struct ei_traits<ScaledProduct<NestedProduct> >
: ei_traits<ProductBase<ScaledProduct<NestedProduct>, : ei_traits<ProductBase<ScaledProduct<NestedProduct>,
typename NestedProduct::_LhsNested, typename NestedProduct::_LhsNested,
typename NestedProduct::_RhsNested> > typename NestedProduct::_RhsNested> >
{}; {
typedef typename ei_traits<NestedProduct>::StorageType StorageType;
};
template<typename NestedProduct> template<typename NestedProduct>
class ScaledProduct class ScaledProduct

View File

@ -465,7 +465,7 @@ TriangularView<MatrixType, Mode>::operator=(const MatrixBase<OtherDerived>& othe
{ {
if(OtherDerived::Flags & EvalBeforeAssigningBit) if(OtherDerived::Flags & EvalBeforeAssigningBit)
{ {
typename OtherDerived::PlainMatrixType other_evaluated(other.rows(), other.cols()); typename ei_plain_matrix_type<OtherDerived>::type other_evaluated(other.rows(), other.cols());
other_evaluated.template triangularView<Mode>().lazyAssign(other.derived()); other_evaluated.template triangularView<Mode>().lazyAssign(other.derived());
lazyAssign(other_evaluated); lazyAssign(other_evaluated);
} }
@ -536,7 +536,7 @@ void TriangularBase<Derived>::evalTo(MatrixBase<DenseDerived> &other) const
{ {
if(ei_traits<Derived>::Flags & EvalBeforeAssigningBit) if(ei_traits<Derived>::Flags & EvalBeforeAssigningBit)
{ {
typename Derived::PlainMatrixType other_evaluated(rows(), cols()); typename ei_plain_matrix_type<Derived>::type other_evaluated(rows(), cols());
evalToLazy(other_evaluated); evalToLazy(other_evaluated);
other.derived().swap(other_evaluated); other.derived().swap(other_evaluated);
} }

View File

@ -194,7 +194,7 @@ VectorwiseOp<ExpressionType,Direction>::hnormalized() const
return HNormalized_Block(_expression(),0,0, return HNormalized_Block(_expression(),0,0,
Direction==Vertical ? _expression().rows()-1 : _expression().rows(), Direction==Vertical ? _expression().rows()-1 : _expression().rows(),
Direction==Horizontal ? _expression().cols()-1 : _expression().cols()).cwiseQuotient( Direction==Horizontal ? _expression().cols()-1 : _expression().cols()).cwiseQuotient(
Replicate<NestByValue<HNormalized_Factors>, Replicate<HNormalized_Factors,
Direction==Vertical ? HNormalized_SizeMinusOne : 1, Direction==Vertical ? HNormalized_SizeMinusOne : 1,
Direction==Horizontal ? HNormalized_SizeMinusOne : 1> Direction==Horizontal ? HNormalized_SizeMinusOne : 1>
(HNormalized_Factors(_expression(), (HNormalized_Factors(_expression(),

View File

@ -203,7 +203,7 @@ struct ei_compute_inverse_size4
result.coeffRef(1,3) = matrix.minor(3,1).determinant(); result.coeffRef(1,3) = matrix.minor(3,1).determinant();
result.coeffRef(2,3) = -matrix.minor(3,2).determinant(); result.coeffRef(2,3) = -matrix.minor(3,2).determinant();
result.coeffRef(3,3) = matrix.minor(3,3).determinant(); result.coeffRef(3,3) = matrix.minor(3,3).determinant();
result /= (matrix.col(0).cwise()*result.row(0).transpose()).sum(); result /= (matrix.col(0).cwiseProduct(result.row(0).transpose())).sum();
} }
}; };
@ -212,7 +212,6 @@ struct ei_compute_inverse<MatrixType, ResultType, 4>
: ei_compute_inverse_size4<Architecture::Target, typename MatrixType::Scalar, : ei_compute_inverse_size4<Architecture::Target, typename MatrixType::Scalar,
MatrixType, ResultType> MatrixType, ResultType>
{ {
// FIXME empty?
}; };
template<typename MatrixType, typename ResultType> template<typename MatrixType, typename ResultType>

View File

@ -144,7 +144,9 @@ SparseSelfAdjointView<MatrixType,UpLo>::rankUpdate(const MatrixBase<DerivedU>& u
template<typename Lhs, typename Rhs, int UpLo> template<typename Lhs, typename Rhs, int UpLo>
struct ei_traits<SparseSelfAdjointTimeDenseProduct<Lhs,Rhs,UpLo> > struct ei_traits<SparseSelfAdjointTimeDenseProduct<Lhs,Rhs,UpLo> >
: ei_traits<ProductBase<SparseSelfAdjointTimeDenseProduct<Lhs,Rhs,UpLo>, Lhs, Rhs> > : ei_traits<ProductBase<SparseSelfAdjointTimeDenseProduct<Lhs,Rhs,UpLo>, Lhs, Rhs> >
{}; {
typedef Dense StorageType;
};
template<typename Lhs, typename Rhs, int UpLo> template<typename Lhs, typename Rhs, int UpLo>
class SparseSelfAdjointTimeDenseProduct class SparseSelfAdjointTimeDenseProduct

View File

@ -155,4 +155,15 @@ template<typename T> class ei_eval<T,Sparse>
typedef SparseMatrix<_Scalar, _Flags> type; typedef SparseMatrix<_Scalar, _Flags> type;
}; };
template<typename T> struct ei_plain_matrix_type<T,Sparse>
{
typedef typename ei_traits<T>::Scalar _Scalar;
enum {
_Flags = ei_traits<T>::Flags
};
public:
typedef SparseMatrix<_Scalar, _Flags> type;
};
#endif // EIGEN_SPARSEUTIL_H #endif // EIGEN_SPARSEUTIL_H