Mercurial > octave
diff src/data.cc @ 3322:8c6b4de3bdc8
[project @ 1999-10-26 21:33:27 by jwe]
author | jwe |
---|---|
date | Tue, 26 Oct 1999 21:33:28 +0000 |
parents | 6923abb04e16 |
children | 15cddaacbc2d |
line wrap: on
line diff
--- a/src/data.cc Tue Oct 26 18:15:41 1999 +0000 +++ b/src/data.cc Tue Oct 26 21:33:28 1999 +0000 @@ -1140,40 +1140,35 @@ if (! error_state) { - if (npoints > 1) - { - octave_value arg_1 = args(0); - octave_value arg_2 = args(1); + octave_value arg_1 = args(0); + octave_value arg_2 = args(1); - if (arg_1.is_complex_type () || arg_2.is_complex_type ()) + if (arg_1.is_complex_type () || arg_2.is_complex_type ()) + { + Complex x1 = arg_1.complex_value (); + Complex x2 = arg_2.complex_value (); + + if (! error_state) { - Complex x1 = arg_1.complex_value (); - Complex x2 = arg_2.complex_value (); + ComplexRowVector rv = linspace (x1, x2, npoints); if (! error_state) - { - ComplexRowVector rv = linspace (x1, x2, npoints); - - if (! error_state) - retval (0) = octave_value (rv, 0); - } - } - else - { - double x1 = arg_1.double_value (); - double x2 = arg_2.double_value (); - - if (! error_state) - { - RowVector rv = linspace (x1, x2, npoints); - - if (! error_state) - retval (0) = octave_value (rv, 0); - } + retval (0) = octave_value (rv, 0); } } else - error ("linspace: npoints must be greater than 2"); + { + double x1 = arg_1.double_value (); + double x2 = arg_2.double_value (); + + if (! error_state) + { + RowVector rv = linspace (x1, x2, npoints); + + if (! error_state) + retval (0) = octave_value (rv, 0); + } + } } return retval;