|
@@ -24,6 +24,7 @@ IGL_INLINE void igl::components(
|
|
C.resize(n,1);
|
|
C.resize(n,1);
|
|
typename DerivedC::Scalar id = 0;
|
|
typename DerivedC::Scalar id = 0;
|
|
vector<typename Derivedcounts::Scalar> vcounts;
|
|
vector<typename Derivedcounts::Scalar> vcounts;
|
|
|
|
+ // breadth first search
|
|
for(int k=0; k<A.outerSize(); ++k)
|
|
for(int k=0; k<A.outerSize(); ++k)
|
|
{
|
|
{
|
|
if(seen(k))
|
|
if(seen(k))
|
|
@@ -48,7 +49,7 @@ IGL_INLINE void igl::components(
|
|
for(typename SparseMatrix<AScalar>::InnerIterator it (A,f); it; ++it)
|
|
for(typename SparseMatrix<AScalar>::InnerIterator it (A,f); it; ++it)
|
|
{
|
|
{
|
|
const int g = it.index();
|
|
const int g = it.index();
|
|
- if(!seen(g))
|
|
|
|
|
|
+ if(!seen(g) && it.value())
|
|
{
|
|
{
|
|
Q.push(g);
|
|
Q.push(g);
|
|
}
|
|
}
|