diff src/oct-obj.h @ 526:a01a9db8ab69

[project @ 1994-07-20 18:46:24 by jwe]
author jwe
date Wed, 20 Jul 1994 18:48:55 +0000
parents 08a3f07adc78
children b04c0d02f2de
line wrap: on
line diff
--- a/src/oct-obj.h	Wed Jul 20 18:45:27 1994 +0000
+++ b/src/oct-obj.h	Wed Jul 20 18:48:55 1994 +0000
@@ -1,7 +1,7 @@
 // oct-obj.h                                            -*- C -*-
 /*
 
-Copyright (C) 1992, 1993, 1994 John W. Eaton
+Copyright (C) 1994 John W. Eaton
 
 This file is part of Octave.
 
@@ -24,9 +24,23 @@
 #if !defined (octave_oct_obj_h)
 #define octave_oct_obj_h 1
 
+#if defined (__GNUG__)
+#pragma interface
+#endif
+
 #include "Array.h"
+#include "mx-base.h"
 
 class tree_constant;
+class Matrix;
+class RowVector;
+class ColumnVector;
+class DiagMatrix;
+class ComplexMatrix;
+class ComplexRowVector;
+class ComplexColumnVector;
+class ComplexDiagMatrix;
+class Range;
 
 class Octave_object : public Array<tree_constant>
 {
@@ -37,6 +51,25 @@
   Octave_object (int n, const tree_constant& val)
     : Array<tree_constant> (n, val) { }
 
+  Octave_object (const tree_constant& tc) : Array<tree_constant> (1, tc) { }
+
+  Octave_object (double d);
+  Octave_object (const Matrix& m);
+  Octave_object (const DiagMatrix& d);
+  Octave_object (const RowVector& v, int pcv = -1);
+  Octave_object (const ColumnVector& v, int pcv = -1);
+
+  Octave_object (const Complex& c);
+  Octave_object (const ComplexMatrix& m);
+  Octave_object (const ComplexDiagMatrix& d);
+  Octave_object (const ComplexRowVector& v, int pcv = -1);
+  Octave_object (const ComplexColumnVector& v, int pcv = -1);
+
+  Octave_object (const char *s);
+
+  Octave_object (double base, double limit, double inc);
+  Octave_object (const Range& r);
+
   Octave_object (const Octave_object& obj) : Array<tree_constant> (obj) { }
 
   Octave_object& operator = (const Octave_object& obj)
@@ -45,32 +78,23 @@
       return *this;
     }
 
-#if 0
-// For now, translate the index, since it will be somewhat difficult
-// to fix this without some major (and relatively risky) surgery.
-
-  tree_constant& elem (int n)
-    { return Array<tree_constant>::elem (n - 1); }
-
-  tree_constant& checkelem (int n);
-    { return Array<tree_constant>::checkelem (n - 1); }
+// Assignment will resize on range errors.
 
   tree_constant& operator () (int n);
-    { return Array<tree_constant>::operator () (n - 1); }
+
+  tree_constant operator () (int n) const;
+
+private:
 
-// No checking.
+  void maybe_resize (int n);
+
+  tree_constant& elem (int n);
+  tree_constant& checkelem (int n);
+
   tree_constant& xelem (int n);
-    { return Array<tree_constant>::xelem (n - 1); }
 
   tree_constant elem (int n) const;
-    { return Array<tree_constant>::elem (n - 1); }
-
   tree_constant checkelem (int n) const;
-    { return Array<tree_constant>::checkelem (n - 1); }
-
-  tree_constant operator () (int n) const;
-    { return Array<tree_constant>::operator () (n - 1); }
-#endif
 };
 
 #endif