Mercurial > hg > octave-nkf
changeset 516:309fc59f66ee
[project @ 1994-07-13 02:31:31 by jwe]
author | jwe |
---|---|
date | Wed, 13 Jul 1994 02:31:31 +0000 |
parents | e078f05f4aac |
children | be927cad4cf7 |
files | src/balance.cc src/chol.cc src/colloc.cc src/dassl.cc src/det.cc src/eig.cc src/expm.cc src/fft.cc src/fsolve.cc src/givens.cc src/hess.cc src/ifft.cc src/inv.cc src/lsode.cc src/lu.cc src/npsol.cc src/qpsol.cc src/qr.cc src/quad.cc src/qzval.cc src/rand.cc src/schur.cc src/svd.cc src/syl.cc |
diffstat | 24 files changed, 180 insertions(+), 177 deletions(-) [+] |
line wrap: on
line diff
--- a/src/balance.cc +++ b/src/balance.cc @@ -60,15 +60,16 @@ // determine if balancing option is listed // set my_nargin to the number of matrix inputs - if (args(nargin-1).const_type () == tree_constant_rep::string_constant ){ - bal_job = args(nargin-1).string_value (); - my_nargin = nargin-2; - } + if (args(nargin-1).const_type () == tree_constant_rep::string_constant) + { + bal_job = args(nargin-1).string_value (); + my_nargin = nargin-2; + } else - { - bal_job = "B"; - my_nargin = nargin-1; - } + { + bal_job = "B"; + my_nargin = nargin-1; + } tree_constant arg = args(1).make_numeric (); int a_nr = arg.rows (); @@ -81,11 +82,13 @@ int flag = user_pref.propagate_empty_matrices; if (flag != 0) { - if (flag < 0) warning ("balance: argument is empty matrix"); + if (flag < 0) + warning ("balance: argument is empty matrix"); + Matrix m; retval.resize (2); - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); + retval(0) = m; + retval(1) = m; } else error ("balance: empty matrix is invalid as argument"); @@ -139,11 +142,11 @@ ComplexAEPBALANCE result (caa, bal_job); if (nargout == 0 || nargout == 1) - retval(0) = tree_constant(result.balanced_matrix ()); + retval(0) = result.balanced_matrix (); else { - retval(0) = tree_constant (result.balancing_matrix ()); - retval(1) = tree_constant (result.balanced_matrix ()); + retval(0) = result.balancing_matrix (); + retval(1) = result.balanced_matrix (); } } else @@ -151,11 +154,11 @@ AEPBALANCE result (aa, bal_job); if (nargout == 0 || nargout == 1) - retval(0) = tree_constant (result.balanced_matrix ()); + retval(0) = result.balanced_matrix (); else { - retval(0) = tree_constant (result.balancing_matrix ()); - retval(1) = tree_constant (result.balanced_matrix ()); + retval(0) = result.balancing_matrix (); + retval(1) = result.balanced_matrix (); } } break; @@ -197,7 +200,8 @@ } else { - if (brg.is_matrix_type ()) bb = brg.matrix_value (); + if (brg.is_matrix_type ()) + bb = brg.matrix_value (); else { double d = brg.double_value (); @@ -241,17 +245,17 @@ case 0: case 1: warning ("balance: should use two output arguments"); - retval(0) = tree_constant (caa); + retval(0) = caa; break; case 2: - retval(0) = tree_constant (caa); - retval(1) = tree_constant (cbb); + retval(0) = caa; + retval(1) = cbb; break; case 4: - retval(0) = tree_constant (result.left_balancing_matrix ()); - retval(1) = tree_constant (result.right_balancing_matrix ()); - retval(2) = tree_constant (caa); - retval(3) = tree_constant (cbb); + retval(0) = result.left_balancing_matrix (); + retval(1) = result.right_balancing_matrix (); + retval(2) = caa; + retval(3) = cbb; break; default: error ("balance: invalid number of output arguments"); @@ -265,17 +269,17 @@ case 0: case 1: warning ("balance: should use two output arguments"); - retval(0) = tree_constant (result.balanced_a_matrix ()); + retval(0) = result.balanced_a_matrix (); break; case 2: - retval(0) = tree_constant (result.balanced_a_matrix ()); - retval(1) = tree_constant (result.balanced_b_matrix ()); + retval(0) = result.balanced_a_matrix (); + retval(1) = result.balanced_b_matrix (); break; case 4: - retval(0) = tree_constant (result.left_balancing_matrix ()); - retval(1) = tree_constant (result.right_balancing_matrix ()); - retval(2) = tree_constant (result.balanced_a_matrix ()); - retval(3) = tree_constant (result.balanced_b_matrix ()); + retval(0) = result.left_balancing_matrix (); + retval(1) = result.right_balancing_matrix (); + retval(2) = result.balanced_a_matrix (); + retval(3) = result.balanced_b_matrix (); break; default: error ("balance: invalid number of output arguments");
--- a/src/chol.cc +++ b/src/chol.cc @@ -62,7 +62,7 @@ if (flag < 0) gripe_empty_arg ("chol", 0); Matrix m; - retval = tree_constant (m); + retval = m; } else gripe_empty_arg ("chol", 1); @@ -80,7 +80,7 @@ if (info != 0) error ("chol: matrix not positive definite"); else - retval = tree_constant (fact.chol_matrix ()); + retval = fact.chol_matrix (); } break; case tree_constant_rep::complex_matrix_constant: @@ -91,19 +91,19 @@ if (info != 0) error ("chol: matrix not positive definite"); else - retval = tree_constant (fact.chol_matrix ()); + retval = fact.chol_matrix (); } break; case tree_constant_rep::scalar_constant: { double d = tmp.double_value (); - retval = tree_constant (d); + retval = d; } break; case tree_constant_rep::complex_scalar_constant: { Complex c = tmp.complex_value (); - retval = tree_constant (c); + retval = c; } break; default:
--- a/src/colloc.cc +++ b/src/colloc.cc @@ -117,10 +117,10 @@ retval.resize (4); - retval(0) = tree_constant (r); - retval(1) = tree_constant (A); - retval(2) = tree_constant (B); - retval(3) = tree_constant (q); + retval(0) = r; + retval(1) = A; + retval(2) = B; + retval(3) = q; return retval; }
--- a/src/dassl.cc +++ b/src/dassl.cc @@ -68,7 +68,7 @@ // tree_constant name (dassl_fcn->name ()); Octave_object args (4); // args(0) = name; - args(3) = tree_constant (t); + args(3) = t; if (nstates > 1) { @@ -164,8 +164,8 @@ output = dae.integrate (out_times, deriv_output); retval.resize (2); - retval(0) = tree_constant (output); - retval(1) = tree_constant (deriv_output); + retval(0) = output; + retval(1) = deriv_output; return retval; }
--- a/src/det.cc +++ b/src/det.cc @@ -63,7 +63,7 @@ } if (nr == 0 && nc == 0) - return tree_constant (1.0); + return 1.0; switch (tmp.const_type ()) { @@ -82,7 +82,7 @@ else d = det.value (); - retval = tree_constant (d); + retval = d; } else gripe_square_matrix_required ("det"); @@ -103,7 +103,7 @@ else c = det.value (); - retval = tree_constant (c); + retval = c; } else gripe_square_matrix_required ("det"); @@ -112,13 +112,13 @@ case tree_constant_rep::scalar_constant: { double d = tmp.double_value (); - retval = tree_constant (d); + retval = d; } break; case tree_constant_rep::complex_scalar_constant: { Complex c = tmp.complex_value (); - retval = tree_constant (c); + retval = c; } break; default:
--- a/src/eig.cc +++ b/src/eig.cc @@ -60,8 +60,8 @@ gripe_empty_arg ("eig", 0); Matrix m; retval.resize (2); - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); + retval(0) = m; + retval(1) = m; } else gripe_empty_arg ("eig", 1); @@ -106,7 +106,7 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (result.eigenvalues (), 1); + retval(0) = result.eigenvalues (), 1; } else { @@ -115,8 +115,8 @@ ComplexDiagMatrix d (result.eigenvalues ()); retval.resize (2); - retval(0) = tree_constant (result.eigenvectors ()); - retval(1) = tree_constant (d); + retval(0) = result.eigenvectors (); + retval(1) = d; } return retval;
--- a/src/expm.cc +++ b/src/expm.cc @@ -89,7 +89,7 @@ if (flag < 0) gripe_empty_arg ("expm", 0); Matrix m; - retval = tree_constant (m); + retval = m; } else gripe_empty_arg ("expm", 1); } @@ -198,13 +198,13 @@ result = result * exp (trshift); - retval = tree_constant (result); + retval = result; } break; case tree_constant_rep::complex_scalar_constant: { Complex c = tmp.complex_value (); - retval = tree_constant (exp (c)); + retval = exp (c); } break; case tree_constant_rep::matrix_constant: @@ -298,13 +298,13 @@ result = result * exp (trshift); - retval = tree_constant (result); + retval = result; } break; case tree_constant_rep::scalar_constant: { double d = tmp.double_value (); - retval = tree_constant (exp (d)); + retval = exp (d); } break; default:
--- a/src/fft.cc +++ b/src/fft.cc @@ -59,7 +59,7 @@ if (flag < 0) gripe_empty_arg ("fft", 0); Matrix m; - retval = tree_constant (m); + retval = m; } else gripe_empty_arg ("fft", 1); @@ -73,14 +73,14 @@ { Matrix m = tmp.matrix_value (); ComplexMatrix mfft = m.fourier (); - retval = tree_constant (mfft); + retval = mfft; } break; case tree_constant_rep::complex_matrix_constant: { ComplexMatrix m = tmp.complex_matrix_value (); ComplexMatrix mfft = m.fourier (); - retval = tree_constant (mfft); + retval = mfft; } break; case tree_constant_rep::scalar_constant:
--- a/src/fsolve.cc +++ b/src/fsolve.cc @@ -91,7 +91,7 @@ int n = x.capacity (); -// tree_constant name = tree_constant (fsolve_fcn->name ()); +// tree_constant name = fsolve_fcn->name (); Octave_object args (2); // args(0) = name; @@ -159,13 +159,10 @@ info = hybrd_info_to_fsolve_info (info); retval.resize (nargout ? nargout : 1); - retval(0) = tree_constant (soln, 1); + retval(0) = soln, 1; if (nargout > 1) - retval(1) = tree_constant ((double) info); - - if (nargout > 2) - retval(2) = tree_constant (); + retval(1) = (double) info; return retval; }
--- a/src/givens.cc +++ b/src/givens.cc @@ -120,7 +120,7 @@ g.elem (0, 1) = cs; g.elem (1, 0) = -conj (cs); - retval(0) = tree_constant (g); + retval(0) = g; } break; @@ -151,13 +151,13 @@ g.elem (0, 1) = s; g.elem (1, 0) = -s; - retval(0) = tree_constant (g); + retval(0) = g; } break; case 2: // output scalar values - retval(0) = tree_constant (cc); - retval(1) = tree_constant (s); + retval(0) = cc; + retval(1) = s; break; default:
--- a/src/hess.cc +++ b/src/hess.cc @@ -61,8 +61,8 @@ warning ("hess: argument is empty matrix"); Matrix m; retval.resize (2); - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); + retval(0) = m; + retval(1) = m; } else error ("hess: empty matrix is invalid as argument"); @@ -90,13 +90,13 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (result.hess_matrix ()); + retval(0) = result.hess_matrix (); } else { retval.resize (2); - retval(0) = tree_constant (result.unitary_hess_matrix ()); - retval(1) = tree_constant (result.hess_matrix ()); + retval(0) = result.unitary_hess_matrix (); + retval(1) = result.hess_matrix (); } } break; @@ -109,13 +109,13 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (result.hess_matrix ()); + retval(0) = result.hess_matrix (); } else { retval.resize (2); - retval(0) = tree_constant (result.unitary_hess_matrix ()); - retval(1) = tree_constant (result.hess_matrix ()); + retval(0) = result.unitary_hess_matrix (); + retval(1) = result.hess_matrix (); } } break; @@ -125,13 +125,13 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (d); + retval(0) = d; } else { retval.resize (2); - retval(0) = tree_constant (1); - retval(1) = tree_constant (d); + retval(0) = 1; + retval(1) = d; } } break; @@ -141,13 +141,13 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (c); + retval(0) = c; } else { retval.resize (2); - retval(0) = tree_constant (1); - retval(1) = tree_constant (c); + retval(0) = 1; + retval(1) = c; } } break;
--- a/src/ifft.cc +++ b/src/ifft.cc @@ -59,7 +59,7 @@ if (flag < 0) gripe_empty_arg ("ifft", 0); Matrix m; - retval = tree_constant (m); + retval = m; } else gripe_empty_arg ("ifft", 1); @@ -73,14 +73,14 @@ { Matrix m = tmp.matrix_value (); ComplexMatrix mifft = m.ifourier (); - retval = tree_constant (mifft); + retval = mifft; } break; case tree_constant_rep::complex_matrix_constant: { ComplexMatrix m = tmp.complex_matrix_value (); ComplexMatrix mifft = m.ifourier (); - retval = tree_constant (mifft); + retval = mifft; } break; case tree_constant_rep::scalar_constant:
--- a/src/inv.cc +++ b/src/inv.cc @@ -64,7 +64,7 @@ Matrix mtmp; if (nr == 0 && nc == 0) - return tree_constant (mtmp); + return mtmp; switch (tmp.const_type ()) { @@ -80,7 +80,7 @@ warning ("inverse: matrix singular to machine precision,\ rcond = %g", rcond); else - retval = tree_constant (minv); + retval = minv; } else gripe_square_matrix_required ("inverse"); @@ -89,7 +89,7 @@ case tree_constant_rep::scalar_constant: { double d = 1.0 / tmp.double_value (); - retval = tree_constant (d); + retval = d; } break; case tree_constant_rep::complex_matrix_constant: @@ -104,7 +104,7 @@ warning ("inverse: matrix singular to machine precision,\ rcond = %g", rcond); else - retval = tree_constant (minv); + retval = minv; } else gripe_square_matrix_required ("inverse"); @@ -113,7 +113,7 @@ case tree_constant_rep::complex_scalar_constant: { Complex c = 1.0 / tmp.complex_value (); - retval = tree_constant (c); + retval = c; } break; default:
--- a/src/lsode.cc +++ b/src/lsode.cc @@ -66,7 +66,7 @@ // tree_constant name (lsode_fcn->name ()); Octave_object args (3); // args(0) = name; - args(2) = tree_constant (t); + args(2) = t; if (nstates > 1) { @@ -147,7 +147,7 @@ output = ode.integrate (out_times); retval.resize (1); - retval(0) = tree_constant (output); + retval(0) = output; return retval; }
--- a/src/lu.cc +++ b/src/lu.cc @@ -55,10 +55,11 @@ { if (flag < 0) gripe_empty_arg ("lu", 0); + Matrix m; - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); - retval(2) = tree_constant (m); + retval(0) = m; + retval(1) = m; + retval(2) = m; return retval; } else @@ -80,15 +81,15 @@ { Matrix P = fact.P (); Matrix L = P.transpose () * fact.L (); - retval(0) = tree_constant (L); - retval(1) = tree_constant (fact.U ()); + retval(0) = L; + retval(1) = fact.U (); } break; case 3: default: - retval(0) = tree_constant (fact.L ()); - retval(1) = tree_constant (fact.U ()); - retval(2) = tree_constant (fact.P ()); + retval(0) = fact.L (); + retval(1) = fact.U (); + retval(2) = fact.P (); break; } } @@ -109,15 +110,15 @@ { ComplexMatrix P = fact.P (); ComplexMatrix L = P.transpose () * fact.L (); - retval(0) = tree_constant (L); - retval(1) = tree_constant (fact.U ()); + retval(0) = L; + retval(1) = fact.U (); } break; case 3: default: - retval(0) = tree_constant (fact.L ()); - retval(1) = tree_constant (fact.U ()); - retval(2) = tree_constant (fact.P ()); + retval(0) = fact.L (); + retval(1) = fact.U (); + retval(2) = fact.P (); break; } } @@ -128,17 +129,17 @@ case tree_constant_rep::scalar_constant: { double d = tmp.double_value (); - retval(0) = tree_constant (1.0); - retval(1) = tree_constant (d); - retval(2) = tree_constant (1.0); + retval(0) = 1.0; + retval(1) = d; + retval(2) = 1.0; } break; case tree_constant_rep::complex_scalar_constant: { Complex c = tmp.complex_value (); - retval(0) = tree_constant (1.0); - retval(1) = tree_constant (c); - retval(2) = tree_constant (1.0); + retval(0) = 1.0; + retval(1) = c; + retval(2) = 1.0; } break; default:
--- a/src/npsol.cc +++ b/src/npsol.cc @@ -71,15 +71,15 @@ Matrix m (n, 1); for (int i = 0; i < n; i++) m (i, 0) = x.elem (i); - decision_vars = tree_constant (m); + decision_vars = m; } else { double d = x.elem (0); - decision_vars = tree_constant (d); + decision_vars = d; } -// tree_constant name = tree_constant (npsol_objective->name ()); +// tree_constant name = npsol_objective->name (); Octave_object args (2); // args(0) = name; args(1) = decision_vars; @@ -148,15 +148,15 @@ Matrix m (n, 1); for (int i = 0; i < n; i++) m (i, 0) = x.elem (i); - decision_vars = tree_constant (m); + decision_vars = m; } else { double d = x.elem (0); - decision_vars = tree_constant (d); + decision_vars = d; } -// tree_constant name = tree_constant (npsol_constraints->name ()); +// tree_constant name = npsol_constraints->name (); Octave_object args (2); // args(0) = name; args(1) = decision_vars; @@ -474,13 +474,13 @@ solved: retval.resize (nargout ? nargout : 1); - retval(0) = tree_constant (soln, 1); + retval(0) = soln, 1; if (nargout > 1) - retval(1) = tree_constant (objf); + retval(1) = objf; if (nargout > 2) - retval(2) = tree_constant ((double) inform); + retval(2) = (double) inform; if (nargout > 3) - retval(3) = tree_constant (lambda); + retval(3) = lambda; return retval; }
--- a/src/qpsol.cc +++ b/src/qpsol.cc @@ -191,13 +191,13 @@ solved: retval.resize (nargout ? nargout : 1); - retval(0) = tree_constant (soln, 1); + retval(0) = soln, 1; if (nargout > 1) - retval(1) = tree_constant (objf); + retval(1) = objf; if (nargout > 2) - retval(2) = tree_constant ((double) inform); + retval(2) = (double) inform; if (nargout > 3) - retval(3) = tree_constant (lambda); + retval(3) = lambda; return retval; }
--- a/src/qr.cc +++ b/src/qr.cc @@ -59,8 +59,8 @@ if (flag < 0) gripe_empty_arg ("qr", 0); Matrix m; - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); + retval(0) = m; + retval(1) = m; } else gripe_empty_arg ("qr", 1); @@ -74,30 +74,30 @@ { Matrix m = tmp.matrix_value (); QR fact (m); - retval(0) = tree_constant (fact.Q ()); - retval(1) = tree_constant (fact.R ()); + retval(0) = fact.Q (); + retval(1) = fact.R (); } break; case tree_constant_rep::complex_matrix_constant: { ComplexMatrix m = tmp.complex_matrix_value (); ComplexQR fact (m); - retval(0) = tree_constant (fact.Q ()); - retval(1) = tree_constant (fact.R ()); + retval(0) = fact.Q (); + retval(1) = fact.R (); } break; case tree_constant_rep::scalar_constant: { double d = tmp.double_value (); - retval(0) = tree_constant (1.0); - retval(1) = tree_constant (d); + retval(0) = 1.0; + retval(1) = d; } break; case tree_constant_rep::complex_scalar_constant: { Complex c = tmp.complex_value (); - retval(0) = tree_constant (1.0); - retval(1) = tree_constant (c); + retval(0) = 1.0; + retval(1) = c; } break; default:
--- a/src/quad.cc +++ b/src/quad.cc @@ -62,10 +62,10 @@ { double retval = 0.0; -// tree_constant name = tree_constant (quad_fcn->name ()); +// tree_constant name = quad_fcn->name (); Octave_object args (2); // args(0) = name; - args(1) = tree_constant (x); + args(1) = x; if (quad_fcn != (tree_fvc *) NULL) { @@ -190,10 +190,10 @@ retval.resize (4); - retval(0) = tree_constant (val); - retval(1) = tree_constant ((double) ier); - retval(2) = tree_constant ((double) nfun); - retval(3) = tree_constant (abserr); + retval(0) = val; + retval(1) = ier; + retval(2) = nfun; + retval(3) = abserr; return retval; }
--- a/src/qzval.cc +++ b/src/qzval.cc @@ -155,7 +155,7 @@ cx (cnt) = (alfr (i) + Im * alfi (i)) / beta (i); } } - retval(0) = tree_constant (cx); + retval(0) = cx; } } return retval;
--- a/src/rand.cc +++ b/src/rand.cc @@ -154,13 +154,13 @@ { retval.resize (1); char *s = curr_rand_dist (); - retval(0) = tree_constant (s); + retval(0) = s; } else if (strcmp (s_arg, "seed") == 0) { retval.resize (1); double d = curr_rand_seed (); - retval(0) = tree_constant (d); + retval(0) = d; } else if (strcmp (s_arg, "uniform") == 0) current_distribution = uniform; @@ -215,7 +215,7 @@ { retval.resize (1); Matrix m (0, 0); - retval(0) = tree_constant (m); + retval(0) = m; } else if (n > 0 && m > 0) { @@ -243,7 +243,7 @@ } } - retval(0) = tree_constant (rand_mat); + retval(0) = rand_mat; } else error ("rand: invalid negative argument");
--- a/src/schur.cc +++ b/src/schur.cc @@ -63,8 +63,8 @@ warning ("schur: incorrect ordered schur argument `%c'", *ord); Matrix m; retval.resize (2); - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); + retval(0) = m; + retval(1) = m; return retval; } int a_nr = arg.rows (); @@ -79,8 +79,8 @@ warning ("schur: argument is empty matrix"); Matrix m; retval.resize (2); - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); + retval(0) = m; + retval(1) = m; } else error ("schur: empty matrix is invalid as argument"); @@ -107,13 +107,13 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (result.schur_matrix ()); + retval(0) = result.schur_matrix (); } else { retval.resize (2); - retval(0) = tree_constant (result.unitary_matrix ()); - retval(1) = tree_constant (result.schur_matrix ()); + retval(0) = result.unitary_matrix (); + retval(1) = result.schur_matrix (); } } break; @@ -126,13 +126,13 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (result.schur_matrix ()); + retval(0) = result.schur_matrix (); } else { retval.resize (2); - retval(0) = tree_constant (result.unitary_matrix ()); - retval(1) = tree_constant (result.schur_matrix ()); + retval(0) = result.unitary_matrix (); + retval(1) = result.schur_matrix (); } } break; @@ -142,13 +142,13 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (d); + retval(0) = d; } else { retval.resize (2); - retval(0) = tree_constant (1); - retval(1) = tree_constant (d); + retval(0) = 1.0; + retval(1) = d; } } break; @@ -158,13 +158,13 @@ if (nargout == 0 || nargout == 1) { retval.resize (1); - retval(0) = tree_constant (c); + retval(0) = c; } else { retval.resize (2); - retval(0) = tree_constant (1); - retval(1) = tree_constant (c); + retval(0) = 1.0; + retval(1) = c; } } break;
--- a/src/svd.cc +++ b/src/svd.cc @@ -56,11 +56,12 @@ { if (flag < 0) gripe_empty_arg ("svd", 0); + Matrix m; retval.resize (3); - retval(0) = tree_constant (m); - retval(1) = tree_constant (m); - retval(2) = tree_constant (m); + retval(0) = m; + retval(1) = m; + retval(2) = m; } else gripe_empty_arg ("svd", 1); @@ -108,9 +109,9 @@ else { retval.resize (3); - retval(0) = tree_constant (result.left_singular_matrix ()); - retval(1) = tree_constant (sigma); - retval(2) = tree_constant (result.right_singular_matrix ()); + retval(0) = result.left_singular_matrix (); + retval(1) = sigma; + retval(2) = result.right_singular_matrix (); } } break; @@ -129,9 +130,9 @@ else { retval.resize (3); - retval(0) = tree_constant (result.left_singular_matrix ()); - retval(1) = tree_constant (sigma); - retval(2) = tree_constant (result.right_singular_matrix ()); + retval(0) = result.left_singular_matrix (); + retval(1) = sigma; + retval(2) = result.right_singular_matrix (); } } break;