ORNL / ReSolve

Library of GPU-resident linear solvers
Other
57 stars 2 forks source link

`MatrixHandler::matrixInfNorm` should not assume that the input matrix is in the csr format #180

Closed superwhiskers closed 1 month ago

superwhiskers commented 3 months ago

currently, the matrixInfNorm method of MatrixHandler and its corresponding implementation classes, MatrixHandlerCpu et al. (introduced in #102) incorrectly assume that the input matrix will always be in the csr format. this conflicts with the type signature, which indicates the matrix just has to be of the Sparse class.

this is bad for multiple reasons:

this should be resolved by

pelesh commented 3 months ago

Thanks for documenting this @superwhiskers!

pelesh commented 1 month ago

It should probably be specialized to Csr matrices. Support for other formats could be added later by function overloading, if needed.

pelesh commented 1 month ago

Best thing we can do in the short term is tp check if the matrix is CSR and return error, if it is not. It is unlikely that matvec and matrixInfNorm methods of MatrixHandler class will support any other format in the near future.

The quick fix is in #190.

The challenge here is that solver implementation should be agnostic of the matrix type. Because of that, MatrixHandler methods signatures should accept generic matrix::Sparse objects. However, implementation of MatrixHandler methods is specific to the matrix format.

CC @kswirydo @stonecoldhughes