diff src/syl.cc @ 497:88614b380d6e

[project @ 1994-07-08 02:00:57 by jwe]
author jwe
date Fri, 08 Jul 1994 02:08:37 +0000
parents 393e95f46b51
children 0f388340e607
line wrap: on
line diff
--- a/src/syl.cc
+++ b/src/syl.cc
@@ -55,21 +55,21 @@
 }
 
 #ifdef WITH_DLD
-tree_constant *
-builtin_syl_2 (const tree_constant *args, int nargin, int nargout)
+Octave_object
+builtin_syl_2 (const Octave_object& args, int nargin, int nargout)
 {
   return syl (args, nargin, nargout);
 }
 #endif
 
-tree_constant *
-syl (const tree_constant *args, int nargin, int nargout)
+Octave_object
+syl (const Octave_object& args, int nargin, int nargout)
 {
-  tree_constant *retval = NULL_TREE_CONST;
+  Octave_object retval;
 
-  tree_constant arga = args[1].make_numeric ();
-  tree_constant argb = args[2].make_numeric ();
-  tree_constant argc = args[3].make_numeric ();
+  tree_constant arga = args(1).make_numeric ();
+  tree_constant argb = args(2).make_numeric ();
+  tree_constant argc = args(3).make_numeric ();
 
   if (arga.is_empty () || argb.is_empty () || argc.is_empty ())
     retval = vector_of_empties (nargout, "syl");
@@ -98,7 +98,7 @@
   
 // Dimensions look o.k., let's solve the problem.
 
-    retval = new tree_constant[nargout+1];
+    retval.resize (nargout ? nargout : 1);
 
     if (arga.is_complex_type () || argb.is_complex_type ()
 	|| argc.is_complex_type ())
@@ -138,7 +138,7 @@
 
 	cx = -ua * cx * ub.hermitian ();
   
-	retval[0] = tree_constant (cx);
+	retval(0) = tree_constant (cx);
       }
     else
       {
@@ -180,7 +180,7 @@
   
 	cx = -ua*cx*ub.transpose ();
   
-	retval[0] = tree_constant (cx);
+	retval(0) = tree_constant (cx);
       }
     }
   return retval;