Sat 25 Jan 2014 10:41:50 AM UTC, original submission:
Hi!
The Matlab 2013a spconvert() works for three-column complex matrices, but the Octave 3.8.0 spconvert() does not. This prevents me from loading m-files generated by Petsc 3.4.3, i.e. to transfer matrices from Petsc to Octave.
For example, consider the following command:
> spconvert ([8 8 2.3958333333333320e-01+4.7916666666666643e+00i])
In Matlab 2013a, the result is:
(8,8) 0.2396 + 4.7917i
In Octave 3.8.0, the result is:
error: spconvert: argument must be sparse or real matrix with 3 or 4 columns
error: called from:
error: /opt/local/share/octave/3.8.0/m/sparse/spconvert.m at line 37, column 7
I posted this to the Octave help mailing list, and one of the resposes included a suggestion for a fix for spconvert. The thread is archived here:
http://octave.1599824.n4.nabble.com/Running-m-files-generated-by-Petsc-3-4-3-td4661348.html
I will quote the fix suggestion of Carlo Defalco:
"If we want to, the ix is trivial, simply change line 35 of "spconvert.m" from
if (nargin != 1 || ! ismatrix (m) || ! isreal (m)
to
if (nargin != 1 || ! ismatrix (m) "
Best regards
Torquil Sørensen
|