diff -r 6892c5562950 liboctave/data-conv.cc --- a/liboctave/data-conv.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/liboctave/data-conv.cc Fri Jul 09 12:12:45 2010 +0200 @@ -1054,9 +1054,6 @@ { is.read (reinterpret_cast (data), 8 * len); do_double_format_conversion (data, len, fmt); - - for (int i = 0; i < len; i++) - data[i] = __lo_ieee_replace_old_NA (data[i]); } break; diff -r 6892c5562950 liboctave/lo-cieee.c --- a/liboctave/lo-cieee.c Thu Jul 08 13:51:37 2010 +0200 +++ b/liboctave/lo-cieee.c Fri Jul 09 12:12:45 2010 +0200 @@ -71,10 +71,6 @@ double octave_Inf; float octave_Float_Inf; -/* Octave's idea of a missing value. */ -double octave_NA; -float octave_Float_NA; - /* Octave's idea of not a number. */ double octave_NaN; float octave_Float_NaN; @@ -145,41 +141,6 @@ } int -__lo_ieee_is_NA (double x) -{ -#if defined (HAVE_ISNAN) - lo_ieee_double t; - t.value = x; - return (isnan (x) && t.word[lo_ieee_hw] == LO_IEEE_NA_HW - && t.word[lo_ieee_lw] == LO_IEEE_NA_LW) ? 1 : 0; -#else - return 0; -#endif -} - -int -__lo_ieee_is_old_NA (double x) -{ -#if defined (HAVE_ISNAN) - lo_ieee_double t; - t.value = x; - return (isnan (x) && t.word[lo_ieee_lw] == LO_IEEE_NA_LW_OLD - && t.word[lo_ieee_hw] == LO_IEEE_NA_HW_OLD) ? 1 : 0; -#else - return 0; -#endif -} - -double -__lo_ieee_replace_old_NA (double x) -{ - if (__lo_ieee_is_old_NA (x)) - return lo_ieee_na_value (); - else - return x; -} - -int __lo_ieee_is_NaN_or_NA (double x) { return __lo_ieee_isnan (x); @@ -192,12 +153,6 @@ } double -lo_ieee_na_value (void) -{ - return octave_NA; -} - -double lo_ieee_nan_value (void) { return octave_NaN; @@ -262,18 +217,6 @@ } int -__lo_ieee_float_is_NA (float x) -{ -#if defined (HAVE_ISNAN) - lo_ieee_float t; - t.value = x; - return (isnan (x) && (t.word == LO_IEEE_NA_FLOAT)) ? 1 : 0; -#else - return 0; -#endif -} - -int __lo_ieee_float_is_NaN_or_NA (float x) { return __lo_ieee_float_isnan (x); @@ -286,12 +229,6 @@ } float -lo_ieee_float_na_value (void) -{ - return octave_Float_NA; -} - -float lo_ieee_float_nan_value (void) { return octave_Float_NaN; diff -r 6892c5562950 liboctave/lo-ieee.cc --- a/liboctave/lo-ieee.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/liboctave/lo-ieee.cc Fri Jul 09 12:12:45 2010 +0200 @@ -59,8 +59,8 @@ // values, there are many parts of Octave that will not work // correctly. - octave_Inf = octave_NaN = octave_NA = DBL_MAX; - octave_Float_Inf = octave_Float_NaN = octave_Float_NA = FLT_MAX; + octave_Inf = octave_NaN = DBL_MAX; + octave_Float_Inf = octave_Float_NaN = FLT_MAX; oct_mach_info::float_format ff = oct_mach_info::native_float_format (); @@ -106,25 +106,6 @@ octave_Inf = tmp_inf; - // This is patterned after code in R. - - if (ff == oct_mach_info::flt_fmt_ieee_big_endian) - { - lo_ieee_hw = 0; - lo_ieee_lw = 1; - } - else - { - lo_ieee_hw = 1; - lo_ieee_lw = 0; - } - - lo_ieee_double t; - t.word[lo_ieee_hw] = LO_IEEE_NA_HW; - t.word[lo_ieee_lw] = LO_IEEE_NA_LW; - - octave_NA = t.value; - volatile float float_tmp_inf; #if defined (SCO) @@ -149,9 +130,6 @@ #endif octave_Float_Inf = float_tmp_inf; - lo_ieee_float tf; - tf.word = LO_IEEE_NA_FLOAT; - octave_Float_NA = tf.value; } break; diff -r 6892c5562950 liboctave/lo-ieee.h --- a/liboctave/lo-ieee.h Thu Jul 08 13:51:37 2010 +0200 +++ b/liboctave/lo-ieee.h Fri Jul 09 12:12:45 2010 +0200 @@ -31,18 +31,12 @@ /* Octave's idea of infinity. */ extern OCTAVE_API double octave_Inf; -/* Octave's idea of a missing value. */ -extern OCTAVE_API double octave_NA; - /* Octave's idea of not a number. */ extern OCTAVE_API double octave_NaN; /* Octave's idea of infinity. */ extern OCTAVE_API float octave_Float_Inf; -/* Octave's idea of a missing value. */ -extern OCTAVE_API float octave_Float_NA; - /* Octave's idea of not a number. */ extern OCTAVE_API float octave_Float_NaN; @@ -64,13 +58,6 @@ unsigned int word; } lo_ieee_float; -#define LO_IEEE_NA_HW_OLD 0x7ff00000 -#define LO_IEEE_NA_LW_OLD 1954 -#define LO_IEEE_NA_HW 0x7FF840F4 -#define LO_IEEE_NA_LW 0x40000000 -#define LO_IEEE_NA_FLOAT 0x7FC207A2 - - extern OCTAVE_API void octave_ieee_init (void); #if defined (SCO) @@ -87,13 +74,10 @@ extern OCTAVE_API int __lo_ieee_finite (double x); extern OCTAVE_API int __lo_ieee_isinf (double x); -extern OCTAVE_API int __lo_ieee_is_NA (double); -extern OCTAVE_API int __lo_ieee_is_old_NA (double); extern OCTAVE_API int __lo_ieee_is_NaN_or_NA (double) GCC_ATTR_DEPRECATED; extern OCTAVE_API double __lo_ieee_replace_old_NA (double); extern OCTAVE_API double lo_ieee_inf_value (void); -extern OCTAVE_API double lo_ieee_na_value (void); extern OCTAVE_API double lo_ieee_nan_value (void); extern OCTAVE_API int __lo_ieee_signbit (double); diff -r 6892c5562950 liboctave/lo-mappers.cc --- a/liboctave/lo-mappers.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/liboctave/lo-mappers.cc Fri Jul 09 12:12:45 2010 +0200 @@ -201,12 +201,6 @@ #endif bool -octave_is_NA (double x) -{ - return lo_ieee_is_NA (x); -} - -bool octave_is_NaN_or_NA (double x) { return lo_ieee_isnan (x); @@ -299,12 +293,6 @@ // complex -> bool mappers. bool -octave_is_NA (const Complex& x) -{ - return (octave_is_NA (real (x)) || octave_is_NA (imag (x))); -} - -bool octave_is_NaN_or_NA (const Complex& x) { return (xisnan (real (x)) || xisnan (imag (x))); @@ -490,12 +478,6 @@ #endif bool -octave_is_NA (float x) -{ - return lo_ieee_is_NA (x); -} - -bool octave_is_NaN_or_NA (float x) { return lo_ieee_isnan (x); @@ -588,12 +570,6 @@ // complex -> bool mappers. bool -octave_is_NA (const FloatComplex& x) -{ - return (octave_is_NA (real (x)) || octave_is_NA (imag (x))); -} - -bool octave_is_NaN_or_NA (const FloatComplex& x) { return (xisnan (real (x)) || xisnan (imag (x))); diff -r 6892c5562950 liboctave/lo-mappers.h --- a/liboctave/lo-mappers.h Thu Jul 08 13:51:37 2010 +0200 +++ b/liboctave/lo-mappers.h Fri Jul 09 12:12:45 2010 +0200 @@ -68,7 +68,6 @@ extern OCTAVE_API bool xisinf (double x); #endif -extern OCTAVE_API bool octave_is_NA (double x); extern OCTAVE_API bool octave_is_NaN_or_NA (double x) GCC_ATTR_DEPRECATED; // Generic xmin, xmax definitions @@ -111,7 +110,6 @@ xisinf (const Complex& x) { return (xisinf (real (x)) || xisinf (imag (x))); } -extern OCTAVE_API bool octave_is_NA (const Complex& x); extern OCTAVE_API bool octave_is_NaN_or_NA (const Complex& x); extern OCTAVE_API Complex xmin (const Complex& x, const Complex& y); @@ -154,7 +152,6 @@ #endif -extern OCTAVE_API bool octave_is_NA (float x); extern OCTAVE_API bool octave_is_NaN_or_NA (float x) GCC_ATTR_DEPRECATED; inline float xmin (float x, float y) @@ -186,7 +183,6 @@ xisinf (const FloatComplex& x) { return (xisinf (real (x)) || xisinf (imag (x))); } -extern OCTAVE_API bool octave_is_NA (const FloatComplex& x); extern OCTAVE_API bool octave_is_NaN_or_NA (const FloatComplex& x); extern OCTAVE_API FloatComplex xmin (const FloatComplex& x, const FloatComplex& y); diff -r 6892c5562950 liboctave/lo-utils.cc --- a/liboctave/lo-utils.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/liboctave/lo-utils.cc Fri Jul 09 12:12:45 2010 +0200 @@ -275,7 +275,7 @@ else { is.putback (c); - d = octave_NA; + d = octave_NaN; } } else @@ -423,7 +423,7 @@ else { is.putback (c); - d = octave_NA; + d = octave_NaN; } } else @@ -540,9 +540,7 @@ void octave_write_double (std::ostream& os, double d) { - if (lo_ieee_is_NA (d)) - os << "NA"; - else if (lo_ieee_isnan (d)) + if (lo_ieee_isnan (d)) os << "NaN"; else if (lo_ieee_isinf (d)) os << (d < 0 ? "-Inf" : "Inf"); @@ -563,9 +561,7 @@ void octave_write_float (std::ostream& os, float d) { - if (lo_ieee_is_NA (d)) - os << "NA"; - else if (lo_ieee_isnan (d)) + if (lo_ieee_isnan (d)) os << "NaN"; else if (lo_ieee_isinf (d)) os << (d < 0 ? "-Inf" : "Inf"); diff -r 6892c5562950 src/DLD-FUNCTIONS/__glpk__.cc --- a/src/DLD-FUNCTIONS/__glpk__.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/DLD-FUNCTIONS/__glpk__.cc Fri Jul 09 12:12:45 2010 +0200 @@ -812,11 +812,12 @@ OCTAVE_GLPK_GET_REAL_PARAM ("tolobj", 9); //-- Assign pointers to the output parameters - ColumnVector xmin (mrowsc, octave_NA); - ColumnVector fmin (1, octave_NA); + ColumnVector xmin (mrowsc, octave_NaN); + ColumnVector fmin (1, octave_NaN); ColumnVector status (1); - ColumnVector lambda (mrowsA, octave_NA); - ColumnVector redcosts (mrowsc, octave_NA); + ColumnVector lambda (mrowsA, octave_NaN); + ColumnVector redcosts (mrowsc, octave_NaN); + ColumnVector time (1); ColumnVector mem (1); diff -r 6892c5562950 src/DLD-FUNCTIONS/__lin_interpn__.cc --- a/src/DLD-FUNCTIONS/__lin_interpn__.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/DLD-FUNCTIONS/__lin_interpn__.cc Fri Jul 09 12:12:45 2010 +0200 @@ -205,7 +205,7 @@ T *vi = Vi.fortran_vec (); octave_idx_type Ni = Vi.numel (); - T extrapval = octave_NA; + T extrapval = octave_NaN; // offset in memory of each dimension diff -r 6892c5562950 src/data.cc --- a/src/data.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/data.cc Fri Jul 09 12:12:45 2010 +0200 @@ -3863,40 +3863,6 @@ DEFALIAS (J, I); DEFALIAS (j, I); -DEFUN (NA, args, , - "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} NA\n\ -@deftypefnx {Built-in Function} {} NA (@var{n})\n\ -@deftypefnx {Built-in Function} {} NA (@var{n}, @var{m})\n\ -@deftypefnx {Built-in Function} {} NA (@var{n}, @var{m}, @var{k}, @dots{})\n\ -@deftypefnx {Built-in Function} {} NA (@dots{}, @var{class})\n\ -Return a scalar, matrix, or N-dimensional array whose elements are all equal\n\ -to the special constant used to designate missing values.\n\ -\n\ -Note that NA always compares not equal to NA (NA != NA).\n\ -To find NA values, use the @code{isna} function.\n\ -\n\ -When called with no arguments, return a scalar with the value @samp{NA}.\n\ -When called with a single argument, return a square matrix with the dimension\n\ -specified. When called with more than one scalar argument the first two\n\ -arguments are taken as the number of rows and columns and any further\n\ -arguments specify additional matrix dimensions.\n\ -The optional argument @var{class} specifies the return type and may be\n\ -either \"double\" or \"single\".\n\ -@seealso{isna}\n\ -@end deftypefn") -{ - return fill_matrix (args, lo_ieee_na_value (), - lo_ieee_float_na_value (), "NA"); -} - -/* - -%!assert(single(NA('double')),NA('single')) -%!assert(double(NA('single')),NA('double')) - - */ - DEFUN (false, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} false (@var{x})\n\ diff -r 6892c5562950 src/mappers.cc --- a/src/mappers.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/mappers.cc Fri Jul 09 12:12:45 2010 +0200 @@ -1095,46 +1095,6 @@ return retval; } -DEFUN (isna, args, , - "-*- texinfo -*-\n\ -@deftypefn {Mapping Function} {} isna (@var{x})\n\ -Return 1 for elements of @var{x} that are NA (missing) values and zero\n\ -otherwise. For example,\n\ -\n\ -@example\n\ -@group\n\ -isna ([13, Inf, NA, NaN])\n\ - @result{} [ 0, 0, 1, 0 ]\n\ -@end group\n\ -@end example\n\ -@seealso{isnan}\n\ -@end deftypefn") -{ - octave_value retval; - if (args.length () == 1) - retval = args(0).isna (); - else - print_usage (); - - return retval; -} - -/* - -%!assert(!(isna (Inf))); -%!assert(!isna (NaN)); -%!assert(isna (NA)); -%!assert(isna (rand(1,10)), false(1,10)); -%!assert(isna([NaN -Inf -1 0 1 Inf NA]), [false, false, false, false, false, false, true]); - -%!assert(!(isna (single(Inf)))); -%!assert(!isna (single(NaN))); -%!assert(isna (single(NA))); -%!assert(isna (single(rand(1,10))), false(1,10)); -%!assert(isna(single([NaN -Inf -1 0 1 Inf NA])), [false, false, false, false, false, false, true]); - - */ - DEFUN (isnan, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isnan (@var{x})\n\ diff -r 6892c5562950 src/oct-stream.cc --- a/src/oct-stream.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/oct-stream.cc Fri Jul 09 12:12:45 2010 +0200 @@ -1288,7 +1288,7 @@ is.putback (c3); if (isspace (c3) || ispunct (c3)) - ref = octave_NA; + ref = octave_NaN; else { is.putback (c2); @@ -1301,7 +1301,7 @@ { is.clear (); - ref = octave_NA; + ref = octave_NaN; } } else if (c2 == 'a') @@ -2722,7 +2722,7 @@ const char *tval = xisinf (val) ? (val < 0 ? "-Inf" : "Inf") - : (lo_ieee_is_NA (val) ? "NA" : "NaN"); + : ("NaN"); retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, @@ -3294,9 +3294,6 @@ dat = nda.fortran_vec (); } - if (do_NA_conv && __lo_ieee_is_old_NA (tmp)) - tmp = __lo_ieee_replace_old_NA (tmp); - dat[count++] = tmp; elts_read++; @@ -3399,7 +3396,7 @@ read_fptr_table[R][oct_data_conv::dt_char] = do_read; \ read_fptr_table[R][oct_data_conv::dt_schar] = do_read; \ read_fptr_table[R][oct_data_conv::dt_uchar] = do_read; \ - read_fptr_table[R][oct_data_conv::dt_logical] = do_read + read_fptr_table[R][oct_data_conv::dt_logical] = do_read octave_value octave_stream::read (const Array& size, octave_idx_type block_size, @@ -3472,7 +3469,7 @@ || input_type == oct_data_conv::dt_single) && ffmt != float_format ()); - bool do_NA_conv = (output_type == oct_data_conv::dt_double); + bool do_NA_conv = 0; //(output_type == oct_data_conv::dt_double); if (fcn) { diff -r 6892c5562950 src/ov-complex.cc --- a/src/ov-complex.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-complex.cc Fri Jul 09 12:12:45 2010 +0200 @@ -449,7 +449,6 @@ SCALAR_MAPPER (tanh, std::tanh); SCALAR_MAPPER (finite, xfinite); SCALAR_MAPPER (isinf, xisinf); - SCALAR_MAPPER (isna, octave_is_NA); SCALAR_MAPPER (isnan, xisnan); default: diff -r 6892c5562950 src/ov-cx-mat.cc --- a/src/ov-cx-mat.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-cx-mat.cc Fri Jul 09 12:12:45 2010 +0200 @@ -778,7 +778,9 @@ ARRAY_MAPPER (sqrt, Complex, std::sqrt); ARRAY_MAPPER (tan, Complex, std::tan); ARRAY_MAPPER (tanh, Complex, std::tanh); +#ifdef WITH_NA ARRAY_MAPPER (isna, bool, octave_is_NA); +#endif default: return octave_base_value::map (umap); diff -r 6892c5562950 src/ov-cx-sparse.cc --- a/src/ov-cx-sparse.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-cx-sparse.cc Fri Jul 09 12:12:45 2010 +0200 @@ -924,7 +924,6 @@ ARRAY_MAPPER (tan, Complex, std::tan); ARRAY_MAPPER (tanh, Complex, std::tanh); ARRAY_MAPPER (isnan, bool, xisnan); - ARRAY_MAPPER (isna, bool, octave_is_NA); ARRAY_MAPPER (isinf, bool, xisinf); ARRAY_MAPPER (finite, bool, xfinite); diff -r 6892c5562950 src/ov-float.cc --- a/src/ov-float.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-float.cc Fri Jul 09 12:12:45 2010 +0200 @@ -312,7 +312,6 @@ SCALAR_MAPPER (tanh, ::tanhf); SCALAR_MAPPER (finite, xfinite); SCALAR_MAPPER (isinf, xisinf); - SCALAR_MAPPER (isna, octave_is_NA); SCALAR_MAPPER (isnan, xisnan); default: diff -r 6892c5562950 src/ov-flt-complex.cc --- a/src/ov-flt-complex.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-flt-complex.cc Fri Jul 09 12:12:45 2010 +0200 @@ -434,7 +434,6 @@ SCALAR_MAPPER (tanh, std::tanh); SCALAR_MAPPER (finite, xfinite); SCALAR_MAPPER (isinf, xisinf); - SCALAR_MAPPER (isna, octave_is_NA); SCALAR_MAPPER (isnan, xisnan); default: diff -r 6892c5562950 src/ov-flt-cx-mat.cc --- a/src/ov-flt-cx-mat.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-flt-cx-mat.cc Fri Jul 09 12:12:45 2010 +0200 @@ -745,7 +745,6 @@ ARRAY_MAPPER (sqrt, FloatComplex, std::sqrt); ARRAY_MAPPER (tan, FloatComplex, std::tan); ARRAY_MAPPER (tanh, FloatComplex, std::tanh); - ARRAY_MAPPER (isna, bool, octave_is_NA); default: return octave_base_value::map (umap); diff -r 6892c5562950 src/ov-flt-re-mat.cc --- a/src/ov-flt-re-mat.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-flt-re-mat.cc Fri Jul 09 12:12:45 2010 +0200 @@ -791,7 +791,6 @@ RC_ARRAY_MAPPER (sqrt, FloatComplex, rc_sqrt); ARRAY_MAPPER (tan, float, ::tanf); ARRAY_MAPPER (tanh, float, ::tanhf); - ARRAY_MAPPER (isna, bool, octave_is_NA); default: return octave_base_value::map (umap); diff -r 6892c5562950 src/ov-re-mat.cc --- a/src/ov-re-mat.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-re-mat.cc Fri Jul 09 12:12:45 2010 +0200 @@ -914,7 +914,6 @@ RC_ARRAY_MAPPER (sqrt, Complex, rc_sqrt); ARRAY_MAPPER (tan, double, ::tan); ARRAY_MAPPER (tanh, double, ::tanh); - ARRAY_MAPPER (isna, bool, octave_is_NA); default: if (umap >= umap_xisalnum && umap <= umap_xtoupper) diff -r 6892c5562950 src/ov-re-sparse.cc --- a/src/ov-re-sparse.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-re-sparse.cc Fri Jul 09 12:12:45 2010 +0200 @@ -934,7 +934,6 @@ ARRAY_MAPPER (tan, double, ::tan); ARRAY_MAPPER (tanh, double, ::tanh); ARRAY_MAPPER (isnan, bool, xisnan); - ARRAY_MAPPER (isna, bool, octave_is_NA); ARRAY_MAPPER (isinf, bool, xisinf); ARRAY_MAPPER (finite, bool, xfinite); diff -r 6892c5562950 src/ov-scalar.cc --- a/src/ov-scalar.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/ov-scalar.cc Fri Jul 09 12:12:45 2010 +0200 @@ -328,7 +328,6 @@ SCALAR_MAPPER (tanh, ::tanh); SCALAR_MAPPER (finite, xfinite); SCALAR_MAPPER (isinf, xisinf); - SCALAR_MAPPER (isna, octave_is_NA); SCALAR_MAPPER (isnan, xisnan); default: diff -r 6892c5562950 src/pr-output.cc --- a/src/pr-output.cc Thu Jul 08 13:51:37 2010 +0200 +++ b/src/pr-output.cc Fri Jul 09 12:12:45 2010 +0200 @@ -1525,13 +1525,6 @@ } } } - else if (octave_is_NA (d)) - { - if (fw > 0) - os << std::setw (fw) << "NA"; - else - os << "NA"; - } else if (rat_format) os << pr_rational_float (*fmt, d); else if (xisinf (d)) diff -r 8b135864b86b scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m Mon Jul 19 03:01:33 2010 -0400 +++ b/scripts/plot/__go_draw_axes__.m Mon Jul 19 13:58:45 2010 +0200 @@ -507,7 +507,7 @@ endif endif - if (! isnan (xcol) && ! isnan (ycol)) + if (! isnan (xcol) ) ## Is the patch closed or not if (strncmp (obj.facecolor, "none", 4)) hidden_removal = false; @@ -1808,13 +1808,6 @@ ## FIXME -- this may need to be converted to C++ for speed. - ## Convert NA elements to normal NaN values because fprintf writes - ## "NA" and that confuses gnuplot. - idx = find (isna (data)); - if (any (idx)) - data(idx) = NaN; - endif - if (nd == 2) fwrite (plot_stream, data, "float64"); elseif (nd == 3)