rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

read_matrix issues #974

Open rtoy opened 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-03 15:52:34 Created by macrakis on 2016-05-23 19:53:13 Original: https://sourceforge.net/p/maxima/bugs/3164


Some bad cases for read_matrix (file contents on left, results on right):

4+5 => [[4,5]] , => [false,false]

=> matrix() << correct => matrix([false]) << should be matrix([]) -x => matrix([-x]) (== -1 * x) << should be error -1*x => matrix([[-1,?*,x]])) "a => matrix(["a "]) Results depend on the input file name (!!!): In file t10.csv: 1,-x,"sdf" => [1, -x, "sdf"] Identical contents, but named t10.com: 1,-x,"sdf" => matrix([ 1, ?, , -x , ?, , "sdf" ]) BTW if you want to test these, note that ?* is Lisp's *, and will actually have a value; you need to quote it.
rtoy commented 3 months ago

Imported from SourceForge on 2024-07-03 15:52:35 Created by macrakis on 2016-05-23 19:57:58 Original: https://sourceforge.net/p/maxima/bugs/3164/#b467


The different behavior based on input file name is actually described in manual section 73.1.2: "If the file name ends in something other than .csv' andseparator_flag' is not specified, `space' is assumed."

So the t10.com case should presumably be returning matrix(["1,-x,\"sdf\""]) (because there are no spaces) or giving an error (because that is not numerical).

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-03 15:52:39 Created by robert_dodier on 2024-06-03 20:07:57 Original: https://sourceforge.net/p/maxima/bugs/3164/#2e3a