+ else if(itA < itB){
+ PDistCell value(itB, distance);
+
+ if(refRow == refCol){ // in other words, if we haven't loaded refRow and refCol...
+ refRow = itA;
+ refCol = itB;
+ DMatrix->addCell(itA, value);
+ }
+ else if(refRow == itB && refCol == itA){
+ lt = 0;
+ }
+ else{
+ DMatrix->addCell(itA, value);
+ }
+ }
+ reading->update(itA * nseqs);
+ }
+ m->gobble(fileHandle);
+ }
+
+ if(lt == 0){ // oops, it was square
+
+ fileHandle.close(); //let's start over
+ DMatrix->clear(); //let's start over
+
+ m->openInputFile(distFile, fileHandle); //let's start over
+
+ while(fileHandle){
+ fileHandle >> firstName >> secondName >> distance;
+
+ if (m->control_pressed) { fileHandle.close(); delete reading; return 0; }
+
+ int itA = countTable->get(firstName);
+ int itB = countTable->get(secondName);
+
+
+ if (m->control_pressed) { exit(1); }
+
+ if (distance == -1) { distance = 1000000; }
+ else if (sim) { distance = 1.0 - distance; } //user has entered a sim matrix that we need to convert.
+
+ if(distance < cutoff && itA > itB){
+ PDistCell value(itA, distance);
+ DMatrix->addCell(itB, value);
+ reading->update(itA * nseqs);
+ }
+
+ m->gobble(fileHandle);