Mercurial > hg > octave-nkf
changeset 6742:ebf96cc00ee9
[project @ 2007-06-18 16:27:52 by jwe]
author | jwe |
---|---|
date | Mon, 18 Jun 2007 16:28:48 +0000 |
parents | 00116015904d |
children | f11fec9c06b0 |
files | ChangeLog emacs/octave-inf.el scripts/ChangeLog scripts/general/interp1.m scripts/general/interp2.m scripts/general/interp3.m scripts/general/interpn.m src/ChangeLog src/DLD-FUNCTIONS/__lin_interpn__.cc |
diffstat | 9 files changed, 39 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-18 John W. Eaton <jwe@octave.org> + + * emacs/octave-inf.el (inferior-octave-prompt): Match "octave.bin" + and "octave.exe" in addition to "octave". + 2007-06-15 John W. Eaton <jwe@octave.org> * run-octave.in: Use simple string concatenation instead of
--- a/emacs/octave-inf.el +++ b/emacs/octave-inf.el @@ -41,7 +41,7 @@ :group 'octave-inferior) (defcustom inferior-octave-prompt - "\\(^octave\\(-[.0-9]+\\)?\\(:[0-9]+\\)?\\|^debug\\|^\\)>+ " + "\\(^octave\\(\\|.bin\\|.exe\\)\\(-[.0-9]+\\)?\\(:[0-9]+\\)?\\|^debug\\|^\\)>+ " "*Regexp to match prompts for the inferior Octave process." :type 'regexp :group 'octave-inferior)
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2007-06-18 Søren Hauberg <hauberg@gmail.com> + + * general/interp1.m, general/interp2.m, general/interp3.m, + general/interpn.m: Replace, NaN with NA. Use isna instead of == + to check for NA. + 2007-06-18 Søren Hauberg <hauberg@gmail.com> * optimization/glpk.m: TeXified the help text.
--- a/scripts/general/interp1.m +++ b/scripts/general/interp1.m @@ -51,7 +51,7 @@ ## ## If @var{extrap} is the string 'extrap', then extrapolate values beyond ## the endpoints. If @var{extrap} is a number, replace values beyond the -## endpoints with that number. If @var{extrap} is missing, assume NaN. +## endpoints with that number. If @var{extrap} is missing, assume NA. ## ## If the string argument 'pp' is specified, then @var{xi} should not be ## supplied and @code{interp1} returns the piece-wise polynomial that @@ -95,7 +95,7 @@ endif method = "linear"; - extrap = NaN; + extrap = NA; xi = []; pp = false; firstnumeric = true; @@ -378,7 +378,7 @@ ## There is an ENDBLOCKTEST after the final block %!test style = "nearest"; ## BLOCK -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -395,7 +395,7 @@ %!assert (interp1(xp,[yp',yp'],xi,style), %! interp1(xp,[yp',yp'],xi,["*",style]),100*eps); %!test style=['*',style]; -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -412,7 +412,7 @@ ## ENDBLOCK %!test style='linear'; ## BLOCK -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -429,7 +429,7 @@ %!assert (interp1(xp,[yp',yp'],xi,style), %! interp1(xp,[yp',yp'],xi,["*",style]),100*eps); %!test style=['*',style]; -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -446,7 +446,7 @@ ## ENDBLOCK %!test style='cubic'; ## BLOCK -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -463,7 +463,7 @@ %!assert (interp1(xp,[yp',yp'],xi,style), %! interp1(xp,[yp',yp'],xi,["*",style]),100*eps); %!test style=['*',style]; -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -480,7 +480,7 @@ ## ENDBLOCK %!test style='pchip'; ## BLOCK -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -497,7 +497,7 @@ %!assert (interp1(xp,[yp',yp'],xi,style), %! interp1(xp,[yp',yp'],xi,["*",style]),100*eps); %!test style=['*',style]; -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -514,7 +514,7 @@ ## ENDBLOCK %!test style='spline'; ## BLOCK -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -531,7 +531,7 @@ %!assert (interp1(xp,[yp',yp'],xi,style), %! interp1(xp,[yp',yp'],xi,["*",style]),100*eps); %!test style=['*',style]; -%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NaN, NaN]); +%!assert (interp1(xp, yp, [min(xp)-1, max(xp)+1],style), [NA, NA]); %!assert (interp1(xp,yp,xp,style), yp, 100*eps); %!assert (interp1(xp,yp,xp',style), yp', 100*eps); %!assert (interp1(xp',yp',xp',style), yp', 100*eps); @@ -566,7 +566,7 @@ %!error interp1(1,1,1, "*nearest"); %!assert (interp1(1:2:4,1:2:4,1.4,"*nearest"),1); %!error interp1(1,1,1, "*linear"); -%!assert (interp1(1:2:4,1:2:4,[0,1,1.4,3,4],"*linear"),[NaN,1,1.4,3,NaN]); +%!assert (interp1(1:2:4,1:2:4,[0,1,1.4,3,4],"*linear"),[NA,1,1.4,3,NA]); %!error interp1(1:3,1:3,1, "*cubic"); %!assert (interp1(1:2:8,1:2:8,1.4,"*cubic"),1.4); %!error interp1(1:2,1:2,1, "*spline");
--- a/scripts/general/interp2.m +++ b/scripts/general/interp2.m @@ -68,7 +68,7 @@ ## If a scalar value @var{extrapval} is defined as the final value, then ## values outside the mesh as set to this value. Note that in this case ## @var{method} must be defined as well. If @var{extrapval} is not -## defined then NaN is assumed. +## defined then NA is assumed. ## ## @seealso{interp1} ## @end deftypefn @@ -92,7 +92,7 @@ function ZI = interp2 (varargin) Z = X = Y = XI = YI = n = []; method = "linear"; - extrapval = NaN; + extrapval = NA; switch (nargin) case 1 @@ -218,7 +218,7 @@ ZI = Z(idx); endif - ## set points outside the table to NaN + ## set points outside the table to 'extrapval' ZI (XI < X(1,1) | XI > X(1,end) | YI < Y(1,1) | YI > Y(end,1)) = extrapval; ZI = reshape (ZI, shape); else @@ -337,7 +337,7 @@ %! Orig = X.^2 + Y.^3; %! xi = [0,4]; %! yi = [3,8]'; -%! assert(interp2(x,y,Orig, xi, yi),[nan,nan;nan,nan]); +%! assert(interp2(x,y,Orig, xi, yi),[NA,NA;NA,NA]); %! assert(interp2(x,y,Orig, xi, yi,'linear', 0),[0,0;0,0]); %!test % for values at boundaries
--- a/scripts/general/interp3.m +++ b/scripts/general/interp3.m @@ -58,13 +58,13 @@ ## ## If @var{extrap} is the string 'extrap', then extrapolate values beyond ## the endpoints. If @var{extrap} is a number, replace values beyond the -## endpoints with that number. If @var{extrap} is missing, assume NaN. +## endpoints with that number. If @var{extrap} is missing, assume NA. ## @seealso{interp1, interp2, spline, meshgrid} ## @end deftypefn function vi = interp3 (varargin) method = "linear"; - extrapval = NaN; + extrapval = NA; nargs = nargin; if (nargin < 1)
--- a/scripts/general/interpn.m +++ b/scripts/general/interpn.m @@ -58,14 +58,14 @@ ## ## If @var{extrap} is the string 'extrap', then extrapolate values beyond ## the endpoints. If @var{extrap} is a number, replace values beyond the -## endpoints with that number. If @var{extrap} is missing, assume NaN. +## endpoints with that number. If @var{extrap} is missing, assume NA. ## @seealso{interp1, interp2, spline, ndgrid} ## @end deftypefn function vi = interpn (varargin) method = "linear"; - extrapval = NaN; + extrapval = NA; nargs = nargin; if (nargin < 1) @@ -150,7 +150,7 @@ method = tolower (method); if (strcmp (method, "linear")) vi = __lin_interpn__ (x{:}, v, y{:}); - vi (vi == NaN) = extrapval; + vi (isna (vi)) = extrapval; elseif (strcmp (method, "nearest")) yshape = size (y{1}); yidx = cell (1, nd);