ejml icon indicating copy to clipboard operation
ejml copied to clipboard

SimpleMatrix.loadCSV method should be static

Open akinfermo opened this issue 6 years ago • 3 comments

Similarly to SimpleMatrix.loadBinary method, the SimpleMatrix.loadCSV method should be static. Is there any reason why it isn't?

https://github.com/lessthanoptimal/ejml/blob/c63c8526283f7fbb49eb7a7174d141e1f6f3b3d0/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L1311

akinfermo avatar Jul 25 '18 14:07 akinfermo

So that if you create your own derived class from SimpleMatrix the load will return the same type of matrix.

lessthanoptimal avatar Jul 26 '18 14:07 lessthanoptimal

Ok. I see the tradeoff being made there. Any plans to provide a static method in a future release?

akinfermo avatar Jul 26 '18 18:07 akinfermo

Well I had decided to add a static function then found out that Java does not allow a static function to match the signature of a non-static function. I suppose I could already give it a different name...

lessthanoptimal avatar Aug 23 '18 04:08 lessthanoptimal

Javadoc has been updated to clarify that this function returns that it returns the same matrix type. Feel free to create a new issue if you want a static loadCSV or similar for SImpleMatrix

lessthanoptimal avatar Jan 14 '23 00:01 lessthanoptimal