X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=sparsedistancematrix.cpp;h=03e9fa8e5b77905d4a4416a6c592d3b3756a02e4;hp=7d505239d88b4d817b3b6c5fd3609c6c18e785b4;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=f687723a8357916e86a05116978e6869b039ce36 diff --git a/sparsedistancematrix.cpp b/sparsedistancematrix.cpp index 7d50523..03e9fa8 100644 --- a/sparsedistancematrix.cpp +++ b/sparsedistancematrix.cpp @@ -39,8 +39,10 @@ int SparseDistanceMatrix::updateCellCompliment(ull row, ull col){ ull vcol = 0; //find the columns entry for this cell as well - for (int i = 0; i < seqVec[vrow].size(); i++) { if (seqVec[vrow][i].index == row) { vcol = i; break; } } - + for (int i = 0; i < seqVec[vrow].size(); i++) { + if (seqVec[vrow][i].index == row) { vcol = i; break; } + } + seqVec[vrow][vcol].dist = seqVec[row][col].dist; return 0; @@ -98,7 +100,9 @@ ull SparseDistanceMatrix::getSmallestCell(ull& row){ for (int i = 0; i < seqVec.size(); i++) { for (int j = 0; j < seqVec[i].size(); j++) { - + + if (m->control_pressed) { return smallDist; } + //already checked everyone else in row if (i < seqVec[i][j].index) { @@ -126,7 +130,7 @@ ull SparseDistanceMatrix::getSmallestCell(ull& row){ return col; } catch(exception& e) { - m->errorOut(e, "SparseMatrix", "getSmallestCell"); + m->errorOut(e, "SparseDistanceMatrix", "getSmallestCell"); exit(1); } } @@ -141,7 +145,7 @@ int SparseDistanceMatrix::sortSeqVec(){ return 0; } catch(exception& e) { - m->errorOut(e, "SparseMatrix", "getSmallestCell"); + m->errorOut(e, "SparseDistanceMatrix", "sortSeqVec"); exit(1); } }