[Top][All Lists]

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

Storing/loading "-Inf" values

From: Alex Zvoleff
Subject: Storing/loading "-Inf" values
Date: Thu, 30 Nov 2006 17:29:59 -0800

        I recently attempted to load an ASCII datafile saved under 2.9.9 (on
Linux i86) that contained several matrices containing -Inf values.
Whenever I tried to load the file, I would get an error.  Positive Inf
values will load correctly, but not negative.  An example is below.

octave:77> testvariable=[Inf]
testvariable = Inf
octave:78> save testfile
warning: save: Inf or NaN values may not be reloadable
octave:79> clear
octave:80> load testfile
octave:81> testvariable
testvariable = Inf

octave:82> testvariable=[-Inf]
testvariable = -Inf
octave:83> save testfile
warning: save: Inf or NaN values may not be reloadable
octave:84> clear
octave:85> load testfile
error: load: failed to load scalar constant
error: load: trouble reading ascii file `testfile'
error: load: reading file testfile
octave:85> version
ans = 2.9.9

        The following post from John that I found led me to believe this
behavior was fixed in recent versions of Octave, but I seem to still be
encountering the error.  Is there a simple solution?

Thanks for your help,

Alex Zvoleff

> On  2-Jun-2005, Keith Goodman wrote:
> | When I save matrices with NaNs I get the following warning: "warning:
> | save: Inf or NaN values may not be reloadable."
> This should only happen if you are using the Octave text format for
> saving data.  It used to be true that Octave might fail to read Inf
> and NaN values from such files because it relied on the system
> iostream library for reading Inf and NaN.  In some cases it would
> fail.  But now I think Octave has been fixed to always write Inf and
> NaN values with the same represenatation, and to also be able to read
> them back in.  You could still have trouble if you tried to load a
> text format save file with an older version of Octave.  But Maybe now
> it is reasonable to remove the warning.
> jwe

reply via email to

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