Skip to content

Commit d9d9ff5

Browse files
authored
reading labeled sparse file produce false nDimensions
1 parent 208b878 commit d9d9ff5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/io.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ void readSparseMatrixDimensions(string filename, unsigned int &nRows,
273273
int dummy_index;
274274
while(getline(linestream, value, ' ')) {
275275
int separator = value.find(":");
276+
if (separator == -1) // it's a label ?
277+
continue;
276278
istringstream myStream(value.substr(0, separator));
277279
myStream >> dummy_index;
278280
if(dummy_index > max_index) {

0 commit comments

Comments
 (0)