mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix bugs and clean up SparseCore module
libeigen/eigen!2250 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
committed by
Charles Schlosser
parent
daecd28cd5
commit
cc8c7cf0e6
@@ -238,8 +238,8 @@ Scalar_& AmbiVector<Scalar_, StorageIndex_>::coeff(Index i) {
|
||||
Index elid = m_llStart;
|
||||
while (elid >= 0 && llElements[elid].index < i) elid = llElements[elid].next;
|
||||
|
||||
if (llElements[elid].index == i)
|
||||
return llElements[m_llCurrent].value;
|
||||
if (elid >= 0 && llElements[elid].index == i)
|
||||
return llElements[elid].value;
|
||||
else
|
||||
return m_zero;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ static void conservative_sparse_sparse_product_impl(const Lhs& lhs, const Rhs& r
|
||||
ei_declare_aligned_stack_constructed_variable(ResScalar, values, rows, 0);
|
||||
ei_declare_aligned_stack_constructed_variable(Index, indices, rows, 0);
|
||||
|
||||
std::memset(mask, 0, sizeof(bool) * rows);
|
||||
std::fill_n(mask, rows, false);
|
||||
|
||||
evaluator<Lhs> lhsEval(lhs);
|
||||
evaluator<Rhs> rhsEval(rhs);
|
||||
@@ -106,10 +106,6 @@ static void conservative_sparse_sparse_product_impl(const Lhs& lhs, const Rhs& r
|
||||
res.finalize();
|
||||
}
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Helper template to generate new sparse matrix types
|
||||
template <class Source, int Order>
|
||||
using WithStorageOrder = SparseMatrix<typename Source::Scalar, Order, typename Source::StorageIndex>;
|
||||
@@ -232,10 +228,6 @@ struct conservative_sparse_sparse_product_selector<Lhs, Rhs, ResultType, RowMajo
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <typename Lhs, typename Rhs, typename ResultType>
|
||||
static void sparse_sparse_to_dense_product_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res) {
|
||||
typedef typename remove_all_t<Lhs>::Scalar LhsScalar;
|
||||
|
||||
@@ -858,7 +858,7 @@ Derived& SparseMatrixBase<Derived>::operator+=(const EigenBase<OtherDerived>& ot
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
Derived& SparseMatrixBase<Derived>::operator-=(const EigenBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
|
||||
@@ -246,4 +246,4 @@ inline const Product<Inverse<PermutationType>, SparseDerived, AliasFreeProduct>
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
#endif // EIGEN_SPARSE_SELFADJOINTVIEW_H
|
||||
#endif // EIGEN_SPARSE_PERMUTATION_H
|
||||
|
||||
@@ -161,8 +161,7 @@ class SparseSelfAdjointView : public EigenBase<SparseSelfAdjointView<MatrixType,
|
||||
|
||||
protected:
|
||||
MatrixTypeNested m_matrix;
|
||||
// mutable VectorI m_countPerRow;
|
||||
// mutable VectorI m_countPerCol;
|
||||
|
||||
private:
|
||||
template <typename Dest>
|
||||
void evalTo(Dest&) const;
|
||||
|
||||
@@ -251,17 +251,8 @@ void TriangularViewImpl<ExpressionType, Mode, Sparse>::solveInPlace(SparseMatrix
|
||||
eigen_assert(derived().cols() == derived().rows() && derived().cols() == other.rows());
|
||||
eigen_assert((!(Mode & ZeroDiag)) && bool(Mode & (Upper | Lower)));
|
||||
|
||||
// enum { copy = internal::traits<OtherDerived>::Flags & RowMajorBit };
|
||||
|
||||
// typedef std::conditional_t<copy,
|
||||
// typename internal::plain_matrix_type_column_major<OtherDerived>::type, OtherDerived&> OtherCopy;
|
||||
// OtherCopy otherCopy(other.derived());
|
||||
|
||||
internal::sparse_solve_triangular_sparse_selector<ExpressionType, OtherDerived, Mode>::run(
|
||||
derived().nestedExpression(), other.derived());
|
||||
|
||||
// if (copy)
|
||||
// other = otherCopy;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user