Mercurial > hg > octave-lyh
diff src/DLD-FUNCTIONS/pinv.cc @ 8916:a2878ba31a9e
add diag & perm matrix query methods to octave_value
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 06 Mar 2009 12:00:11 +0100 |
parents | c690e3772583 |
children | eb63fbe60fab |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/pinv.cc +++ b/src/DLD-FUNCTIONS/pinv.cc @@ -79,47 +79,27 @@ if (nargin == 2) warning ("pinv: tol is ignored for diagonal matrices"); - const octave_base_value& a = arg.get_rep (); if (arg.is_complex_type ()) { if (isfloat) - { - CAST_CONV_ARG (const octave_float_complex_diag_matrix&); - retval = v.float_complex_diag_matrix_value ().pseudo_inverse (); - } + retval = arg.float_complex_diag_matrix_value ().pseudo_inverse (); else - { - CAST_CONV_ARG (const octave_complex_diag_matrix&); - retval = v.complex_diag_matrix_value ().pseudo_inverse (); - } + retval = arg.complex_diag_matrix_value ().pseudo_inverse (); } else { if (isfloat) - { - CAST_CONV_ARG (const octave_float_diag_matrix&); - retval = v.float_diag_matrix_value ().pseudo_inverse (); - } + retval = arg.float_diag_matrix_value ().pseudo_inverse (); else - { - CAST_CONV_ARG (const octave_diag_matrix&); - retval = v.diag_matrix_value ().pseudo_inverse (); - } + retval = arg.diag_matrix_value ().pseudo_inverse (); } } else if (arg.is_perm_matrix ()) { - const octave_base_value& a = arg.get_rep (); if (isfloat) - { - CAST_CONV_ARG (const octave_float_perm_matrix&); - retval = v.perm_matrix_value ().inverse (); - } + retval = octave_value (arg.perm_matrix_value ().inverse (), true); else - { - CAST_CONV_ARG (const octave_perm_matrix&); - retval = v.perm_matrix_value ().inverse (); - } + retval = arg.perm_matrix_value ().inverse (); } else if (isfloat) {