changeset 4790:91a84c9bdadb

[project @ 2004-02-19 20:15:17 by jwe]
author jwe
date Thu, 19 Feb 2004 20:15:18 +0000
parents ac4441e16ffa
children 62f2fb593455
files scripts/ChangeLog scripts/plot/figure.m src/ChangeLog src/xpow.cc
diffstat 4 files changed, 35 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Thu Feb 19 16:16:34 2004 +0000
+++ b/scripts/ChangeLog	Thu Feb 19 20:15:18 2004 +0000
@@ -1,3 +1,8 @@
+2004-02-19  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* plot/figure.m: Also look for GNUTERM in the environment and use
+	that if it is set (for OS X).  From Per Persson <persquare@mac.com>.
+
 2004-02-18  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* control/base/__stepimp__.m: Only call clearplot if we will be
--- a/scripts/plot/figure.m	Thu Feb 19 16:16:34 2004 +0000
+++ b/scripts/plot/figure.m	Thu Feb 19 20:15:18 2004 +0000
@@ -39,12 +39,16 @@
 
   if (nargin < 2)
     if (gnuplot_has_frames)
-      if (! isempty (getenv ("DISPLAY")))
+      gnuterm = getenv ("GNUTERM");
+      if (isempty (gnuterm) && ! isempty ("DISPLAY"))
+	gnuterm = "x11";
+      endif
+      if (! isempty (gnuterm))
         oneplot ();
         figure_list = union (figure_list, f);
-        eval (sprintf ("gset term x11 %d\n", f));
+        eval (sprintf ("gset term %s %d\n", gnuterm, f));
       else
-        error ("figure: requires X11 and valid DISPLAY");
+        error ("figure: requires GNUTERM (Aqua) or DISPLAY (X11)");
       endif
     else
       error ("figure: gnuplot doesn't appear to support this feature");
--- a/src/ChangeLog	Thu Feb 19 16:16:34 2004 +0000
+++ b/src/ChangeLog	Thu Feb 19 20:15:18 2004 +0000
@@ -1,13 +1,19 @@
+2004-02-19  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* xpow.cc (elem_xpow (const Matrix&, double)):
+	Convert both operands to Complex if any element of A is negative.
+	(elem_xpow (const NDArray&, double)): Likewise.
+
 2004-02-18  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* load-save.cc (Voctave_core_format): New static_variable.
 	(octave_core_format): New function.
 	(symbols_of_load_save): Add DEFVAR for octave_core_format.
 	(get_save_format): Rename from get_default_save_format.
-	Pass name of format as arg.  New optional arg, default_format.
+	Pass name of format as arg.  New optional arg, fallback_format.
 	Change all uses.
 	(save_user_variables): Use pass Voctave_core_format to
-	get_save_format here.  Pass LS_BINARY as default_format.
+	get_save_format here.  Pass LS_BINARY as fallback_format.
 
 	* sighandlers.cc (my_friendly_exit): New optional arg, save_vars.
 	Only call save_user_variables if save_vars is true.
--- a/src/xpow.cc	Thu Feb 19 16:16:34 2004 +0000
+++ b/src/xpow.cc	Thu Feb 19 20:15:18 2004 +0000
@@ -565,8 +565,14 @@
 	for (int i = 0; i < nr; i++)
 	  {
 	    OCTAVE_QUIT;
+      
+	    // XXX FIXME XXX -- avoid apparent GNU libm bug by
+	    // converting A and B to complex instead of just A.
+
 	    Complex atmp (a (i, j));
-	    result (i, j) = pow (atmp, b);
+	    Complex btmp (b);
+
+	    result (i, j) = pow (atmp, btmp);
 	  }
 
       retval = result;
@@ -937,8 +943,14 @@
       for (int i = 0; i < a.length (); i++)
 	{
 	  OCTAVE_QUIT;
-	  Complex atmp (a(i));
-	  result(i) = pow (atmp, b);
+
+	  // XXX FIXME XXX -- avoid apparent GNU libm bug by
+	  // converting A and B to complex instead of just A.
+
+	  Complex atmp (a (i));
+	  Complex btmp (b);
+
+	  result(i) = pow (atmp, btmp);
 	}
 
       retval = result;