# HG changeset patch # User jwe # Date 985899782 0 # Node ID f19f00339363f06f3164ba94fe345f802d2243f4 # Parent ec80db02d436c9dcb25ccca8b85cc4cf9c712bb2 [project @ 2001-03-29 21:03:01 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2001-03-29 John W. Eaton + + * DLD-FUNCTIONS/besselj.cc (besselh): Use K arg. + From: Thomas Stuart . + + * oct-stream.cc (get_size): Don't allow [Inf, N] as a size + specification for the read and scanf functions. + (get_size): SIZE is now an Array instead of a Matrix object. + (read): Likewise. Change all callers. + (scanf): Likewise. Change all callers. + 2001-03-26 John W. Eaton * DLD-FUNCTIONS/det.cc (Fdet): Only return rcond if nargout > 1. diff --git a/src/DLD-FUNCTIONS/besselj.cc b/src/DLD-FUNCTIONS/besselj.cc --- a/src/DLD-FUNCTIONS/besselj.cc +++ b/src/DLD-FUNCTIONS/besselj.cc @@ -332,17 +332,15 @@ int nargin = args.length (); - int kind = 1; - if (nargin == 2) { retval = do_bessel (BESSEL_H1, "besselh", args, nargout); } else if (nargin == 3 || nargin == 4) { - double d_kind = args(1).double_value (); + int kind = args(1).int_value (); - if (! error_state && D_NINT (d_kind) == d_kind) + if (! error_state) { octave_value_list tmp_args; diff --git a/src/file-io.cc b/src/file-io.cc --- a/src/file-io.cc +++ b/src/file-io.cc @@ -855,8 +855,8 @@ int count = 0; - Matrix size = (nargin == 3) - ? args(2).matrix_value () : Matrix (1, 1, octave_Inf); + Array size = (nargin == 3) + ? args(2).vector_value () : Array (1, octave_Inf); if (! error_state) { @@ -938,8 +938,9 @@ int count = 0; - Matrix size = (nargin == 3) - ? args(2).matrix_value () : Matrix (1, 1, octave_Inf); + Array size = (nargin == 3) + ? args(2).vector_value () + : Array (1, octave_Inf); octave_value tmp = os.scanf (fmt, size, count); @@ -999,7 +1000,7 @@ count = -1; - Matrix size = size_arg.matrix_value (); + Array size = size_arg.vector_value (); if (! error_state) { diff --git a/src/oct-stream.cc b/src/oct-stream.cc --- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -104,7 +104,7 @@ } static void -get_size (const Matrix& size, int& nr, int& nc, bool& one_elt_size_spec, +get_size (const Array& size, int& nr, int& nc, bool& one_elt_size_spec, const char *warn_for) { nr = -1; @@ -115,32 +115,22 @@ double dnr = -1.0; double dnc = -1.0; - int sz_nr = size.rows (); - int sz_nc = size.cols (); - - if (sz_nr == 1 && sz_nc == 1) + int sz_len = size.length (); + + if (sz_len == 1) { one_elt_size_spec = true; - dnr = size (0, 0); + dnr = size (0); dnc = 1.0; } - else if (sz_nr == 1 && sz_nc > 0) + else if (sz_len == 2) { - dnr = size (0, 0); - - if (sz_nc == 2) - dnc = size (0, 1); - else if (sz_nc > 2) - ::error ("%s: invalid size specification", warn_for); - } - else if (sz_nc == 1 && sz_nr > 0) - { - dnr = size (0, 0); - - if (sz_nr == 2) - dnc = size (1, 0); - else if (sz_nr > 2) + dnr = size (0); + + if (! xisinf (dnr)) + dnc = size (1); + else ::error ("%s: invalid size specification", warn_for); } else @@ -1023,7 +1013,7 @@ } octave_value -octave_base_stream::read (const Matrix& size, +octave_base_stream::read (const Array& size, oct_data_conv::data_type dt, int skip, oct_mach_info::float_format ffmt, int& char_count) @@ -1658,7 +1648,7 @@ } octave_value -octave_base_stream::scanf (const std::string& fmt, const Matrix& size, +octave_base_stream::scanf (const std::string& fmt, const Array& size, int& conversion_count) { octave_value retval = Matrix (); @@ -2614,7 +2604,7 @@ } octave_value -octave_stream::read (const Matrix& size, +octave_stream::read (const Array& size, oct_data_conv::data_type dt, int skip, oct_mach_info::float_format flt_fmt, int& count) { @@ -2640,7 +2630,8 @@ } octave_value -octave_stream::scanf (const std::string& fmt, const Matrix& size, int& count) +octave_stream::scanf (const std::string& fmt, const Array& size, + int& count) { octave_value retval; diff --git a/src/oct-stream.h b/src/oct-stream.h --- a/src/oct-stream.h +++ b/src/oct-stream.h @@ -431,7 +431,7 @@ int skip, oct_mach_info::float_format flt_fmt, int& count); - octave_value read (const Matrix& size, oct_data_conv::data_type dt, + octave_value read (const Array& size, oct_data_conv::data_type dt, int skip, oct_mach_info::float_format flt_fmt, int& count); @@ -444,7 +444,7 @@ octave_value do_scanf (scanf_format_list& fmt_list, int nr, int nc, bool one_elt_size_spec, int& count); - octave_value scanf (const std::string& fmt, const Matrix& size, int& count); + octave_value scanf (const std::string& fmt, const Array& size, int& count); bool do_oscanf (const scanf_format_elt *elt, octave_value&); @@ -455,9 +455,6 @@ int flush (void); - int do_write (const Matrix& m, oct_data_conv::data_type dt, int skip, - oct_mach_info::float_format flt_fmt); - int write (const octave_value& data, oct_data_conv::data_type dt, int skip, oct_mach_info::float_format flt_fmt); @@ -513,14 +510,14 @@ void close (void); - octave_value read (const Matrix& size, oct_data_conv::data_type dt, + octave_value read (const Array& size, oct_data_conv::data_type dt, int skip, oct_mach_info::float_format flt_fmt, int& count); int write (const octave_value& data, oct_data_conv::data_type dt, int skip, oct_mach_info::float_format flt_fmt); - octave_value scanf (const std::string& fmt, const Matrix& size, int& count); + octave_value scanf (const std::string& fmt, const Array& size, int& count); octave_value_list oscanf (const std::string& fmt);