diff --git a/README.Rmd b/README.Rmd index 5aa63fa..862ca01 100644 --- a/README.Rmd +++ b/README.Rmd @@ -62,4 +62,5 @@ To get started, look at the ["Getting started"](www.schlosslab.org/clustur/) pag ## Contributions For feature request please visit the issue page in github and use the feature -tag. If you would like to contribute pull request are welcomed! \ No newline at end of file +tag. If you would like to contribute pull request are welcomed! + diff --git a/src/ColumnDistanceMatrixReader.cpp b/src/ColumnDistanceMatrixReader.cpp index 925f88e..9dbc6b3 100644 --- a/src/ColumnDistanceMatrixReader.cpp +++ b/src/ColumnDistanceMatrixReader.cpp @@ -47,8 +47,9 @@ bool ColumnDistanceMatrixReader::Read(const std::string& filePath) { fileHandle.clear(); fileHandle.seekg(0, std::ifstream::beg); } + while(fileHandle >> firstName >> secondName >> distance && lt == 1){ //let's assume it's a triangular matrix... - int itA; + int itA; int itB; try { itA = nameToIndexMap.at(firstName); diff --git a/src/MatrixAdapter.cpp b/src/MatrixAdapter.cpp index 06dbd08..825b243 100644 --- a/src/MatrixAdapter.cpp +++ b/src/MatrixAdapter.cpp @@ -89,14 +89,6 @@ SparseDistanceMatrix MatrixAdapter::CreateSparseMatrix() { matrixNames[i] = positionsToNames[i]; } - - - // for (int i = 0; i < nameSize; i++) { - // positionsOfIndexs[xPosition[i]] = i; // Position of indexes is incorrectly made - // matrixNames[i] = positionsToNames[i]; - // } - - for (int i = 0; i < nSeqs; i++) { double currentDist = data[i]; @@ -106,13 +98,7 @@ SparseDistanceMatrix MatrixAdapter::CreateSparseMatrix() { } const int xIndex = xPosition[i]; // Coming from r -> c++, indeces start at 1 in r const int yIndex = yPosition[i]; - - // const double currentValueX = dataList[yIndex].rowValues[xIndex]; - // if(currentValueX != 0){ // We already set the value and this is a sparse matrix. - // continue; // WE do not need to reset the values back to zero. - // } // This is a catch all in the case of a sparse and square matrix - // Since the indexes were reverting back to zero, if the values were found again, - // like 2,4 = 0.3, but 4,2 = 0 was found, (its a sparse matrix) so we do not change back the value. + if(xIndex > yIndex) sparseMatrix.addCell(yIndex, PDistCell(xIndex, static_cast(currentDist))); else