changeset 6376:0eac3484e8df

[project @ 2007-03-02 02:18:37 by jwe]
author jwe
date Fri, 02 Mar 2007 02:18:38 +0000
parents 5fced7a5eee8
children d42176e0d688
files liboctave/MatrixType.h scripts/ChangeLog scripts/image/__img__.m src/ChangeLog src/ov-base-mat.h src/ov-base-scalar.h
diffstat 6 files changed, 28 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/MatrixType.h	Thu Mar 01 17:23:40 2007 +0000
+++ b/liboctave/MatrixType.h	Fri Mar 02 02:18:38 2007 +0000
@@ -51,7 +51,7 @@
   };
 
   MatrixType (void);
-    
+
   MatrixType (const MatrixType &a);
 
   MatrixType (const Matrix &a);
--- a/scripts/ChangeLog	Thu Mar 01 17:23:40 2007 +0000
+++ b/scripts/ChangeLog	Fri Mar 02 02:18:38 2007 +0000
@@ -1,3 +1,7 @@
+2007-03-01  Daniel J Sebald  <daniel.sebald@ieee.org>
+
+	* image/__img__.m: Don't set xlim and ylim properties.
+
 2007-03-01  Paul Kienzle  <pkienzle@users.sf.net>
 
 	* general/interp1.m: Fix *style cases for decreasing x.
--- a/scripts/image/__img__.m	Thu Mar 01 17:23:40 2007 +0000
+++ b/scripts/image/__img__.m	Fri Mar 02 02:18:38 2007 +0000
@@ -62,7 +62,7 @@
 
   __uiobject_adopt__ (ca, tmp);
 
-  set (ca, "view", [0, 90], "xlim", xlim, "ylim", ylim);
+  set (ca, "view", [0, 90]);
 
   if (nargout > 0)
     h = tmp;
--- a/src/ChangeLog	Thu Mar 01 17:23:40 2007 +0000
+++ b/src/ChangeLog	Fri Mar 02 02:18:38 2007 +0000
@@ -1,3 +1,12 @@
+2007-03-01  John W. Eaton  <jwe@octave.org>
+
+	* ov-base-mat.h	(octave_base_matrix::octave_base_matrix (const MT&), 
+	(octave_base_matrix::octave_base_matrix (const MT&, const MatrixType&)):
+	Use common definition with default argument value.
+	* ov-base-scalar.h (octave_base_scalar<T>::typ): New data member.
+	Initialize in constructors.
+	(octave_base_scalar<T>::matrix_type): New funtions.
+
 2007-03-01  David Bateman  <dbateman@free.fr>
 
         * DLD-FUNCTIONS/md5sum.cc: New file.
--- a/src/ov-base-mat.h	Thu Mar 01 17:23:40 2007 +0000
+++ b/src/ov-base-mat.h	Fri Mar 02 02:18:38 2007 +0000
@@ -31,14 +31,13 @@
 
 #include "mx-base.h"
 #include "str-vec.h"
+#include "MatrixType.h"
 
 #include "error.h"
 #include "oct-obj.h"
 #include "ov-base.h"
 #include "ov-typeinfo.h"
 
-#include "MatrixType.h"
-
 class Octave_map;
 
 class tree_walker;
@@ -54,14 +53,7 @@
   octave_base_matrix (void)
     : octave_base_value (), typ (MatrixType ()) { }
 
-  octave_base_matrix (const MT& m)
-    : octave_base_value (), matrix (m), typ (MatrixType ())
-  {
-    if (matrix.ndims () == 0)
-      matrix.resize (dim_vector (0, 0));
-  }
-
-  octave_base_matrix (const MT& m, const MatrixType& t)
+  octave_base_matrix (const MT& m, const MatrixType& t = MatrixType ())
     : octave_base_value (), matrix (m), typ (t)
   {
     if (matrix.ndims () == 0)
--- a/src/ov-base-scalar.h	Thu Mar 01 17:23:40 2007 +0000
+++ b/src/ov-base-scalar.h	Fri Mar 02 02:18:38 2007 +0000
@@ -33,6 +33,7 @@
 #include "lo-utils.h"
 #include "oct-alloc.h"
 #include "str-vec.h"
+#include "MatrixType.h"
 
 #include "ov-base.h"
 #include "ov-typeinfo.h"
@@ -46,13 +47,13 @@
 public:
 
   octave_base_scalar (void)
-    : octave_base_value () { }
+    : octave_base_value (), typ (MatrixType ()) { }
 
-  octave_base_scalar (const ST& s)
-    : octave_base_value (), scalar (s) { }
+  octave_base_scalar (const ST& s, const MatrixType& t = MatrixType ())
+    : octave_base_value (), scalar (s), typ (t) { }
 
   octave_base_scalar (const octave_base_scalar& s)
-    : octave_base_value (), scalar (s.scalar) { }
+    : octave_base_value (), scalar (s.scalar), typ (s.typ) { }
 
   ~octave_base_scalar (void) { }
 
@@ -92,6 +93,10 @@
 
   octave_value any (int = 0) const { return (scalar != ST ()); }
 
+  MatrixType matrix_type (void) const { return typ; }
+  MatrixType matrix_type (const MatrixType& _typ) const
+    { MatrixType ret = typ; typ = _typ; return ret; }
+
   bool is_scalar_type (void) const { return true; }
 
   bool is_numeric_type (void) const { return true; }
@@ -112,6 +117,8 @@
 
   // The value of this scalar.
   ST scalar;
+
+  mutable MatrixType typ;
 };
 
 #endif