changeset 6898:f4e1bdb66535

[project @ 2007-09-14 05:20:43 by jwe]
author jwe
date Fri, 14 Sep 2007 05:21:57 +0000
parents 935d23e16951
children 110c5782fe3b
files doc/interpreter/poly.txi scripts/ChangeLog scripts/general/pol2cart.m src/ChangeLog src/DLD-FUNCTIONS/__glpk__.cc src/graphics.cc src/graphics.h.in
diffstat 7 files changed, 43 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/poly.txi	Thu Sep 13 19:13:56 2007 +0000
+++ b/doc/interpreter/poly.txi	Fri Sep 14 05:21:57 2007 +0000
@@ -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
--- a/scripts/ChangeLog	Thu Sep 13 19:13:56 2007 +0000
+++ b/scripts/ChangeLog	Fri Sep 14 05:21:57 2007 +0000
@@ -3,6 +3,10 @@
 	* plot/__default_colormap__.m: Delete.
 	* plot/Makefile (SOURCES): Remove from the list.
 
+2007-09-13  Christof Zeile  <cz-oct07@cvmx.com>
+
+	* pol2cart.m: Make it work with mixed scalar/nonscalar arguments.
+
 2007-09-10  David Bateman  <dbateman@free.fr>
 
 	* plot/__go_draw_axes__.m: Allow gnuplot 4.0 with patches, but
--- a/scripts/general/pol2cart.m	Thu Sep 13 19:13:56 2007 +0000
+++ b/scripts/general/pol2cart.m	Fri Sep 14 05:21:57 2007 +0000
@@ -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;
--- a/src/ChangeLog	Thu Sep 13 19:13:56 2007 +0000
+++ b/src/ChangeLog	Fri Sep 14 05:21:57 2007 +0000
@@ -1,5 +1,16 @@
+2007-09-14  Kai Habel  <kai.habel@gmx.de>
+
+	* 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  <jwe@octave.org>
 
+	* DLD-FUNCTIONS/__glpk__.cc (glpk): Pass LPX_FX, not LB_DB, to
+	lpx_set_col_bnds when lb[i] == ub[i].
+	From: Zhi Wang <zcwang@umich.edu>.
+
 	* graphics.h.in (colormap_property::colormap_property):
 	Use jet colormap as default.
 
--- a/src/DLD-FUNCTIONS/__glpk__.cc	Thu Sep 13 19:13:56 2007 +0000
+++ b/src/DLD-FUNCTIONS/__glpk__.cc	Fri Sep 14 05:21:57 2007 +0000
@@ -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])
--- a/src/graphics.cc	Thu Sep 13 19:13:56 2007 +0000
+++ b/src/graphics.cc	Fri Sep 14 05:21:57 2007 +0000
@@ -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"),
--- a/src/graphics.h.in	Thu Sep 13 19:13:56 2007 +0000
+++ b/src/graphics.h.in	Fri Sep 14 05:21:57 2007 +0000
@@ -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