Mercurial > hg > octave-lyh
comparison 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 |
comparison
equal
deleted
inserted
replaced
496:e7c5b23b34d3 | 497:88614b380d6e |
---|---|
53 const Complex*, const int*, double*, int*, | 53 const Complex*, const int*, double*, int*, |
54 long, long); | 54 long, long); |
55 } | 55 } |
56 | 56 |
57 #ifdef WITH_DLD | 57 #ifdef WITH_DLD |
58 tree_constant * | 58 Octave_object |
59 builtin_syl_2 (const tree_constant *args, int nargin, int nargout) | 59 builtin_syl_2 (const Octave_object& args, int nargin, int nargout) |
60 { | 60 { |
61 return syl (args, nargin, nargout); | 61 return syl (args, nargin, nargout); |
62 } | 62 } |
63 #endif | 63 #endif |
64 | 64 |
65 tree_constant * | 65 Octave_object |
66 syl (const tree_constant *args, int nargin, int nargout) | 66 syl (const Octave_object& args, int nargin, int nargout) |
67 { | 67 { |
68 tree_constant *retval = NULL_TREE_CONST; | 68 Octave_object retval; |
69 | 69 |
70 tree_constant arga = args[1].make_numeric (); | 70 tree_constant arga = args(1).make_numeric (); |
71 tree_constant argb = args[2].make_numeric (); | 71 tree_constant argb = args(2).make_numeric (); |
72 tree_constant argc = args[3].make_numeric (); | 72 tree_constant argc = args(3).make_numeric (); |
73 | 73 |
74 if (arga.is_empty () || argb.is_empty () || argc.is_empty ()) | 74 if (arga.is_empty () || argb.is_empty () || argc.is_empty ()) |
75 retval = vector_of_empties (nargout, "syl"); | 75 retval = vector_of_empties (nargout, "syl"); |
76 else | 76 else |
77 { | 77 { |
96 return retval; | 96 return retval; |
97 } | 97 } |
98 | 98 |
99 // Dimensions look o.k., let's solve the problem. | 99 // Dimensions look o.k., let's solve the problem. |
100 | 100 |
101 retval = new tree_constant[nargout+1]; | 101 retval.resize (nargout ? nargout : 1); |
102 | 102 |
103 if (arga.is_complex_type () || argb.is_complex_type () | 103 if (arga.is_complex_type () || argb.is_complex_type () |
104 || argc.is_complex_type ()) | 104 || argc.is_complex_type ()) |
105 { | 105 { |
106 | 106 |
136 cx.fortran_vec (), &a_rows, &scale, &info, | 136 cx.fortran_vec (), &a_rows, &scale, &info, |
137 1L, 1L); | 137 1L, 1L); |
138 | 138 |
139 cx = -ua * cx * ub.hermitian (); | 139 cx = -ua * cx * ub.hermitian (); |
140 | 140 |
141 retval[0] = tree_constant (cx); | 141 retval(0) = tree_constant (cx); |
142 } | 142 } |
143 else | 143 else |
144 { | 144 { |
145 | 145 |
146 // Do everything in real arithmetic; | 146 // Do everything in real arithmetic; |
178 if (info) | 178 if (info) |
179 error ("syl: trouble in dtrsyl info = %d", info); | 179 error ("syl: trouble in dtrsyl info = %d", info); |
180 | 180 |
181 cx = -ua*cx*ub.transpose (); | 181 cx = -ua*cx*ub.transpose (); |
182 | 182 |
183 retval[0] = tree_constant (cx); | 183 retval(0) = tree_constant (cx); |
184 } | 184 } |
185 } | 185 } |
186 return retval; | 186 return retval; |
187 } | 187 } |
188 | 188 |