Open cauachagas opened 3 years ago
The issue with the complex type support is in the read_lines function. istringstream doesn't parse "1 2" as a complex number in izz >> data[nz]. You can add a branch for complex numbers to read lines function (like this one). Or you can wait for a while and I'll add complex matrices support.
I'm trying to open a complex .mtx file, but without success. I tried to add the following codes
L84 - matrix_market_reader.h
https://github.com/senior-zero/matrix_reader/blob/e031bb88878022b9ab0dda2c66b19e1f6bc616d0/include/matrix_market_reader.h#L84
L191 - matrix_market_reader.cpp
https://github.com/senior-zero/matrix_reader/blob/e031bb88878022b9ab0dda2c66b19e1f6bc616d0/src/matrix_market_reader.cpp#L191
L201 - matrix_market_reader.cpp
https://github.com/senior-zero/matrix_reader/blob/e031bb88878022b9ab0dda2c66b19e1f6bc616d0/src/matrix_market_reader.cpp#L201
229 - matrix_market_reader.cpp
https://github.com/senior-zero/matrix_reader/blob/e031bb88878022b9ab0dda2c66b19e1f6bc616d0/src/matrix_market_reader.cpp#L229
Test
Result
You can see that the code only reads the real part (test 1). When added to the imaginary part, the test fails (test 2). I don't have that much experience with C ++ to know where it is wrong.