update sparse*sparse product: the default is now a conservative algorithm preserving symbolic non zeros. The previous with auto pruning of the small value is avaible doing: (A*B).pruned() or (A*B).pruned(ref) or (A*B).pruned(ref,eps)

This commit is contained in:
Gael Guennebaud
2011-10-24 11:44:53 +02:00
parent a997dacc67
commit 1ddf88060b
7 changed files with 475 additions and 413 deletions

View File

@@ -299,7 +299,7 @@ class AmbiVector<_Scalar,_Index>::Iterator
* In practice, all coefficients having a magnitude smaller than \a epsilon
* are skipped.
*/
Iterator(const AmbiVector& vec, RealScalar epsilon = RealScalar(0.1)*NumTraits<RealScalar>::dummy_precision())
Iterator(const AmbiVector& vec, RealScalar epsilon = 0)
: m_vector(vec)
{
m_epsilon = epsilon;
@@ -315,7 +315,7 @@ class AmbiVector<_Scalar,_Index>::Iterator
{
ListEl* EIGEN_RESTRICT llElements = reinterpret_cast<ListEl*>(m_vector.m_buffer);
m_currentEl = m_vector.m_llStart;
while (m_currentEl>=0 && internal::abs(llElements[m_currentEl].value)<m_epsilon)
while (m_currentEl>=0 && internal::abs(llElements[m_currentEl].value)<=m_epsilon)
m_currentEl = llElements[m_currentEl].next;
if (m_currentEl<0)
{