octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54622] test importdata fails in dev octave wi


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #54622] test importdata fails in dev octave with windows
Date: Wed, 12 Sep 2018 00:00:17 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Follow-up Comment #63, bug #54622 (project octave):

Yes, that str2double.cc is going in the right direction.  I too don't want to
dig into that right now, even though it might not bee too bad.  It is probably
better to add the BISTs, such as trying to read

1 + 5I
0j
+j
-j
3 J

etc.

When you posted, I was just about to finish (so I thought) a change in which I
added a Boolean fail status to the octave_read_value() function, then ran into
an issue because sparse code was using that function in a strange template.

Nonetheless, attached is a patch that works for reading complex numbers, or is
something really close.  It became pretty repetitive scanning both the real
and imaginary portions of numbers, plus there were so many white-space
scenarios, etc. that I now wish I would have abandoned it earlier on and used
that extract_num() routine.

Well, anyway, attached is "version 1".  Let me know what you think.

I should point out that the change seems to accept a white space between the
number and the imaginary indicator:

1.5,0+3 j,4

comes out as 0.0000 + 3.0000i.  I suppose that this is fine because this is a
data file stream, and unlike the interpreter there is no possible confusion
with "j" representing some variable.

(file #44986)
    _______________________________________________________

Additional Item Attachment:

File name: octave-dlmread_handle_complex-djs2018sep11.patch Size:8 KB


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54622>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]