mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
a couple of fixes after thye merge
This commit is contained in:
parent
eaaba30cac
commit
fcc3be5dce
@ -29,8 +29,9 @@
|
||||
*
|
||||
*/
|
||||
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<_Rhs>::type Rhs;
|
||||
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>,
|
||||
typename NestedProduct::_LhsNested,
|
||||
typename NestedProduct::_RhsNested> >
|
||||
{};
|
||||
{
|
||||
typedef typename ei_traits<NestedProduct>::StorageType StorageType;
|
||||
};
|
||||
|
||||
template<typename NestedProduct>
|
||||
class ScaledProduct
|
||||
|
@ -465,7 +465,7 @@ TriangularView<MatrixType, Mode>::operator=(const MatrixBase<OtherDerived>& othe
|
||||
{
|
||||
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());
|
||||
lazyAssign(other_evaluated);
|
||||
}
|
||||
@ -536,7 +536,7 @@ void TriangularBase<Derived>::evalTo(MatrixBase<DenseDerived> &other) const
|
||||
{
|
||||
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);
|
||||
other.derived().swap(other_evaluated);
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ VectorwiseOp<ExpressionType,Direction>::hnormalized() const
|
||||
return HNormalized_Block(_expression(),0,0,
|
||||
Direction==Vertical ? _expression().rows()-1 : _expression().rows(),
|
||||
Direction==Horizontal ? _expression().cols()-1 : _expression().cols()).cwiseQuotient(
|
||||
Replicate<NestByValue<HNormalized_Factors>,
|
||||
Replicate<HNormalized_Factors,
|
||||
Direction==Vertical ? HNormalized_SizeMinusOne : 1,
|
||||
Direction==Horizontal ? HNormalized_SizeMinusOne : 1>
|
||||
(HNormalized_Factors(_expression(),
|
||||
|
@ -203,7 +203,7 @@ struct ei_compute_inverse_size4
|
||||
result.coeffRef(1,3) = matrix.minor(3,1).determinant();
|
||||
result.coeffRef(2,3) = -matrix.minor(3,2).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,
|
||||
MatrixType, ResultType>
|
||||
{
|
||||
// FIXME empty?
|
||||
};
|
||||
|
||||
template<typename MatrixType, typename ResultType>
|
||||
|
@ -144,7 +144,9 @@ SparseSelfAdjointView<MatrixType,UpLo>::rankUpdate(const MatrixBase<DerivedU>& u
|
||||
template<typename Lhs, typename Rhs, int UpLo>
|
||||
struct ei_traits<SparseSelfAdjointTimeDenseProduct<Lhs,Rhs,UpLo> >
|
||||
: ei_traits<ProductBase<SparseSelfAdjointTimeDenseProduct<Lhs,Rhs,UpLo>, Lhs, Rhs> >
|
||||
{};
|
||||
{
|
||||
typedef Dense StorageType;
|
||||
};
|
||||
|
||||
template<typename Lhs, typename Rhs, int UpLo>
|
||||
class SparseSelfAdjointTimeDenseProduct
|
||||
|
@ -155,4 +155,15 @@ template<typename T> class ei_eval<T,Sparse>
|
||||
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
|
||||
|
@ -61,7 +61,7 @@ template<typename SparseMatrixType> void sparse_product(const SparseMatrixType&
|
||||
|
||||
VERIFY_IS_APPROX(dm4=m2*(refMat3+refMat3), refMat4=refMat2*(refMat3+refMat3));
|
||||
VERIFY_IS_APPROX(dm4=m2.transpose()*(refMat3+refMat5)*0.5, refMat4=refMat2.transpose()*(refMat3+refMat5)*0.5);
|
||||
|
||||
|
||||
// dense * sparse
|
||||
VERIFY_IS_APPROX(dm4=refMat2*m3, refMat4=refMat2*refMat3);
|
||||
VERIFY_IS_APPROX(dm4=refMat2*m3.transpose(), refMat4=refMat2*refMat3.transpose());
|
||||
|
Loading…
x
Reference in New Issue
Block a user