Mercurial > octave-nkf
diff src/DLD-FUNCTIONS/eig.cc @ 10154:40dfc0c99116
DLD-FUNCTIONS/*.cc: untabify
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 20 Jan 2010 17:33:41 -0500 |
parents | c2923c27c877 |
children | d0ce5e973937 |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/eig.cc Wed Jan 20 17:24:23 2010 -0500 +++ b/src/DLD-FUNCTIONS/eig.cc Wed Jan 20 17:33:41 2010 -0500 @@ -94,10 +94,10 @@ return octave_value_list (2, Matrix ()); if (!(arg_b.is_single_type() || arg_b.is_double_type ())) - { - gripe_wrong_type_arg ("eig", arg_b); - return retval; - } + { + gripe_wrong_type_arg ("eig", arg_b); + return retval; + } } if (nr_a != nc_a) @@ -122,132 +122,132 @@ FloatEIG result; if (nargin == 1) - { - if (arg_a.is_real_type ()) - { - ftmp_a = arg_a.float_matrix_value (); + { + if (arg_a.is_real_type ()) + { + ftmp_a = arg_a.float_matrix_value (); - if (error_state) - return retval; - else - result = FloatEIG (ftmp_a, nargout > 1); - } - else - { - fctmp_a = arg_a.float_complex_matrix_value (); + if (error_state) + return retval; + else + result = FloatEIG (ftmp_a, nargout > 1); + } + else + { + fctmp_a = arg_a.float_complex_matrix_value (); - if (error_state) - return retval; - else - result = FloatEIG (fctmp_a, nargout > 1); - } - } + if (error_state) + return retval; + else + result = FloatEIG (fctmp_a, nargout > 1); + } + } else if (nargin == 2) - { - if (arg_a.is_real_type () && arg_b.is_real_type ()) - { - ftmp_a = arg_a.float_matrix_value (); - ftmp_b = arg_b.float_matrix_value (); + { + if (arg_a.is_real_type () && arg_b.is_real_type ()) + { + ftmp_a = arg_a.float_matrix_value (); + ftmp_b = arg_b.float_matrix_value (); - if (error_state) - return retval; - else - result = FloatEIG (ftmp_a, ftmp_b, nargout > 1); - } - else - { - fctmp_a = arg_a.float_complex_matrix_value (); - fctmp_b = arg_b.float_complex_matrix_value (); + if (error_state) + return retval; + else + result = FloatEIG (ftmp_a, ftmp_b, nargout > 1); + } + else + { + fctmp_a = arg_a.float_complex_matrix_value (); + fctmp_b = arg_b.float_complex_matrix_value (); - if (error_state) - return retval; - else - result = FloatEIG (fctmp_a, fctmp_b, nargout > 1); - } - } + if (error_state) + return retval; + else + result = FloatEIG (fctmp_a, fctmp_b, nargout > 1); + } + } if (! error_state) - { - if (nargout == 0 || nargout == 1) - { - retval(0) = result.eigenvalues (); - } - else - { - // Blame it on Matlab. + { + if (nargout == 0 || nargout == 1) + { + retval(0) = result.eigenvalues (); + } + else + { + // Blame it on Matlab. - FloatComplexDiagMatrix d (result.eigenvalues ()); + FloatComplexDiagMatrix d (result.eigenvalues ()); - retval(1) = d; - retval(0) = result.eigenvectors (); - } - } + retval(1) = d; + retval(0) = result.eigenvectors (); + } + } } else { EIG result; if (nargin == 1) - { - if (arg_a.is_real_type ()) - { - tmp_a = arg_a.matrix_value (); + { + if (arg_a.is_real_type ()) + { + tmp_a = arg_a.matrix_value (); - if (error_state) - return retval; - else - result = EIG (tmp_a, nargout > 1); - } - else - { - ctmp_a = arg_a.complex_matrix_value (); + if (error_state) + return retval; + else + result = EIG (tmp_a, nargout > 1); + } + else + { + ctmp_a = arg_a.complex_matrix_value (); - if (error_state) - return retval; - else - result = EIG (ctmp_a, nargout > 1); - } - } + if (error_state) + return retval; + else + result = EIG (ctmp_a, nargout > 1); + } + } else if (nargin == 2) - { - if (arg_a.is_real_type () && arg_b.is_real_type ()) - { - tmp_a = arg_a.matrix_value (); - tmp_b = arg_b.matrix_value (); + { + if (arg_a.is_real_type () && arg_b.is_real_type ()) + { + tmp_a = arg_a.matrix_value (); + tmp_b = arg_b.matrix_value (); - if (error_state) - return retval; - else - result = EIG (tmp_a, tmp_b, nargout > 1); - } - else - { - ctmp_a = arg_a.complex_matrix_value (); - ctmp_b = arg_b.complex_matrix_value (); + if (error_state) + return retval; + else + result = EIG (tmp_a, tmp_b, nargout > 1); + } + else + { + ctmp_a = arg_a.complex_matrix_value (); + ctmp_b = arg_b.complex_matrix_value (); - if (error_state) - return retval; - else - result = EIG (ctmp_a, ctmp_b, nargout > 1); - } - } + if (error_state) + return retval; + else + result = EIG (ctmp_a, ctmp_b, nargout > 1); + } + } if (! error_state) - { - if (nargout == 0 || nargout == 1) - { - retval(0) = result.eigenvalues (); - } - else - { - // Blame it on Matlab. + { + if (nargout == 0 || nargout == 1) + { + retval(0) = result.eigenvalues (); + } + else + { + // Blame it on Matlab. - ComplexDiagMatrix d (result.eigenvalues ()); + ComplexDiagMatrix d (result.eigenvalues ()); - retval(1) = d; - retval(0) = result.eigenvectors (); - } - } + retval(1) = d; + retval(0) = result.eigenvectors (); + } + } } return retval;