Mercurial > hg > octave-lyh
changeset 4594:3a284f89aa41
[project @ 2003-11-12 02:27:28 by jwe]
author | jwe |
---|---|
date | Wed, 12 Nov 2003 02:29:55 +0000 |
parents | 77566be8b9e9 |
children | 331f6de7102b |
files | liboctave/Array-C.cc liboctave/Array-b.cc liboctave/Array-ch.cc liboctave/Array-d.cc liboctave/Array-i.cc liboctave/Array-idx-vec.cc liboctave/Array-s.cc liboctave/Array-str.cc liboctave/Array.h liboctave/ChangeLog liboctave/ODESSA.cc src/ChangeLog src/TEMPLATE-INST/Array-oc.cc src/TEMPLATE-INST/Array-os.cc src/TEMPLATE-INST/Array-sym.cc src/TEMPLATE-INST/Array-tc.cc src/file-io.cc src/ov-typeinfo.cc |
diffstat | 18 files changed, 56 insertions(+), 70 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array-C.cc +++ b/liboctave/Array-C.cc @@ -31,19 +31,12 @@ #include "Array.h" #include "Array.cc" -template class Array<Complex>; +INSTANTIATE_ARRAY_AND_ASSIGN (Complex); -template int assign (Array<Complex>&, const Array<Complex>&); -template int assign (Array<Complex>&, const Array<double>&); -template int assign (Array<Complex>&, const Array<int>&); -template int assign (Array<Complex>&, const Array<short>&); -template int assign (Array<Complex>&, const Array<char>&); - -template int assign (Array<Complex>&, const Array<Complex>&, const Complex&); -template int assign (Array<Complex>&, const Array<double>&, const Complex&); -template int assign (Array<Complex>&, const Array<int>&, const Complex&); -template int assign (Array<Complex>&, const Array<short>&, const Complex&); -template int assign (Array<Complex>&, const Array<char>&, const Complex&); +INSTANTIATE_ARRAY_ASSIGN (Complex, double); +INSTANTIATE_ARRAY_ASSIGN (Complex, int); +INSTANTIATE_ARRAY_ASSIGN (Complex, short); +INSTANTIATE_ARRAY_ASSIGN (Complex, char); #include "Array2.h"
--- a/liboctave/Array-b.cc +++ b/liboctave/Array-b.cc @@ -29,11 +29,7 @@ #include "Array.h" #include "Array.cc" -template class Array<bool>; - -template int assign (Array<bool>&, const Array<bool>&); - -template int assign (Array<bool>&, const Array<bool>&, const bool&); +INSTANTIATE_ARRAY_AND_ASSIGN (bool); #include "Array2.h"
--- a/liboctave/Array-ch.cc +++ b/liboctave/Array-ch.cc @@ -29,11 +29,7 @@ #include "Array.h" #include "Array.cc" -template class Array<char>; - -template int assign (Array<char>&, const Array<char>&); - -template int assign (Array<char>&, const Array<char>&, const char&); +INSTANTIATE_ARRAY_AND_ASSIGN (char); #include "Array2.h"
--- a/liboctave/Array-d.cc +++ b/liboctave/Array-d.cc @@ -29,17 +29,11 @@ #include "Array.h" #include "Array.cc" -template class Array<double>; +INSTANTIATE_ARRAY_AND_ASSIGN (double); -template int assign (Array<double>&, const Array<double>&); -template int assign (Array<double>&, const Array<int>&); -template int assign (Array<double>&, const Array<short>&); -template int assign (Array<double>&, const Array<char>&); - -template int assign (Array<double>&, const Array<double>&, const double&); -template int assign (Array<double>&, const Array<int>&, const double&); -template int assign (Array<double>&, const Array<short>&, const double&); -template int assign (Array<double>&, const Array<char>&, const double&); +INSTANTIATE_ARRAY_ASSIGN (double, int); +INSTANTIATE_ARRAY_ASSIGN (double, short); +INSTANTIATE_ARRAY_ASSIGN (double, char); #include "Array2.h"
--- a/liboctave/Array-i.cc +++ b/liboctave/Array-i.cc @@ -29,15 +29,10 @@ #include "Array.h" #include "Array.cc" -template class Array<int>; +INSTANTIATE_ARRAY_AND_ASSIGN (int); -template int assign (Array<int>&, const Array<int>&); -template int assign (Array<int>&, const Array<short>&); -template int assign (Array<int>&, const Array<char>&); - -template int assign (Array<int>&, const Array<int>&, const int&); -template int assign (Array<int>&, const Array<short>&, const int&); -template int assign (Array<int>&, const Array<char>&, const int&); +INSTANTIATE_ARRAY_ASSIGN (int, short); +INSTANTIATE_ARRAY_ASSIGN (int, char); #include "Array2.h"
--- a/liboctave/Array-idx-vec.cc +++ b/liboctave/Array-idx-vec.cc @@ -31,7 +31,7 @@ #include "Array.h" #include "Array.cc" -template class Array<idx_vector>; +INSTANTIATE_ARRAY (idx_vector); /* ;;; Local Variables: ***
--- a/liboctave/Array-s.cc +++ b/liboctave/Array-s.cc @@ -29,13 +29,9 @@ #include "Array.h" #include "Array.cc" -template class Array<short>; +INSTANTIATE_ARRAY_AND_ASSIGN (int); -template int assign (Array<short>&, const Array<short>&); -template int assign (Array<short>&, const Array<char>&); - -template int assign (Array<short>&, const Array<short>&, const short&); -template int assign (Array<short>&, const Array<char>&, const short&); +INSTANTIATE_ARRAY_ASSIGN (short, char); #include "Array2.h"
--- a/liboctave/Array-str.cc +++ b/liboctave/Array-str.cc @@ -31,7 +31,7 @@ #include <string> -template class Array<std::string>; +INSTANTIATE_ARRAY (std::string); /* ;;; Local Variables: ***
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -543,6 +543,21 @@ return assign (lhs, rhs, resize_fill_value (LT ())); } +#define INSTANTIATE_ARRAY_ASSIGN(LT, RT) \ + template int assign (Array<LT>&, const Array<RT>&, const LT&); \ + template int assign1 (Array<LT>&, const Array<RT>&, const LT&); \ + template int assign2 (Array<LT>&, const Array<RT>&, const LT&); \ + template int assignN (Array<LT>&, const Array<RT>&, const LT&); \ + template int assign (Array<LT>&, const Array<RT>&) + +#define INSTANTIATE_ARRAY(T) \ + template class Array<T>; \ + template T resize_fill_value (const T&) + +#define INSTANTIATE_ARRAY_AND_ASSIGN(T) \ + INSTANTIATE_ARRAY (T); \ + INSTANTIATE_ARRAY_ASSIGN (T, T) + #endif /*
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,10 @@ 2003-11-11 John W. Eaton <jwe@bevo.che.wisc.edu> + * Array.h (INSTANTIATE_ARRAY_ASSIGN, INSTANTIATE_ARRAY_AND_ASSIGN, + INSTANTIATE_ARRAY): New macros. + * Array-C.cc, Array-b.cc, Array-ch.cc, Array-d.cc, Array-i.cc, + Array-idx-vec.cc, Array-s.cc, Array-str.cc, ODESSA.cc: Use them. + * Array.h (Array<T>::ipermute): New function. 2003-11-11 Petter Risholm <risholm@stud.ntnu.no>
--- a/liboctave/ODESSA.cc +++ b/liboctave/ODESSA.cc @@ -62,7 +62,7 @@ odessa_jac_ptr, int&); } -template class Array<Matrix>; +INSTANTIATE_ARRAY (Matrix); static ODESFunc::ODES_fsub user_fsub; static ODESFunc::ODES_bsub user_bsub;
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2003-11-11 John W. Eaton <jwe@bevo.che.wisc.edu> + * TEMPLATE-INST/Array-tc.cc, TEMPLATE-INST/Array-c.cc, + TEMPLATE-INST/Array-os.cc, TEMPLATE-INST/Array-sym.cc, + ov-typeinfo.cc: Use new INSTANTIATE_ARRAY macro. + * data.cc (do_permute): New function. (Fpermute, Fipermute): Use it.
--- a/src/TEMPLATE-INST/Array-oc.cc +++ b/src/TEMPLATE-INST/Array-oc.cc @@ -31,7 +31,7 @@ #include "sighandlers.h" -template class Array<octave_child>; +INSTANTIATE_ARRAY (octave_child); /* ;;; Local Variables: ***
--- a/src/TEMPLATE-INST/Array-os.cc +++ b/src/TEMPLATE-INST/Array-os.cc @@ -31,11 +31,11 @@ #include "oct-stream.h" -template class Array<scanf_format_elt*>; +INSTANTIATE_ARRAY (scanf_format_elt *); -template class Array<printf_format_elt*>; +INSTANTIATE_ARRAY (printf_format_elt *); -template class Array<octave_stream>; +INSTANTIATE_ARRAY (octave_stream); /* ;;; Local Variables: ***
--- a/src/TEMPLATE-INST/Array-sym.cc +++ b/src/TEMPLATE-INST/Array-sym.cc @@ -32,7 +32,7 @@ #include "oct-obj.h" #include "symtab.h" -template class Array<symbol_record *>; +INSTANTIATE_ARRAY (symbol_record *); /* ;;; Local Variables: ***
--- a/src/TEMPLATE-INST/Array-tc.cc +++ b/src/TEMPLATE-INST/Array-tc.cc @@ -47,14 +47,7 @@ return retval; } -template class Array<octave_value>; - - -template int assign (Array<octave_value>&, const Array<octave_value>&); - -template int assign (Array<octave_value>&, - const Array<octave_value>&, const octave_value&); - +INSTANTIATE_ARRAY (octave_value); template class Array2<octave_value>;
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -170,9 +170,8 @@ DEFUN (fclose, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fclose (@var{fid})\n\ -Closes the specified file. If an error is encountered while trying to\n\ -close the file, an error message is printed and @code{fclose} returns\n\ -0. Otherwise, it returns 1.\n\ +Closes the specified file. If successful, @code{fclose} returns 0,\n\ +otherwise, it returns -1.\n\ @end deftypefn") { octave_value retval = -1;
--- a/src/ov-typeinfo.cc +++ b/src/ov-typeinfo.cc @@ -46,21 +46,21 @@ #include <Array.cc> -template class Array<unary_op_fcn>; +INSTANTIATE_ARRAY (unary_op_fcn); template class Array2<unary_op_fcn>; -template class Array<non_const_unary_op_fcn>; +INSTANTIATE_ARRAY (non_const_unary_op_fcn); template class Array2<non_const_unary_op_fcn>; -template class Array<binary_op_fcn>; +INSTANTIATE_ARRAY (binary_op_fcn); template class Array2<binary_op_fcn>; template class Array3<binary_op_fcn>; -template class Array<assign_op_fcn>; +INSTANTIATE_ARRAY (assign_op_fcn); template class Array2<assign_op_fcn>; template class Array3<assign_op_fcn>; -template class Array<type_conv_fcn>; +INSTANTIATE_ARRAY (type_conv_fcn); template class Array2<type_conv_fcn>; bool