# HG changeset patch # User jwe # Date 1189747317 0 # Node ID f4e1bdb66535cae34183888ccbc2ee1509d889cc # Parent 935d23e169517e552a60f595467b9cd8d684914c [project @ 2007-09-14 05:20:43 by jwe] diff --git a/doc/interpreter/poly.txi b/doc/interpreter/poly.txi --- a/doc/interpreter/poly.txi +++ b/doc/interpreter/poly.txi @@ -88,13 +88,13 @@ @section Derivatives and Integrals Octave comes with functions for computing the derivative and the integral -of a polynomial. The functions @code{polyderiv} and @code{polyinteg} +of a polynomial. The functions @code{polyderiv} and @code{polyint} both return new polynomials describing the result. As an example we'll compute the definite integral of @math{p(x) = x^2 + 1} from 0 to 3. @example c = [1, 0, 1]; -integral = polyinteg(c); +integral = polyint(c); area = polyval(integral, 3) - polyval(integral, 0) @result{} 12 @end example @@ -103,7 +103,7 @@ @DOCSTRING(polyder) -@DOCSTRING(polyinteg) +@DOCSTRING(polyint) @node Polynomial Interpolation @section Polynomial Interpolation diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -3,6 +3,10 @@ * plot/__default_colormap__.m: Delete. * plot/Makefile (SOURCES): Remove from the list. +2007-09-13 Christof Zeile + + * pol2cart.m: Make it work with mixed scalar/nonscalar arguments. + 2007-09-10 David Bateman * plot/__go_draw_axes__.m: Allow gnuplot 4.0 with patches, but diff --git a/scripts/general/pol2cart.m b/scripts/general/pol2cart.m --- a/scripts/general/pol2cart.m +++ b/scripts/general/pol2cart.m @@ -41,9 +41,16 @@ endif if ((! (ismatrix (Theta) && ismatrix (R))) - || (! size_equal (Theta, R)) - || (nargin == 3 && ! (size_equal (R, Z) && ismatrix (Z)))) - error ("pol2cart: arguments must be matrices of same size"); + || ((! size_equal (Theta, R)) && (! isscalar (Theta)) && (! isscalar (R))) + || (nargin == 3 + && ((! ismatrix(Z)) + || ( (! isscalar(Z)) + && ( (!(isscalar(R) || size_equal (R, Z))) || (!(isscalar(Theta) || size_equal (Theta, Z))) ) + ) + ) + ) + ) + error ("pol2cart: arguments must be matrices of same size or scalar"); endif X = cos (Theta) .* R; diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,16 @@ +2007-09-14 Kai Habel + + * graphics.h.in (radio_values::contains): New function. + (radio_values::validate): Use it. + * graphics.cc (color_property::operator =): Call it instead of + validate here. + 2007-09-13 John W. Eaton + * DLD-FUNCTIONS/__glpk__.cc (glpk): Pass LPX_FX, not LB_DB, to + lpx_set_col_bnds when lb[i] == ub[i]. + From: Zhi Wang . + * graphics.h.in (colormap_property::colormap_property): Use jet colormap as default. diff --git a/src/DLD-FUNCTIONS/__glpk__.cc b/src/DLD-FUNCTIONS/__glpk__.cc --- a/src/DLD-FUNCTIONS/__glpk__.cc +++ b/src/DLD-FUNCTIONS/__glpk__.cc @@ -196,7 +196,12 @@ { //-- Define type of the structural variables if (! freeLB[i] && ! freeUB[i]) - lpx_set_col_bnds (lp, i+1, LPX_DB, lb[i], ub[i]); + { + if (lb[i] != ub[i]) + lpx_set_col_bnds (lp, i+1, LPX_DB, lb[i], ub[i]); + else + lpx_set_col_bnds (lp, i+1, LPX_FX, lb[i], ub[i]); + } else { if (! freeLB[i] && freeUB[i]) diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -172,7 +172,7 @@ if (! s.empty ()) { - if (radio_val.validate (s)) + if (radio_val.contains (s)) { current_val = s; current_type = radio_t; @@ -2084,9 +2084,9 @@ xdata (Matrix ()), ydata (Matrix ()), zdata (Matrix ()), - facecolor (radio_values("{flat}|none|interp")), + facecolor (radio_values ("{flat}|none|interp")), facealpha (1.0), - edgecolor (color_values(0, 0, 0), radio_values("flat|none|interp")), + edgecolor (color_values(0, 0, 0), radio_values ("flat|none|interp")), linestyle ("-"), linewidth (0.5), marker ("none"), diff --git a/src/graphics.h.in b/src/graphics.h.in --- a/src/graphics.h.in +++ b/src/graphics.h.in @@ -67,7 +67,7 @@ { bool retval = true; - if (possible_vals.find (val) == possible_vals.end ()) + if (! contains (val)) { error ("invalid value = %s", val.c_str ()); retval = false; @@ -75,6 +75,11 @@ return retval; } + + bool contains (const std::string& val) + { + return (possible_vals.find (val) != possible_vals.end ()); + } private: // Might also want to cache