# HG changeset patch # User John W. Eaton # Date 1453661404 18000 # Node ID 538b57866b908a5f2115a54af0446fd14d91c59a # Parent e2fca7d79169446c0a2b578917eab824df514016 consistently use "typename" intead of "class" in template declarations * Object.h, QtHandlesUtils.cc, QtHandlesUtils.h, ToolBarButton.cc, ToolBarButton.h, Cell.h, __lin_interpn__.cc, bitfcns.cc, bsxfun.cc, cellfun.cc, data.cc, filter.cc, gcd.cc, graphics.cc, help.cc, kron.cc, lookup.cc, ls-mat5.cc, ls-oct-text.h, lu.cc, max.cc, mgorth.cc, oct-map.cc, oct-map.h, oct-stream.cc, oct-stream.h, octave-link.h, pr-output.cc, profiler.h, schur.cc, sparse-xdiv.cc, sparse-xpow.cc, sqrtm.cc, symtab.h, tril.cc, typecast.cc, variables.cc, xdiv.cc, zfstream.h, __init_fltk__.cc, __magick_read__.cc, chol.cc, qr.cc, ov-base-diag.cc, ov-base-diag.h, ov-base-int.cc, ov-base-int.h, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc, ov-base-scalar.h, ov-base-sparse.cc, ov-base-sparse.h, ov-base.h, ov-classdef.cc, ov-int-traits.h, ov-java.h, ov-usr-fcn.h, ov.cc, ov.h, op-dms-template.cc, oct-parse.in.yy, parse.h, pt-mat.cc, Array-b.cc, Array.cc, Array.h, CDiagMatrix.h, CMatrix.h, CNDArray.h, DiagArray2.cc, DiagArray2.h, MArray.cc, MArray.h, MDiagArray2.cc, MDiagArray2.h, MSparse.cc, MSparse.h, MatrixType.cc, Sparse.cc, Sparse.h, dDiagMatrix.h, dMatrix.h, dNDArray.h, fCDiagMatrix.h, fCMatrix.h, fCNDArray.h, fDiagMatrix.h, fMatrix.h, fNDArray.h, idx-vector.cc, idx-vector.h, intNDArray.cc, intNDArray.h, DET.h, base-aepbal.h, base-lu.cc, base-lu.h, base-qr.cc, base-qr.h, bsxfun-defs.cc, eigs-base.cc, lo-mappers.h, lo-specfun.cc, lo-specfun.h, oct-convn.cc, oct-fftw.cc, oct-norm.cc, sparse-base-chol.cc, sparse-base-chol.h, sparse-base-lu.cc, sparse-base-lu.h, sparse-dmsolve.cc, mx-inlines.cc, action-container.h, base-list.h, lo-traits.h, lo-utils.h, oct-base64.h, oct-binmap.h, oct-cmplx.h, oct-inttypes.cc, oct-inttypes.h, oct-locbuf.h, oct-refcount.h, oct-sort.cc, oct-sort.h: Use "typename" instead of "class" in template declarations. diff -r e2fca7d79169 -r 538b57866b90 libgui/graphics/Object.h --- a/libgui/graphics/Object.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libgui/graphics/Object.h Sun Jan 24 13:50:04 2016 -0500 @@ -52,14 +52,14 @@ const base_properties& properties (void) const { return object ().get_properties (); } - template + template typename T::properties& properties (void) { return dynamic_cast (object ().get_properties ()); } - template + template const typename T::properties& properties (void) const { return dynamic_cast @@ -70,7 +70,7 @@ virtual QObject* qObject (void) { return m_qobject; } - template + template T* qWidget (void) { return qobject_cast(qObject ()); } virtual Container* innerContainer (void) = 0; diff -r e2fca7d79169 -r 538b57866b90 libgui/graphics/QtHandlesUtils.cc --- a/libgui/graphics/QtHandlesUtils.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libgui/graphics/QtHandlesUtils.cc Sun Jan 24 13:50:04 2016 -0500 @@ -98,7 +98,7 @@ return v; } -template +template QFont computeFont (const typename T::properties& props, int height) { diff -r e2fca7d79169 -r 538b57866b90 libgui/graphics/QtHandlesUtils.h --- a/libgui/graphics/QtHandlesUtils.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libgui/graphics/QtHandlesUtils.h Sun Jan 24 13:50:04 2016 -0500 @@ -49,7 +49,7 @@ Cell toCellString (const QStringList& l); - template + template QFont computeFont (const typename T::properties& props, int height = -1); QColor fromRgb (const Matrix& rgb); @@ -64,12 +64,12 @@ Matrix figureCurrentPoint (const graphics_object& fig, QMouseEvent* event); Matrix figureCurrentPoint (const graphics_object& fig); - template + template inline typename T::properties& properties (graphics_object obj) { return dynamic_cast (obj.get_properties ()); } - template + template inline typename T::properties& properties (const graphics_handle& h) { return Utils::properties (gh_manager::get_object (h)); } diff -r e2fca7d79169 -r 538b57866b90 libgui/graphics/ToolBarButton.cc --- a/libgui/graphics/ToolBarButton.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libgui/graphics/ToolBarButton.cc Sun Jan 24 13:50:04 2016 -0500 @@ -33,7 +33,7 @@ namespace QtHandles { -template +template ToolBarButton::ToolBarButton (const graphics_object& go, QAction* action) : Object (go, action), m_separator (0) { @@ -58,12 +58,12 @@ w->insertAction (action, m_separator); } -template +template ToolBarButton::~ToolBarButton (void) { } -template +template void ToolBarButton::update (int pId) { diff -r e2fca7d79169 -r 538b57866b90 libgui/graphics/ToolBarButton.h --- a/libgui/graphics/ToolBarButton.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libgui/graphics/ToolBarButton.h Sun Jan 24 13:50:04 2016 -0500 @@ -32,7 +32,7 @@ class Container; -template +template class ToolBarButton : public Object { public: diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/Cell.h --- a/libinterp/corefcn/Cell.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/Cell.h Sun Jan 24 13:50:04 2016 -0500 @@ -142,7 +142,7 @@ Cell map (ctype_mapper) const; }; -template<> +template <> inline Cell octave_value_extract (const octave_value& v) { return v.cell_value (); } diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/__lin_interpn__.cc --- a/libinterp/corefcn/__lin_interpn__.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/__lin_interpn__.cc Sun Jan 24 13:50:04 2016 -0500 @@ -34,7 +34,7 @@ // equivalent to isvector.m -template +template bool isvector (const T& array) { @@ -43,7 +43,7 @@ } // lookup a value in a sorted table (lookup.m) -template +template octave_idx_type lookup (const T *x, octave_idx_type n, T y) { @@ -122,7 +122,7 @@ // n-dimensional linear interpolation -template +template void lin_interpn (int n, const octave_idx_type *size, const octave_idx_type *scale, octave_idx_type Ni, T extrapval, const T **x, @@ -181,7 +181,7 @@ } } -template +template octave_value lin_interpn (int n, M *X, const M V, M *Y) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/bitfcns.cc --- a/libinterp/corefcn/bitfcns.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/bitfcns.cc Sun Jan 24 13:50:04 2016 -0500 @@ -113,7 +113,7 @@ // reflective information hardwired. We can't hardwire this information // in Fbitxxx DEFUNs below, because at that moment, we still don't have // information about which integer types we need to instantiate. -template +template octave_value bitopx (const std::string& fname, const Array& x, const Array& y) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/bsxfun.cc --- a/libinterp/corefcn/bsxfun.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/bsxfun.cc Sun Jan 24 13:50:04 2016 -0500 @@ -95,7 +95,7 @@ // Static table of handlers. bsxfun_handler bsxfun_handler_table[bsxfun_num_builtin_ops][btyp_num_types]; -template +template static octave_value bsxfun_forward_op (const octave_value& x, const octave_value& y) { @@ -104,7 +104,7 @@ return octave_value (bsxfun_op (xa, ya)); } -template +template static octave_value bsxfun_forward_rel (const octave_value& x, const octave_value& y) { @@ -115,7 +115,7 @@ // pow() needs a special handler for reals // because of the potentially complex result. -template +template static octave_value do_bsxfun_real_pow (const octave_value& x, const octave_value& y) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/cellfun.cc Sun Jan 24 13:50:04 2016 -0500 @@ -118,7 +118,7 @@ // Templated function because the user can be stubborn enough to request // a cell array as an output even in these cases where the output fits // in an ordinary array -template +template static octave_value_list try_cellfun_internal_ops (const octave_value_list& args, int nargin) { @@ -1639,7 +1639,7 @@ arraydv(i) = 1; } -template +template static inline typename NDA::element_type do_num2cell_elem (const NDA& array, octave_idx_type i) { return array(i); } @@ -1649,7 +1649,7 @@ { return Cell (array(i)); } -template +template static Cell do_num2cell (const NDA& array, const Array& dimv) { @@ -1861,7 +1861,7 @@ return false; } -template +template static void prepare_idx (container *idx, int idim, int nd, const Array* d) @@ -1884,7 +1884,7 @@ // 2D specialization, works for Array, Sparse and octave_map. // Uses 1D or 2D indexing. -template +template static Cell do_mat2cell_2d (const Array2D& a, const Array *d, int nd) { @@ -1941,7 +1941,7 @@ // Nd case. Works for Arrays and octave_map. // Uses Nd indexing. -template +template Cell do_mat2cell_nd (const ArrayND& a, const Array *d, int nd) { @@ -1993,7 +1993,7 @@ } // Dispatcher. -template +template Cell do_mat2cell (const ArrayND& a, const Array *d, int nd) { @@ -2190,7 +2190,7 @@ */ // FIXME: it would be nice to allow ranges being handled without a conversion. -template +template static Cell do_cellslices_nda (const NDA& array, const Array& lb, diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/data.cc Sun Jan 24 13:50:04 2016 -0500 @@ -461,7 +461,7 @@ */ -template +template void map_2_xlog2 (const Array& x, Array& f, Array& e) { @@ -1682,7 +1682,7 @@ return true; } -template +template static void single_type_concat (Array& result, const octave_value_list& args, @@ -1725,7 +1725,7 @@ } } -template +template static void single_type_concat (Sparse& result, const octave_value_list& args, @@ -1745,7 +1745,7 @@ } // Dispatcher. -template +template static TYPE do_single_type_concat (const octave_value_list& args, int dim) { @@ -1756,7 +1756,7 @@ return result; } -template +template static void single_type_concat_map (octave_map& result, const octave_value_list& args, @@ -4811,7 +4811,7 @@ return fill_matrix (args, true, "true"); } -template +template octave_value identity_matrix (int nr, int nc) { @@ -5025,7 +5025,7 @@ %!error eye (1, 2, 3) */ -template +template static octave_value do_linspace (const octave_value& base, const octave_value& limit, octave_idx_type n) @@ -6929,7 +6929,7 @@ return retval; } -template +template static NDT do_accumarray_sum (const idx_vector& idx, const NDT& vals, octave_idx_type n = -1) @@ -7014,7 +7014,7 @@ return retval; } -template +template static NDT do_accumarray_minmax (const idx_vector& idx, const NDT& vals, octave_idx_type n, bool ismin, @@ -7144,7 +7144,7 @@ return do_accumarray_minmax_fun (args, false); } -template +template static NDT do_accumdim_sum (const idx_vector& idx, const NDT& vals, int dim = -1, octave_idx_type n = -1) @@ -7234,7 +7234,7 @@ return retval; } -template +template static NDT do_merge (const Array& mask, const NDT& tval, const NDT& fval) @@ -7405,7 +7405,7 @@ #undef MAKE_INT_BRANCH -template +template static SparseT do_sparse_diff (const SparseT& array, octave_idx_type order, int dim) @@ -7606,7 +7606,7 @@ %!error diff ([1, 2; 3, 4], -1) */ -template +template static Array do_repelems (const Array& src, const Array& rep) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/filter.cc --- a/libinterp/corefcn/filter.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/filter.cc Sun Jan 24 13:50:04 2016 -0500 @@ -53,7 +53,7 @@ int dim); #endif -template +template MArray filter (MArray& b, MArray& a, MArray& x, MArray& si, int dim = 0) @@ -235,7 +235,7 @@ MArray&, int dim); #endif -template +template MArray filter (MArray& b, MArray& a, MArray& x, int dim = -1) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/gcd.cc --- a/libinterp/corefcn/gcd.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/gcd.cc Sun Jan 24 13:50:04 2016 -0500 @@ -96,7 +96,7 @@ return aa; } -template +template static octave_int simple_gcd (const octave_int& a, const octave_int& b) { @@ -196,7 +196,7 @@ return aa; } -template +template static octave_int extended_gcd (const octave_int& a, const octave_int& b, octave_int& x, octave_int& y) @@ -229,7 +229,7 @@ return aa; } -template +template static octave_value do_simple_gcd (const octave_value& a, const octave_value& b) { @@ -309,7 +309,7 @@ return retval; } -template +template static octave_value do_extended_gcd (const octave_value& a, const octave_value& b, octave_value& x, octave_value& y) diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/graphics.cc Sun Jan 24 13:50:04 2016 -0500 @@ -870,7 +870,7 @@ } } -template +template void convert_cdata_1 (bool is_scaled, bool is_real, double clim_0, double clim_1, const double *cmapv, const T *cv, octave_idx_type lda, @@ -966,7 +966,7 @@ return octave_value (a); } -template +template static void get_array_limits (const Array& m, double& emin, double& emax, double& eminp, double& emaxp) diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/help.cc Sun Jan 24 13:50:04 2016 -0500 @@ -98,7 +98,7 @@ typedef map_type::value_type pair_type; typedef map_type::const_iterator map_iter; -template +template size_t size (T const (&)[z]) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/kron.cc --- a/libinterp/corefcn/kron.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/kron.cc Sun Jan 24 13:50:04 2016 -0500 @@ -48,7 +48,7 @@ #include "error.h" #include "ovl.h" -template +template static MArray kron (const MArray& a, const MArray& b) { @@ -75,7 +75,7 @@ return c; } -template +template static MArray kron (const MDiagArray2& a, const MArray& b) { @@ -100,7 +100,7 @@ return c; } -template +template static MSparse kron (const MSparse& A, const MSparse& B) { @@ -150,7 +150,7 @@ return PermMatrix (res_perm, true); } -template +template octave_value do_kron (const octave_value& a, const octave_value& b) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/lookup.cc --- a/libinterp/corefcn/lookup.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/lookup.cc Sun Jan 24 13:50:04 2016 -0500 @@ -83,7 +83,7 @@ } #endif -template +template inline sortmode get_sort_mode (const Array& array, typename octave_sort::compare_fcn_type desc_comp @@ -106,7 +106,7 @@ y.TYPE ## _array_value (), \ left_inf, right_inf, \ match_idx, match_bool); -template +template static octave_value do_numeric_lookup (const ArrayT& array, const ArrayT& values, bool left_inf, bool right_inf, diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/ls-mat5.cc --- a/libinterp/corefcn/ls-mat5.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/ls-mat5.cc Sun Jan 24 13:50:04 2016 -0500 @@ -252,7 +252,7 @@ } } -template +template void read_mat5_integer_data (std::istream& is, T *m, octave_idx_type count, bool swap, mat5_data_type type) @@ -1771,7 +1771,7 @@ } } -template +template void write_mat5_integer_data (std::ostream& os, const T *m, int size, octave_idx_type nel) diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/ls-oct-text.h --- a/libinterp/corefcn/ls-oct-text.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/ls-oct-text.h Sun Jan 24 13:50:04 2016 -0500 @@ -68,7 +68,7 @@ // // [%#][ \t]*keyword[ \t]*int-value.*\n -template +template bool extract_keyword (std::istream& is, const char *keyword, T& value, const bool next_only = false) @@ -115,7 +115,7 @@ return status; } -template +template bool extract_keyword (std::istream& is, const std::string& kw, T& value, const bool next_only = false) @@ -131,7 +131,7 @@ // // [%#][ \t]*keyword[ \t]*int-value.*\n -template +template bool extract_keyword (std::istream& is, const string_vector& keywords, std::string& kw, T& value, const bool next_only = false) diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/lu.cc --- a/libinterp/corefcn/lu.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/lu.cc Sun Jan 24 13:50:04 2016 -0500 @@ -39,7 +39,7 @@ #include "ov-re-sparse.h" #include "ov-cx-sparse.h" -template +template static octave_value get_lu_l (const base_lu& fact) { @@ -50,7 +50,7 @@ return L; } -template +template static octave_value get_lu_u (const base_lu& fact) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/max.cc --- a/libinterp/corefcn/max.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/max.cc Sun Jan 24 13:50:04 2016 -0500 @@ -41,7 +41,7 @@ #include "ov-re-sparse.h" #include "ov-cx-sparse.h" -template +template static octave_value_list do_minmax_red_op (const octave_value& arg, int nargout, int dim, bool ismin) @@ -138,7 +138,7 @@ return retval; } -template +template static octave_value do_minmax_bin_op (const octave_value& argx, const octave_value& argy, bool ismin) @@ -866,7 +866,7 @@ */ -template +template static octave_value_list do_cumminmax_red_op (const octave_value& arg, int nargout, int dim, bool ismin) diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/mgorth.cc --- a/libinterp/corefcn/mgorth.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/mgorth.cc Sun Jan 24 13:50:04 2016 -0500 @@ -30,7 +30,7 @@ #include "error.h" #include "errwarn.h" -template +template static void do_mgorth (ColumnVector& x, const Matrix& V, RowVector& h) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/oct-map.cc --- a/libinterp/corefcn/oct-map.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/oct-map.cc Sun Jan 24 13:50:04 2016 -0500 @@ -623,7 +623,7 @@ dest = src.orderfields (ref, perm); } -template +template static void permute_to_correct_order (octave_idx_type n, octave_idx_type nf, octave_idx_type idx, const map *map_list, diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/oct-map.h --- a/libinterp/corefcn/oct-map.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/oct-map.h Sun Jan 24 13:50:04 2016 -0500 @@ -254,7 +254,7 @@ }; -template<> +template <> inline octave_scalar_map octave_value_extract (const octave_value& v) { return v.scalar_map_value (); } @@ -469,7 +469,7 @@ const octave_map *map_list, octave_map& retval); }; -template<> +template <> inline octave_map octave_value_extract (const octave_value& v) { return v.map_value (); } diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/oct-stream.cc Sun Jan 24 13:50:04 2016 -0500 @@ -1109,7 +1109,7 @@ #define OCTAVE_SCAN(is, fmt, arg) octave_scan (is, fmt, arg) -template +template std::istream& octave_scan_1 (std::istream& is, const scanf_format_elt& fmt, T* valptr) { @@ -1181,7 +1181,7 @@ return is; } -template +template std::istream& octave_scan (std::istream& is, const scanf_format_elt& fmt, T* valptr) { @@ -1207,7 +1207,7 @@ // Note that this specialization is only used for reading characters, not // character strings. See BEGIN_S_CONVERSION for details. -template<> +template <> std::istream& octave_scan<> (std::istream& is, const scanf_format_elt& /* fmt */, char* valptr) @@ -1215,7 +1215,7 @@ return is >> valptr; } -template<> +template <> std::istream& octave_scan<> (std::istream& is, const scanf_format_elt& fmt, double* valptr) { @@ -1249,7 +1249,7 @@ return is; } -template +template void do_scanf_conv (std::istream& is, const scanf_format_elt& fmt, T valptr, Matrix& mval, double *data, octave_idx_type& idx, @@ -2352,7 +2352,7 @@ // Ugh again and again. -template +template int do_printf_conv (std::ostream& os, const char *fmt, int nsa, int sa_1, int sa_2, T arg, const std::string& who) @@ -3093,7 +3093,7 @@ rep->close (); } -template +template static octave_value convert_and_copy (std::list& input_buf_list, octave_idx_type input_buf_elts, @@ -3499,7 +3499,7 @@ return retval; } -template +template static void convert_chars (const void *data, void *conv_data, octave_idx_type n_elts) { @@ -3511,7 +3511,7 @@ vt_data[i] = tt_data[i]; } -template +template static void convert_ints (const T *data, void *conv_data, octave_idx_type n_elts, bool swap) @@ -3532,21 +3532,21 @@ } } -template +template class ultimate_element_type { public: typedef T type; }; -template +template class ultimate_element_type > { public: typedef T type; }; -template +template static bool convert_data (const T *data, void *conv_data, octave_idx_type n_elts, oct_data_conv::data_type output_type, @@ -3710,7 +3710,7 @@ return status; } -template +template octave_idx_type octave_stream::write (const Array& data, octave_idx_type block_size, oct_data_conv::data_type output_type, diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/oct-stream.h --- a/libinterp/corefcn/oct-stream.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/oct-stream.h Sun Jan 24 13:50:04 2016 -0500 @@ -564,7 +564,7 @@ bool skip_bytes (size_t n_elts); - template + template octave_idx_type write (const Array& data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/octave-link.h --- a/libinterp/corefcn/octave-link.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/octave-link.h Sun Jan 24 13:50:04 2016 -0500 @@ -99,21 +99,21 @@ return retval; } - template + template static void post_event (T *obj, void (T::*method) (void)) { if (enabled ()) instance->do_post_event (obj, method); } - template + template static void post_event (T *obj, void (T::*method) (A), A arg) { if (enabled ()) instance->do_post_event (obj, method, arg); } - template + template static void post_event (T *obj, void (T::*method) (const A&), const A& arg) { if (enabled ()) @@ -375,19 +375,19 @@ void do_process_events (void); void do_discard_events (void); - template + template void do_post_event (T *obj, void (T::*method) (void)) { gui_event_queue.add_method (obj, method); } - template + template void do_post_event (T *obj, void (T::*method) (A), A arg) { gui_event_queue.add_method (obj, method, arg); } - template + template void do_post_event (T *obj, void (T::*method) (const A&), const A& arg) { gui_event_queue.add_method (obj, method, arg); diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/pr-output.cc Sun Jan 24 13:50:04 2016 -0500 @@ -1703,7 +1703,7 @@ } } -template +template /* static */ inline void pr_plus_format (std::ostream& os, const T& val) { @@ -2970,7 +2970,7 @@ } } -template +template class octave_print_conv { @@ -2992,7 +2992,7 @@ #undef PRINT_CONV -template +template /* static */ inline void pr_int (std::ostream& os, const T& d, int fw = 0) { @@ -3061,7 +3061,7 @@ // // from GCC. Isn't there a better way? -template +template /* static */ inline T abs (T x) { @@ -3115,7 +3115,7 @@ template void pr_int (std::ostream&, const octave_uint64&, int); -template +template void octave_print_internal_template (std::ostream& os, const octave_int& val, bool) @@ -3149,7 +3149,7 @@ PRINT_INT_SCALAR_INTERNAL (int64_t) PRINT_INT_SCALAR_INTERNAL (uint64_t) -template +template /* static */ inline void octave_print_internal_template (std::ostream& os, const intNDArray& nda, bool pr_as_read_syntax, int extra_indent) diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/profiler.h --- a/libinterp/corefcn/profiler.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/profiler.h Sun Jan 24 13:50:04 2016 -0500 @@ -40,7 +40,7 @@ // This is a utility class that can be used to call the enter/exit // functions in a manner protected from stack unwinding. - template class enter + template class enter { private: diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/schur.cc --- a/libinterp/corefcn/schur.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/schur.cc Sun Jan 24 13:50:04 2016 -0500 @@ -37,7 +37,7 @@ #include "ovl.h" #include "utils.h" -template +template static octave_value mark_upper_triangular (const Matrix& a) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/sparse-xdiv.cc --- a/libinterp/corefcn/sparse-xdiv.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/sparse-xdiv.cc Sun Jan 24 13:50:04 2016 -0500 @@ -47,7 +47,7 @@ warn_singular_matrix (rcond); } -template +template bool mx_leftdiv_conform (const T1& a, const T2& b) { @@ -81,7 +81,7 @@ INSTANTIATE_MX_LEFTDIV_CONFORM (ComplexDiagMatrix, SparseMatrix); INSTANTIATE_MX_LEFTDIV_CONFORM (ComplexDiagMatrix, SparseComplexMatrix); -template +template bool mx_div_conform (const T1& a, const T2& b) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/sparse-xpow.cc --- a/libinterp/corefcn/sparse-xpow.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/sparse-xpow.cc Sun Jan 24 13:50:04 2016 -0500 @@ -228,7 +228,7 @@ // seem worth the effort to optimize -- how often does this case come up // in practice? -template +template inline octave_value scalar_xpow (const S& a, const SM& b) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/sqrtm.cc --- a/libinterp/corefcn/sqrtm.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/sqrtm.cc Sun Jan 24 13:50:04 2016 -0500 @@ -39,7 +39,7 @@ #include "utils.h" #include "xnorm.h" -template +template static void sqrtm_utri_inplace (Matrix& T) { @@ -88,7 +88,7 @@ "sqrtm: matrix is singular, may not have a square root"); } -template +template static octave_value do_sqrtm (const octave_value& arg) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/symtab.h --- a/libinterp/corefcn/symtab.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/symtab.h Sun Jan 24 13:50:04 2016 -0500 @@ -850,7 +850,7 @@ built_in_function = f; } - template + template void clear_map (std::map& map, bool force = false) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/tril.cc --- a/libinterp/corefcn/tril.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/tril.cc Sun Jan 24 13:50:04 2016 -0500 @@ -38,7 +38,7 @@ #include "ovl.h" // The bulk of the work. -template +template static Array do_tril (const Array& a, octave_idx_type k, bool pack) { @@ -80,7 +80,7 @@ } } -template +template static Array do_triu (const Array& a, octave_idx_type k, bool pack) { @@ -126,7 +126,7 @@ // These two are by David Bateman. // FIXME: optimizations possible. "pack" support missing. -template +template static Sparse do_tril (const Sparse& a, octave_idx_type k, bool pack) { @@ -146,7 +146,7 @@ return m; } -template +template static Sparse do_triu (const Sparse& a, octave_idx_type k, bool pack) { @@ -166,14 +166,14 @@ } // Convenience dispatchers. -template +template static Array do_trilu (const Array& a, octave_idx_type k, bool lower, bool pack) { return lower ? do_tril (a, k, pack) : do_triu (a, k, pack); } -template +template static Sparse do_trilu (const Sparse& a, octave_idx_type k, bool lower, bool pack) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/typecast.cc --- a/libinterp/corefcn/typecast.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/typecast.cc Sun Jan 24 13:50:04 2016 -0500 @@ -46,7 +46,7 @@ return dim_vector (n, 1); } -template +template static void get_data_and_bytesize (const ArrayType& array, const void *& data, @@ -64,7 +64,7 @@ old_dims = array.dims (); } -template +template static ArrayType reinterpret_copy (const void *data, octave_idx_type byte_size, const dim_vector& old_dims) @@ -256,7 +256,7 @@ return retval; } -template +template ArrayType do_bitpack (const boolNDArray& bitp) { @@ -376,7 +376,7 @@ return retval; } -template +template boolNDArray do_bitunpack (const ArrayType& array) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/variables.cc Sun Jan 24 13:50:04 2016 -0500 @@ -734,7 +734,7 @@ return retval; } -template +template bool try_local_protect (T& var) { octave_user_code *curr_usr_code = octave_call_stack::caller_user_code (); diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/xdiv.cc --- a/libinterp/corefcn/xdiv.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/xdiv.cc Sun Jan 24 13:50:04 2016 -0500 @@ -62,7 +62,7 @@ warn_singular_matrix (rcond); } -template +template bool mx_leftdiv_conform (const T1& a, const T2& b, blas_trans_type blas_trans) { @@ -89,7 +89,7 @@ INSTANTIATE_MX_LEFTDIV_CONFORM (ComplexMatrix, Matrix); INSTANTIATE_MX_LEFTDIV_CONFORM (ComplexMatrix, ComplexMatrix); -template +template bool mx_div_conform (const T1& a, const T2& b) { @@ -703,7 +703,7 @@ // Diagonal matrix division. -template +template MT mdm_div_impl (const MT& a, const DMT& d) { @@ -786,7 +786,7 @@ xdiv (const FloatComplexMatrix& a, const FloatComplexDiagMatrix& b) { return mdm_div_impl (a, b); } -template +template MT dmm_leftdiv_impl (const DMT& d, const MT& a) { @@ -866,7 +866,7 @@ // Diagonal by diagonal matrix division. -template +template MT dmdm_div_impl (const MT& a, const DMT& d) { @@ -941,7 +941,7 @@ xdiv (const FloatComplexDiagMatrix& a, const FloatComplexDiagMatrix& b) { return dmdm_div_impl (a, b); } -template +template MT dmdm_leftdiv_impl (const DMT& d, const MT& a) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/corefcn/zfstream.h --- a/libinterp/corefcn/zfstream.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/corefcn/zfstream.h Sun Jan 24 13:50:04 2016 -0500 @@ -448,7 +448,7 @@ * This class defines a two-argument manipulator for gzofstream. It is used * as base for the setcompression(int,int) manipulator. */ -template +template class gzomanip2 { public: @@ -481,7 +481,7 @@ } // Manipulator constructor stores arguments -template +template inline gzomanip2::gzomanip2 (gzofstream &(*f)(gzofstream &, T1, T2), T1 v1, @@ -490,7 +490,7 @@ { } // Insertor applies underlying manipulator function to stream -template +template inline gzofstream& operator<<(gzofstream& s, const gzomanip2& m) { return (*m.func)(s, m.val1, m.val2); } diff -r e2fca7d79169 -r 538b57866b90 libinterp/dldfcn/__init_fltk__.cc --- a/libinterp/dldfcn/__init_fltk__.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/dldfcn/__init_fltk__.cc Sun Jan 24 13:50:04 2016 -0500 @@ -653,7 +653,7 @@ } } - template + template void remove_from_menu (T_prop& prop) { Matrix kids; diff -r e2fca7d79169 -r 538b57866b90 libinterp/dldfcn/__magick_read__.cc --- a/libinterp/dldfcn/__magick_read__.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/dldfcn/__magick_read__.cc Sun Jan 24 13:50:04 2016 -0500 @@ -209,7 +209,7 @@ return maps; } -template +template static octave_value_list read_indexed_images (const std::vector& imvec, const Array& frameidx, @@ -304,7 +304,7 @@ // very similar to account for different image types. They are different // enough that trying to reduce the copy and paste would decrease its // readability too much. -template +template octave_value_list read_images (std::vector& imvec, const Array& frameidx, @@ -860,7 +860,7 @@ #ifdef HAVE_MAGICK -template +template static uint32NDArray img_float2uint (const T& img) { @@ -880,7 +880,7 @@ // Gets the bitdepth to be used for an Octave class, i.e, returns 8 for // uint8, 16 for uint16, and 32 for uint32 -template +template static octave_idx_type bitdepth_from_class () { @@ -921,7 +921,7 @@ return img; } -template +template static void encode_indexed_images (std::vector& imvec, const T& img, @@ -1037,7 +1037,7 @@ } } -template +template static void encode_uint_image (std::vector& imvec, const T& img, const T& alpha) diff -r e2fca7d79169 -r 538b57866b90 libinterp/dldfcn/chol.cc --- a/libinterp/dldfcn/chol.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/dldfcn/chol.cc Sun Jan 24 13:50:04 2016 -0500 @@ -44,14 +44,14 @@ #include "ovl.h" #include "utils.h" -template +template static octave_value get_chol (const CHOLT& fact) { return octave_value (fact.chol_matrix()); } -template +template static octave_value get_chol_r (const CHOLT& fact) { @@ -59,7 +59,7 @@ MatrixType (MatrixType::Upper)); } -template +template static octave_value get_chol_l (const CHOLT& fact) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/dldfcn/qr.cc --- a/libinterp/dldfcn/qr.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/dldfcn/qr.cc Sun Jan 24 13:50:04 2016 -0500 @@ -44,7 +44,7 @@ #include "ovl.h" #include "utils.h" -template +template static octave_value get_qr_r (const base_qr& fact) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-diag.cc --- a/libinterp/octave-value/ov-base-diag.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-diag.cc Sun Jan 24 13:50:04 2016 -0500 @@ -41,7 +41,7 @@ #include "ls-oct-text.h" -template +template octave_value octave_base_diag::subsref (const std::string& type, const std::list& idx) @@ -70,7 +70,7 @@ } -template +template octave_value octave_base_diag::diag (octave_idx_type k) const { @@ -95,7 +95,7 @@ } -template +template octave_value octave_base_diag::do_index_op (const octave_value_list& idx, bool resize_ok) @@ -143,7 +143,7 @@ return retval; } -template +template octave_value octave_base_diag::subsasgn (const std::string& type, const std::list& idx, @@ -257,7 +257,7 @@ return retval; } -template +template octave_value octave_base_diag::resize (const dim_vector& dv, bool fill) const { @@ -273,7 +273,7 @@ return retval; } -template +template bool octave_base_diag::is_true (void) const { @@ -281,15 +281,15 @@ } // FIXME: This should be achieveable using ::real -template inline T helper_getreal (T x) { return x; } -template inline T helper_getreal (std::complex x) +template inline T helper_getreal (T x) { return x; } +template inline T helper_getreal (std::complex x) { return x.real (); } // FIXME: We really need some traits so that ad hoc hooks like this // are not necessary. -template inline T helper_iscomplex (T) { return false; } -template inline T helper_iscomplex (std::complex) { return true; } +template inline T helper_iscomplex (T) { return false; } +template inline T helper_iscomplex (std::complex) { return true; } -template +template double octave_base_diag::double_value (bool force_conversion) const { @@ -311,7 +311,7 @@ return retval; } -template +template float octave_base_diag::float_value (bool force_conversion) const { @@ -335,7 +335,7 @@ return retval; } -template +template Complex octave_base_diag::complex_value (bool) const { @@ -354,7 +354,7 @@ return retval; } -template +template FloatComplex octave_base_diag::float_complex_value (bool) const { @@ -373,98 +373,98 @@ return retval; } -template +template Matrix octave_base_diag::matrix_value (bool) const { return Matrix (diag_matrix_value ()); } -template +template FloatMatrix octave_base_diag::float_matrix_value (bool) const { return FloatMatrix (float_diag_matrix_value ()); } -template +template ComplexMatrix octave_base_diag::complex_matrix_value (bool) const { return ComplexMatrix (complex_diag_matrix_value ()); } -template +template FloatComplexMatrix octave_base_diag::float_complex_matrix_value (bool) const { return FloatComplexMatrix (float_complex_diag_matrix_value ()); } -template +template NDArray octave_base_diag::array_value (bool) const { return NDArray (matrix_value ()); } -template +template FloatNDArray octave_base_diag::float_array_value (bool) const { return FloatNDArray (float_matrix_value ()); } -template +template ComplexNDArray octave_base_diag::complex_array_value (bool) const { return ComplexNDArray (complex_matrix_value ()); } -template +template FloatComplexNDArray octave_base_diag::float_complex_array_value (bool) const { return FloatComplexNDArray (float_complex_matrix_value ()); } -template +template boolNDArray octave_base_diag::bool_array_value (bool warn) const { return to_dense ().bool_array_value (warn); } -template +template charNDArray octave_base_diag::char_array_value (bool warn) const { return to_dense ().char_array_value (warn); } -template +template SparseMatrix octave_base_diag::sparse_matrix_value (bool) const { return SparseMatrix (diag_matrix_value ()); } -template +template SparseComplexMatrix octave_base_diag::sparse_complex_matrix_value (bool) const { return SparseComplexMatrix (complex_diag_matrix_value ()); } -template +template idx_vector octave_base_diag::index_vector (bool require_integers) const { return to_dense ().index_vector (require_integers); } -template +template octave_value octave_base_diag::convert_to_str_internal (bool pad, bool force, char type) const @@ -472,7 +472,7 @@ return to_dense ().convert_to_str_internal (pad, force, type); } -template +template bool octave_base_diag::save_ascii (std::ostream& os) { @@ -484,7 +484,7 @@ return true; } -template +template bool octave_base_diag::load_ascii (std::istream& is) { @@ -515,7 +515,7 @@ return true; } -template +template void octave_base_diag::print_raw (std::ostream& os, bool pr_as_read_syntax) const @@ -524,14 +524,14 @@ current_print_indent_level ()); } -template +template mxArray * octave_base_diag::as_mxArray (void) const { return to_dense ().as_mxArray (); } -template +template bool octave_base_diag::print_as_scalar (void) const { @@ -540,14 +540,14 @@ return (dv.all_ones () || dv.any_zero ()); } -template +template void octave_base_diag::print (std::ostream& os, bool pr_as_read_syntax) { print_raw (os, pr_as_read_syntax); newline (os); } -template +template int octave_base_diag::write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, @@ -557,7 +557,7 @@ return to_dense ().write (os, block_size, output_type, skip, flt_fmt); } -template +template void octave_base_diag::print_info (std::ostream& os, const std::string& prefix) const @@ -565,7 +565,7 @@ matrix.print_info (os, prefix); } -template +template octave_value octave_base_diag::fast_elem_extract (octave_idx_type n) const { @@ -582,7 +582,7 @@ return octave_value (); } -template +template octave_value octave_base_diag::to_dense (void) const { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-diag.h --- a/libinterp/octave-value/ov-base-diag.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-diag.h Sun Jan 24 13:50:04 2016 -0500 @@ -39,7 +39,7 @@ // Real matrix values. -template +template class octave_base_diag : public octave_base_value { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-int.cc --- a/libinterp/octave-value/ov-base-int.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-int.cc Sun Jan 24 13:50:04 2016 -0500 @@ -61,7 +61,7 @@ // about comparisons always false due to limited range of data types. // Ugh. The cure may be worse than the disease. -template +template struct octave_base_int_helper { static bool @@ -71,13 +71,13 @@ } }; -template +template struct octave_base_int_helper { static bool char_value_out_of_range (T) { return false; } }; -template +template struct octave_base_int_helper { static bool char_value_out_of_range (T val) @@ -86,7 +86,7 @@ } }; -template +template struct octave_base_int_helper { static bool char_value_out_of_range (T val) { return val < 0; } @@ -98,7 +98,7 @@ // are still OK, but will see the warnings again for any other types // that do not meet this assumption. -template +template struct octave_base_int_helper_traits { static const bool can_be_larger_than_uchar_max = true; @@ -123,7 +123,7 @@ }; -template +template octave_base_value * octave_base_int_matrix::try_narrowing_conversion (void) { @@ -136,7 +136,7 @@ return retval; } -template +template octave_value octave_base_int_matrix::convert_to_str_internal (bool, bool, char type) const { @@ -184,7 +184,7 @@ return retval; } -template +template bool octave_base_int_matrix::save_ascii (std::ostream& os) { @@ -200,7 +200,7 @@ return true; } -template +template bool octave_base_int_matrix::load_ascii (std::istream& is) { @@ -230,7 +230,7 @@ return true; } -template +template bool octave_base_int_matrix::save_binary (std::ostream& os, bool&) { @@ -253,7 +253,7 @@ return true; } -template +template bool octave_base_int_matrix::load_binary (std::istream& is, bool swap, oct_mach_info::float_format) @@ -323,7 +323,7 @@ return true; } -template +template bool octave_base_int_matrix::save_hdf5 (octave_hdf5_id loc_id, const char *name, bool) { @@ -375,7 +375,7 @@ return retval; } -template +template bool octave_base_int_matrix::load_hdf5 (octave_hdf5_id loc_id, const char *name) { @@ -444,7 +444,7 @@ return retval; } -template +template void octave_base_int_matrix::print_raw (std::ostream& os, bool pr_as_read_syntax) const @@ -453,7 +453,7 @@ this->current_print_indent_level ()); } -template +template octave_value octave_base_int_scalar::convert_to_str_internal (bool, bool, char type) const { @@ -484,7 +484,7 @@ return retval; } -template +template bool octave_base_int_scalar::save_ascii (std::ostream& os) { @@ -492,7 +492,7 @@ return true; } -template +template bool octave_base_int_scalar::load_ascii (std::istream& is) { @@ -503,7 +503,7 @@ return true; } -template +template bool octave_base_int_scalar::save_binary (std::ostream& os, bool&) { @@ -511,7 +511,7 @@ return true; } -template +template bool octave_base_int_scalar::load_binary (std::istream& is, bool swap, oct_mach_info::float_format) @@ -540,7 +540,7 @@ return true; } -template +template bool octave_base_int_scalar::save_hdf5 (octave_hdf5_id loc_id, const char *name, bool) { @@ -582,7 +582,7 @@ return retval; } -template +template bool octave_base_int_scalar::load_hdf5 (octave_hdf5_id loc_id, const char *name) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-int.h --- a/libinterp/octave-value/ov-base-int.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-int.h Sun Jan 24 13:50:04 2016 -0500 @@ -39,7 +39,7 @@ // base int matrix values. -template +template class octave_base_int_matrix : public octave_base_matrix { @@ -85,7 +85,7 @@ // base int scalar values. -template +template class octave_base_int_scalar : public octave_base_scalar { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-mat.cc --- a/libinterp/octave-value/ov-base-mat.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-mat.cc Sun Jan 24 13:50:04 2016 -0500 @@ -37,7 +37,7 @@ #include "ov-base-scalar.h" #include "pr-output.h" -template +template octave_value octave_base_matrix::subsref (const std::string& type, const std::list& idx) @@ -65,7 +65,7 @@ return retval.next_subsref (type, idx); } -template +template octave_value octave_base_matrix::subsasgn (const std::string& type, const std::list& idx, @@ -124,7 +124,7 @@ return retval; } -template +template octave_value octave_base_matrix::do_index_op (const octave_value_list& idx, bool resize_ok) @@ -208,7 +208,7 @@ return retval; } -template +template void octave_base_matrix::assign (const octave_value_list& idx, const MT& rhs) { @@ -268,7 +268,7 @@ clear_cached_info (); } -template +template MatrixType octave_base_matrix::matrix_type (const MatrixType& _typ) const { @@ -277,7 +277,7 @@ return *typ; } -template +template void octave_base_matrix::assign (const octave_value_list& idx, typename MT::element_type rhs) @@ -372,7 +372,7 @@ clear_cached_info (); } -template +template void octave_base_matrix::delete_elements (const octave_value_list& idx) { @@ -389,7 +389,7 @@ clear_cached_info (); } -template +template octave_value octave_base_matrix::resize (const dim_vector& dv, bool fill) const { @@ -401,7 +401,7 @@ return retval; } -template +template bool octave_base_matrix::is_true (void) const { @@ -424,7 +424,7 @@ return retval; } -template +template bool octave_base_matrix::print_as_scalar (void) const { @@ -433,7 +433,7 @@ return (dv.all_ones () || dv.any_zero ()); } -template +template void octave_base_matrix::print (std::ostream& os, bool pr_as_read_syntax) { @@ -441,7 +441,7 @@ newline (os); } -template +template void octave_base_matrix::print_info (std::ostream& os, const std::string& prefix) const @@ -449,7 +449,7 @@ matrix.print_info (os, prefix); } -template +template void octave_base_matrix::short_disp (std::ostream& os) const { @@ -501,7 +501,7 @@ os << "..."; } -template +template octave_value octave_base_matrix::fast_elem_extract (octave_idx_type n) const { @@ -511,7 +511,7 @@ return octave_value (); } -template +template bool octave_base_matrix::fast_elem_insert (octave_idx_type n, const octave_value& x) diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-mat.h --- a/libinterp/octave-value/ov-base-mat.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-mat.h Sun Jan 24 13:50:04 2016 -0500 @@ -42,7 +42,7 @@ // Real matrix values. -template +template class octave_base_matrix : public octave_base_value { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-scalar.cc --- a/libinterp/octave-value/ov-base-scalar.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-scalar.cc Sun Jan 24 13:50:04 2016 -0500 @@ -33,7 +33,7 @@ #include "ov-base-scalar.h" #include "pr-output.h" -template +template octave_value octave_base_scalar::subsref (const std::string& type, const std::list& idx) @@ -61,7 +61,7 @@ return retval.next_subsref (type, idx); } -template +template octave_value octave_base_scalar::subsasgn (const std::string& type, const std::list& idx, @@ -99,35 +99,35 @@ return retval; } -template +template octave_value octave_base_scalar::permute (const Array& vec, bool inv) const { return Array (dim_vector (1, 1), scalar).permute (vec, inv); } -template +template octave_value octave_base_scalar::reshape (const dim_vector& new_dims) const { return Array (dim_vector (1, 1), scalar).reshape (new_dims); } -template +template octave_value octave_base_scalar::diag (octave_idx_type k) const { return Array (dim_vector (1, 1), scalar).diag (k); } -template +template octave_value octave_base_scalar::diag (octave_idx_type m, octave_idx_type n) const { return Array (dim_vector (1, 1), scalar).diag (m, n); } -template +template bool octave_base_scalar::is_true (void) const { @@ -137,7 +137,7 @@ return (scalar != ST ()); } -template +template void octave_base_scalar::print (std::ostream& os, bool pr_as_read_syntax) { @@ -145,7 +145,7 @@ newline (os); } -template +template void octave_base_scalar::print_raw (std::ostream& os, bool pr_as_read_syntax) const @@ -154,7 +154,7 @@ octave_print_internal (os, scalar, pr_as_read_syntax); } -template +template bool octave_base_scalar::print_name_tag (std::ostream& os, const std::string& name) const @@ -164,7 +164,7 @@ return false; } -template +template void octave_base_scalar::short_disp (std::ostream& os) const { @@ -178,14 +178,14 @@ os << tmp[0]; } -template +template octave_value octave_base_scalar::fast_elem_extract (octave_idx_type n) const { return (n == 0) ? octave_value (scalar) : octave_value (); } -template +template bool octave_base_scalar::fast_elem_insert_self (void *where, builtin_type_t btyp) const diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-scalar.h --- a/libinterp/octave-value/ov-base-scalar.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-scalar.h Sun Jan 24 13:50:04 2016 -0500 @@ -38,7 +38,7 @@ // Real scalar values. -template +template class octave_base_scalar : public octave_base_value { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-sparse.cc --- a/libinterp/octave-value/ov-base-sparse.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-sparse.cc Sun Jan 24 13:50:04 2016 -0500 @@ -47,7 +47,7 @@ #include "lo-array-errwarn.h" -template +template octave_value octave_base_sparse::do_index_op (const octave_value_list& idx, bool resize_ok) @@ -103,7 +103,7 @@ return retval; } -template +template octave_value octave_base_sparse::subsref (const std::string& type, const std::list& idx) @@ -131,7 +131,7 @@ return retval.next_subsref (type, idx); } -template +template octave_value octave_base_sparse::subsasgn (const std::string& type, const std::list& idx, @@ -176,7 +176,7 @@ return retval; } -template +template void octave_base_sparse::assign (const octave_value_list& idx, const T& rhs) { @@ -230,7 +230,7 @@ typ.invalidate_type (); } -template +template void octave_base_sparse::delete_elements (const octave_value_list& idx) { @@ -282,7 +282,7 @@ typ.invalidate_type (); } -template +template octave_value octave_base_sparse::resize (const dim_vector& dv, bool) const { @@ -291,7 +291,7 @@ return retval; } -template +template bool octave_base_sparse::is_true (void) const { @@ -312,7 +312,7 @@ return retval; } -template +template bool octave_base_sparse::print_as_scalar (void) const { @@ -321,7 +321,7 @@ return (dv.all_ones () || dv.any_zero ()); } -template +template void octave_base_sparse::print (std::ostream& os, bool pr_as_read_syntax) { @@ -329,7 +329,7 @@ newline (os); } -template +template void octave_base_sparse::print_info (std::ostream& os, const std::string& prefix) const @@ -337,7 +337,7 @@ matrix.print_info (os, prefix); } -template +template void octave_base_sparse::print_raw (std::ostream& os, bool pr_as_read_syntax) const @@ -419,7 +419,7 @@ } } -template +template bool octave_base_sparse::save_ascii (std::ostream& os) { @@ -437,7 +437,7 @@ return true; } -template +template bool octave_base_sparse::load_ascii (std::istream& is) { @@ -463,7 +463,7 @@ } -template +template octave_value octave_base_sparse::fast_elem_extract (octave_idx_type n) const { @@ -476,7 +476,7 @@ return (i < nr && j < nc) ? octave_value (matrix(i,j)) : octave_value (); } -template +template octave_value octave_base_sparse::map (octave_base_value::unary_mapper_t umap) const { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base-sparse.h --- a/libinterp/octave-value/ov-base-sparse.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base-sparse.h Sun Jan 24 13:50:04 2016 -0500 @@ -43,7 +43,7 @@ class octave_sparse_bool_matrix; -template +template class octave_base_sparse : public octave_base_value { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-base.h --- a/libinterp/octave-value/ov-base.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-base.h Sun Jan 24 13:50:04 2016 -0500 @@ -110,7 +110,7 @@ extern OCTINTERP_API builtin_type_t btyp_mixed_numeric (builtin_type_t x, builtin_type_t y); -template +template struct class_to_btyp { static const builtin_type_t btyp = btyp_unknown; diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-classdef.cc Sun Jan 24 13:50:04 2016 -0500 @@ -2570,7 +2570,7 @@ return octave_value (true); } -template +template static std::string attribute_value_to_string (T* t, octave_value v) { @@ -3289,7 +3289,7 @@ member_count++; } -template +template Cell map2Cell (const std::map& m) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-int-traits.h --- a/libinterp/octave-value/ov-int-traits.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-int-traits.h Sun Jan 24 13:50:04 2016 -0500 @@ -33,7 +33,7 @@ #include "ov-uint32.h" #include "ov-uint64.h" -template +template class octave_value_int_traits { @@ -42,7 +42,7 @@ }; #define OCTAVE_VALUE_INT_TRAITS(MT, ST) \ - template<> \ + template <> \ class \ octave_value_int_traits \ { \ diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-java.h --- a/libinterp/octave-value/ov-java.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-java.h Sun Jan 24 13:50:04 2016 -0500 @@ -28,7 +28,7 @@ #include #include -template +template class java_local_ref { public: diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov-usr-fcn.h --- a/libinterp/octave-value/ov-usr-fcn.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov-usr-fcn.h Sun Jan 24 13:50:04 2016 -0500 @@ -391,7 +391,7 @@ void accept (tree_walker& tw); - template + template bool local_protect (T& variable) { if (curr_unwind_protect_frame) diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov.cc Sun Jan 24 13:50:04 2016 -0500 @@ -1650,7 +1650,7 @@ type_name (), "real vector")); } -template +template static Array convert_to_int_array (const Array >& A) { @@ -1719,7 +1719,7 @@ type_name (), "integer vector")); } -template +template static Array convert_to_octave_idx_type_array (const Array >& A) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/octave-value/ov.h Sun Jan 24 13:50:04 2016 -0500 @@ -1539,12 +1539,12 @@ extern OCTINTERP_API void install_types (void); // Templated value extractors. -template +template inline Value octave_value_extract (const octave_value&) { assert (false); } #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \ -template<> \ +template <> \ inline VALUE octave_value_extract (const octave_value& v) \ { return v.MPREFIX ## _value (); } @@ -1608,7 +1608,7 @@ #undef DEF_VALUE_EXTRACTOR #define DEF_DUMMY_VALUE_EXTRACTOR(VALUE,DEFVAL) \ -template<> \ +template <> \ inline VALUE octave_value_extract (const octave_value&) \ { assert (false); return DEFVAL; } diff -r e2fca7d79169 -r 538b57866b90 libinterp/operators/op-dms-template.cc --- a/libinterp/operators/op-dms-template.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/operators/op-dms-template.cc Sun Jan 24 13:50:04 2016 -0500 @@ -48,7 +48,7 @@ #define MATRIX_VALUE CONCAT2(MATRIXV, _value) #define SCALAR_VALUE CONCAT2(SCALARV, _value) -template +template static T gripe_if_zero (T x) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/parse-tree/oct-parse.in.yy Sun Jan 24 13:50:04 2016 -0500 @@ -3939,7 +3939,7 @@ } // Finish building a statement. -template +template tree_statement * octave_base_parser::make_statement (T *arg) { diff -r e2fca7d79169 -r 538b57866b90 libinterp/parse-tree/parse.h --- a/libinterp/parse-tree/parse.h Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/parse-tree/parse.h Sun Jan 24 13:50:04 2016 -0500 @@ -377,7 +377,7 @@ set_stmt_print_flag (tree_statement_list *, char, bool); // Finish building a statement. - template + template tree_statement *make_statement (T *arg); // Create a statement list. diff -r e2fca7d79169 -r 538b57866b90 libinterp/parse-tree/pt-mat.cc --- a/libinterp/parse-tree/pt-mat.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/libinterp/parse-tree/pt-mat.cc Sun Jan 24 13:50:04 2016 -0500 @@ -664,7 +664,7 @@ "concatenation of different character string types may have unintended consequences"); } -template +template static void single_type_concat (Array& result, tm_const& tmp) @@ -702,7 +702,7 @@ } } -template +template static void single_type_concat (Array& result, const dim_vector& dv, @@ -753,7 +753,7 @@ } } -template +template static void single_type_concat (Sparse& result, const dim_vector& dv, @@ -794,7 +794,7 @@ result = Sparse::cat (-1, nrows, sparse_row_list); } -template +template static void single_type_concat (octave_map& result, const dim_vector& dv, @@ -832,7 +832,7 @@ result = octave_map::cat (-1, nrows, map_row_list); } -template +template static octave_value do_single_type_concat (const dim_vector& dv, tm_const& tmp) @@ -844,7 +844,7 @@ return result; } -template<> +template <> octave_value do_single_type_concat (const dim_vector& dv, tm_const& tmp) diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/Array-b.cc --- a/liboctave/array/Array-b.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/Array-b.cc Sun Jan 24 13:50:04 2016 -0500 @@ -34,7 +34,7 @@ // Specialize bool sorting (aka stable partitioning). -template +template static void do_bool_partition (bool *data, octave_idx_type nel) { octave_idx_type k = 0; @@ -45,7 +45,7 @@ data[i] = ! desc; } -template +template static void do_bool_partition (bool *data, octave_idx_type *idx, octave_idx_type nel) { @@ -72,7 +72,8 @@ } } -template <> template <> +template <> +template <> void octave_sort::sort (bool *data, octave_idx_type nel, std::less) @@ -80,7 +81,8 @@ do_bool_partition (data, nel); } -template <> template <> +template <> +template <> void octave_sort::sort (bool *data, octave_idx_type nel, std::greater) @@ -88,7 +90,8 @@ do_bool_partition (data, nel); } -template <> template <> +template <> +template <> void octave_sort::sort (bool *data, octave_idx_type *idx, octave_idx_type nel, std::less) @@ -96,7 +99,8 @@ do_bool_partition (data, idx, nel); } -template <> template <> +template <> +template <> void octave_sort::sort (bool *data, octave_idx_type *idx, octave_idx_type nel, std::greater) diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/Array.cc --- a/liboctave/array/Array.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/Array.cc Sun Jan 24 13:50:04 2016 -0500 @@ -44,7 +44,7 @@ // One dimensional array class. Handles the reference counting for // all the derived classes. -template +template Array::Array (const Array& a, const dim_vector& dv) : dimensions (dv), rep (a.rep), slice_data (a.slice_data), slice_len (a.slice_len) @@ -65,7 +65,7 @@ dimensions.chop_trailing_singletons (); } -template +template void Array::fill (const T& val) { @@ -79,7 +79,7 @@ std::fill_n (slice_data, slice_len, val); } -template +template void Array::clear (void) { @@ -94,7 +94,7 @@ dimensions = dim_vector (); } -template +template void Array::clear (const dim_vector& dv) { @@ -109,7 +109,7 @@ dimensions.chop_trailing_singletons (); } -template +template Array Array::squeeze (void) const { @@ -162,14 +162,14 @@ return retval; } -template +template octave_idx_type Array::compute_index (octave_idx_type i, octave_idx_type j) const { return ::compute_index (i, j, dimensions); } -template +template octave_idx_type Array::compute_index (octave_idx_type i, octave_idx_type j, octave_idx_type k) const @@ -177,14 +177,14 @@ return ::compute_index (i, j, k, dimensions); } -template +template octave_idx_type Array::compute_index (const Array& ra_idx) const { return ::compute_index (ra_idx, dimensions); } -template +template T& Array::checkelem (octave_idx_type n) { @@ -197,28 +197,28 @@ return elem (n); } -template +template T& Array::checkelem (octave_idx_type i, octave_idx_type j) { return elem (compute_index (i, j)); } -template +template T& Array::checkelem (octave_idx_type i, octave_idx_type j, octave_idx_type k) { return elem (compute_index (i, j, k)); } -template +template T& Array::checkelem (const Array& ra_idx) { return elem (compute_index (ra_idx)); } -template +template typename Array::crefT Array::checkelem (octave_idx_type n) const { @@ -231,14 +231,14 @@ return elem (n); } -template +template typename Array::crefT Array::checkelem (octave_idx_type i, octave_idx_type j) const { return elem (compute_index (i, j)); } -template +template typename Array::crefT Array::checkelem (octave_idx_type i, octave_idx_type j, octave_idx_type k) const @@ -246,14 +246,14 @@ return elem (compute_index (i, j, k)); } -template +template typename Array::crefT Array::checkelem (const Array& ra_idx) const { return elem (compute_index (ra_idx)); } -template +template Array Array::column (octave_idx_type k) const { @@ -266,7 +266,7 @@ return Array (*this, dim_vector (r, 1), k*r, k*r + r); } -template +template Array Array::page (octave_idx_type k) const { @@ -281,7 +281,7 @@ return Array (*this, dim_vector (r, c), k*p, k*p + p); } -template +template Array Array::linear_slice (octave_idx_type lo, octave_idx_type up) const { @@ -349,7 +349,7 @@ ~rec_permute_helper (void) { delete [] dim; } // Helper method for fast blocked transpose. - template + template static T * blk_trans (const T *src, T *dest, octave_idx_type nr, octave_idx_type nc) { @@ -390,7 +390,7 @@ private: // Recursive N-D generalized transpose - template + template T *do_permute (const T *src, T *dest, int lev) const { if (lev == 0) @@ -431,12 +431,12 @@ public: - template + template void permute (const T *src, T *dest) const { do_permute (src, dest, top); } }; -template +template Array Array::permute (const Array& perm_vec_arg, bool inv) const { @@ -557,7 +557,7 @@ private: // Recursive N-D indexing - template + template T *do_index (const T *src, T *dest, int lev) const { if (lev == 0) @@ -574,7 +574,7 @@ } // Recursive N-D indexed assignment - template + template const T *do_assign (const T *src, T *dest, int lev) const { if (lev == 0) @@ -591,7 +591,7 @@ } // Recursive N-D indexed assignment - template + template void do_fill (const T& val, T *dest, int lev) const { if (lev == 0) @@ -613,13 +613,13 @@ public: - template + template void index (const T *src, T *dest) const { do_index (src, dest, top); } - template + template void assign (const T *src, T *dest) const { do_assign (src, dest, top); } - template + template void fill (const T& val, T *dest) const { do_fill (val, dest, top); } bool is_cont_range (octave_idx_type& l, @@ -670,7 +670,7 @@ private: // recursive resizing - template + template void do_resize_fill (const T* src, T *dest, const T& rfv, int lev) const { if (lev == 0) @@ -698,12 +698,12 @@ public: - template + template void resize_fill (const T* src, T *dest, const T& rfv) const { do_resize_fill (src, dest, rfv, n-1); } }; -template +template Array Array::index (const idx_vector& i) const { @@ -767,7 +767,7 @@ return retval; } -template +template Array Array::index (const idx_vector& i, const idx_vector& j) const { @@ -825,7 +825,7 @@ return retval; } -template +template Array Array::index (const Array& ia) const { @@ -889,7 +889,7 @@ // The default fill value. Override if you want a different one. -template +template T Array::resize_fill_value (void) const { @@ -900,7 +900,7 @@ // Yes, we could do resize using index & assign. However, that would // possibly involve a lot more memory traffic than we actually need. -template +template void Array::resize1 (octave_idx_type n, const T& rfv) { @@ -971,7 +971,7 @@ } } -template +template void Array::resize2 (octave_idx_type r, octave_idx_type c, const T& rfv) { @@ -1013,7 +1013,7 @@ } } -template +template void Array::resize (const dim_vector& dv, const T& rfv) { @@ -1035,7 +1035,7 @@ } } -template +template Array Array::index (const idx_vector& i, bool resize_ok, const T& rfv) const { @@ -1059,7 +1059,7 @@ return tmp.index (i); } -template +template Array Array::index (const idx_vector& i, const idx_vector& j, bool resize_ok, const T& rfv) const @@ -1087,7 +1087,7 @@ return tmp.index (i, j); } -template +template Array Array::index (const Array& ia, bool resize_ok, const T& rfv) const @@ -1119,7 +1119,7 @@ } -template +template void Array::assign (const idx_vector& i, const Array& rhs, const T& rfv) { @@ -1166,7 +1166,7 @@ } // Assignment to a 2-dimensional array -template +template void Array::assign (const idx_vector& i, const idx_vector& j, const Array& rhs, const T& rfv) @@ -1270,7 +1270,7 @@ } // Assignment to a multi-dimensional array -template +template void Array::assign (const Array& ia, const Array& rhs, const T& rfv) @@ -1393,7 +1393,7 @@ %!error a(1:2,2:3) = [1;2] */ -template +template void Array::delete_elements (const idx_vector& i) { @@ -1433,7 +1433,7 @@ } } -template +template void Array::delete_elements (int dim, const idx_vector& i) { @@ -1489,7 +1489,7 @@ } } -template +template void Array::delete_elements (const Array& ia) { @@ -1566,7 +1566,7 @@ } -template +template Array& Array::insert (const Array& a, octave_idx_type r, octave_idx_type c) { @@ -1587,7 +1587,7 @@ return *this; } -template +template Array& Array::insert (const Array& a, const Array& ra_idx) { @@ -1603,7 +1603,7 @@ } -template +template Array Array::transpose (void) const { @@ -1639,14 +1639,14 @@ } } -template +template static T no_op_fcn (const T& x) { return x; } -template +template Array Array::hermitian (T (*fcn) (const T&)) const { @@ -1745,7 +1745,7 @@ */ -template +template T * Array::fortran_vec (void) { @@ -1755,14 +1755,14 @@ } // Non-real types don't have NaNs. -template +template inline bool sort_isnan (typename ref_param::type) { return false; } -template +template Array Array::sort (int dim, sortmode mode) const { @@ -1878,7 +1878,7 @@ return m; } -template +template Array Array::sort (Array &sidx, int dim, sortmode mode) const @@ -2026,7 +2026,7 @@ return m; } -template +template typename Array::compare_fcn_type safe_comparator (sortmode mode, const Array& /* a */, bool /* allow_chk */) @@ -2039,7 +2039,7 @@ return 0; } -template +template sortmode Array::is_sorted (sortmode mode) const { @@ -2074,7 +2074,7 @@ } -template +template Array Array::sort_rows_idx (sortmode mode) const { @@ -2093,7 +2093,7 @@ } -template +template sortmode Array::is_sorted_rows (sortmode mode) const { @@ -2154,7 +2154,7 @@ } // Do a binary lookup in a sorted array. -template +template octave_idx_type Array::lookup (const T& value, sortmode mode) const { @@ -2175,7 +2175,7 @@ return lsort.lookup (data (), n, value); } -template +template Array Array::lookup (const Array& values, sortmode mode) const { @@ -2219,7 +2219,7 @@ return idx; } -template +template octave_idx_type Array::nnz (void) const { @@ -2234,7 +2234,7 @@ return retval; } -template +template Array Array::find (octave_idx_type n, bool backward) const { @@ -2315,7 +2315,7 @@ return retval; } -template +template Array Array::nth_element (const idx_vector& n, int dim) const { @@ -2503,7 +2503,7 @@ Array::nth_element (const idx_vector&, int) const { return Array (); } -template +template Array Array::diag (octave_idx_type k) const { @@ -2589,7 +2589,7 @@ return d; } -template +template Array Array::diag (octave_idx_type m, octave_idx_type n) const { @@ -2604,7 +2604,7 @@ return retval; } -template +template Array Array::cat (int dim, octave_idx_type n, const Array *array_list) { @@ -2708,7 +2708,7 @@ return retval; } -template +template void Array::print_info (std::ostream& os, const std::string& prefix) const { @@ -2725,7 +2725,7 @@ // << prefix << "cols: " << cols () << "\n"; } -template +template bool Array::optimize_dimensions (const dim_vector& dv) { bool retval = dimensions == dv; @@ -2735,7 +2735,7 @@ return retval; } -template +template void Array::instantiation_guard () { // This guards against accidental implicit instantiations. @@ -2749,7 +2749,7 @@ // FIXME: is this used? -template +template std::ostream& operator << (std::ostream& os, const Array& a) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/Array.h --- a/liboctave/array/Array.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/Array.h Sun Jan 24 13:50:04 2016 -0500 @@ -41,7 +41,7 @@ #include "oct-refcount.h" //! Handles the reference counting for all the derived classes. -template +template class Array { @@ -62,7 +62,7 @@ std::copy (d, d+l, data); } - template + template ArrayRep (U *d, octave_idx_type l) : data (new T [l]), len (l), count (1) { @@ -200,7 +200,7 @@ Array (const Array& a, const dim_vector& dv); //! Type conversion case. - template + template Array (const Array& a) : dimensions (a.dims ()), rep (new typename Array::ArrayRep (a.data (), a.numel ())), @@ -660,7 +660,7 @@ //! Apply function fcn to each element of the Array. This function //! is optimised with a manually unrolled loop. - template + template Array map (F fcn) const { @@ -692,19 +692,19 @@ //@{ //! Overloads for function references. - template + template Array map (U (&fcn) (T)) const { return map (fcn); } - template + template Array map (U (&fcn) (const T&)) const { return map (fcn); } //@} //! Generic any/all test functionality with arbitrary predicate. - template + template bool test (F fcn) const { return any_all_test (fcn, data (), numel ()); @@ -712,11 +712,11 @@ //@{ //! Simpler calls. - template + template bool test_any (F fcn) const { return test (fcn); } - template + template bool test_all (F fcn) const { return test (fcn); } //@} @@ -736,7 +736,7 @@ { return test (fcn); } //@} - template friend class Array; + template friend class Array; //! Returns true if this->dims () == dv, and if so, replaces this->dimensions //! by a shallow copy of dv. This is useful for maintaining several arrays with @@ -764,7 +764,7 @@ //! non-const operator() to not check for the array's uniqueness. It //! is, however, the user's responsibility to ensure the array is //! actually unaliased whenever elements are accessed. -template +template class NoAlias : public ArrayClass { typedef typename ArrayClass::element_type T; @@ -772,13 +772,13 @@ NoAlias () : ArrayClass () { } // FIXME: this would be simpler once C++0x is available - template + template explicit NoAlias (X x) : ArrayClass (x) { } - template + template explicit NoAlias (X x, Y y) : ArrayClass (x, y) { } - template + template explicit NoAlias (X x, Y y, Z z) : ArrayClass (x, y, z) { } T& operator () (octave_idx_type n) @@ -791,7 +791,7 @@ { return ArrayClass::xelem (ra_idx); } }; -template +template std::ostream& operator << (std::ostream& os, const Array& a); diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/CDiagMatrix.h --- a/liboctave/array/CDiagMatrix.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/CDiagMatrix.h Sun Jan 24 13:50:04 2016 -0500 @@ -65,7 +65,7 @@ ComplexDiagMatrix (const ComplexDiagMatrix& a) : MDiagArray2 (a) { } - template + template ComplexDiagMatrix (const DiagArray2& a) : MDiagArray2 (a) { } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/CMatrix.h --- a/liboctave/array/CMatrix.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/CMatrix.h Sun Jan 24 13:50:04 2016 -0500 @@ -59,10 +59,10 @@ ComplexMatrix (const ComplexMatrix& a) : ComplexNDArray (a) { } - template + template ComplexMatrix (const MArray& a) : ComplexNDArray (a.as_matrix ()) { } - template + template ComplexMatrix (const Array& a) : ComplexNDArray (a.as_matrix ()) { } ComplexMatrix (const Matrix& re, const Matrix& im); diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/CNDArray.h --- a/liboctave/array/CNDArray.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/CNDArray.h Sun Jan 24 13:50:04 2016 -0500 @@ -44,10 +44,10 @@ ComplexNDArray (const ComplexNDArray& a) : MArray (a) { } - template + template ComplexNDArray (const MArray& a) : MArray (a) { } - template + template ComplexNDArray (const Array& a) : MArray (a) { } ComplexNDArray (const charNDArray&); diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/DiagArray2.cc --- a/liboctave/array/DiagArray2.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/DiagArray2.cc Sun Jan 24 13:50:04 2016 -0500 @@ -36,7 +36,7 @@ #include "lo-error.h" -template +template DiagArray2::DiagArray2 (const Array& a, octave_idx_type r, octave_idx_type c) : Array (a.as_column ()), d1 (r), d2 (c) @@ -46,14 +46,14 @@ Array::resize (dim_vector (rcmin, 1)); } -template +template Array DiagArray2::diag (octave_idx_type k) const { return extract_diag (k); } -template +template Array DiagArray2::extract_diag (octave_idx_type k) const { @@ -72,14 +72,14 @@ return d; } -template +template DiagArray2 DiagArray2::transpose (void) const { return DiagArray2 (*this, d2, d1); } -template +template DiagArray2 DiagArray2::hermitian (T (* fcn) (const T&)) const { @@ -88,7 +88,7 @@ // A two-dimensional array with diagonal elements only. -template +template void DiagArray2::resize (octave_idx_type r, octave_idx_type c, const T& rfv) @@ -103,7 +103,7 @@ } } -template +template Array DiagArray2::array_value (void) const { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/DiagArray2.h --- a/liboctave/array/DiagArray2.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/DiagArray2.h Sun Jan 24 13:50:04 2016 -0500 @@ -34,7 +34,7 @@ // Array is inherited privately so that some methods, like index, don't // produce unexpected results. -template +template class DiagArray2 : protected Array { @@ -62,7 +62,7 @@ DiagArray2 (const DiagArray2& a) : Array (a), d1 (a.d1), d2 (a.d2) { } - template + template DiagArray2 (const DiagArray2& a) : Array (a.extract_diag ()), d1 (a.dim1 ()), d2 (a.dim2 ()) { } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/MArray.cc --- a/liboctave/array/MArray.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/MArray.cc Sun Jan 24 13:50:04 2016 -0500 @@ -29,7 +29,7 @@ #include "Array-util.h" #include "lo-error.h" -template +template struct _idxadds_helper { T *array; @@ -39,7 +39,7 @@ { array[i] += val; } }; -template +template struct _idxadda_helper { T *array; @@ -49,7 +49,7 @@ { array[i] += *vals++; } }; -template +template void MArray::idx_add (const idx_vector& idx, T val) { @@ -67,7 +67,7 @@ idx.loop (len, _idxadds_helper (this->fortran_vec (), val)); } -template +template void MArray::idx_add (const idx_vector& idx, const MArray& vals) { @@ -85,7 +85,7 @@ idx.loop (len, _idxadda_helper (this->fortran_vec (), vals.data ())); } -template ::type, +template ::type, typename ref_param::type)> struct _idxbinop_helper { @@ -96,7 +96,7 @@ { array[i] = op (array[i], *vals++); } }; -template +template void MArray::idx_min (const idx_vector& idx, const MArray& vals) { @@ -115,7 +115,7 @@ vals.data ())); } -template +template void MArray::idx_max (const idx_vector& idx, const MArray& vals) { @@ -136,7 +136,7 @@ #include -template +template void MArray::idx_add_nd (const idx_vector& idx, const MArray& vals, int dim) { @@ -199,7 +199,7 @@ } // N-dimensional array with math ops. -template +template void MArray::changesign (void) { @@ -211,7 +211,7 @@ // Element by element MArray by scalar ops. -template +template MArray& operator += (MArray& a, const T& s) { @@ -222,7 +222,7 @@ return a; } -template +template MArray& operator -= (MArray& a, const T& s) { @@ -233,7 +233,7 @@ return a; } -template +template MArray& operator *= (MArray& a, const T& s) { @@ -244,7 +244,7 @@ return a; } -template +template MArray& operator /= (MArray& a, const T& s) { @@ -257,7 +257,7 @@ // Element by element MArray by MArray ops. -template +template MArray& operator += (MArray& a, const MArray& b) { @@ -268,7 +268,7 @@ return a; } -template +template MArray& operator -= (MArray& a, const MArray& b) { @@ -280,7 +280,7 @@ } -template +template MArray& product_eq (MArray& a, const MArray& b) { @@ -291,7 +291,7 @@ return a; } -template +template MArray& quotient_eq (MArray& a, const MArray& b) { @@ -305,7 +305,7 @@ // Element by element MArray by scalar ops. #define MARRAY_NDS_OP(OP, FN) \ - template \ + template \ MArray \ operator OP (const MArray& a, const T& s) \ { \ @@ -320,7 +320,7 @@ // Element by element scalar by MArray ops. #define MARRAY_SND_OP(OP, FN) \ - template \ + template \ MArray \ operator OP (const T& s, const MArray& a) \ { \ @@ -335,7 +335,7 @@ // Element by element MArray by MArray ops. #define MARRAY_NDND_OP(FCN, OP, FN) \ - template \ + template \ MArray \ FCN (const MArray& a, const MArray& b) \ { \ @@ -347,14 +347,14 @@ MARRAY_NDND_OP (product, *, mx_inline_mul) MARRAY_NDND_OP (quotient, /, mx_inline_div) -template +template MArray operator + (const MArray& a) { return a; } -template +template MArray operator - (const MArray& a) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/MArray.h --- a/liboctave/array/MArray.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/MArray.h Sun Jan 24 13:50:04 2016 -0500 @@ -27,7 +27,7 @@ #include "Array.h" #include "mx-inlines.cc" -template class MArray; +template class MArray; template MArray& operator += (MArray&, const T&); template MArray& operator -= (MArray&, const T&); @@ -53,7 +53,7 @@ template MArray product (const MArray&, const MArray&); //! Template for N-dimensional array classes with like-type math operators. -template +template class MArray : public Array { @@ -75,7 +75,7 @@ MArray (const MArray& a) : Array (a) { } - template + template MArray (const Array& a) : Array (a) { } ~MArray (void) { } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/MDiagArray2.cc --- a/liboctave/array/MDiagArray2.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/MDiagArray2.cc Sun Jan 24 13:50:04 2016 -0500 @@ -29,7 +29,7 @@ #include "Array-util.h" #include "lo-error.h" -template +template bool MDiagArray2::is_multiple_of_identity (T val) const { @@ -53,7 +53,7 @@ // Element by element MDiagArray2 by scalar ops. #define MARRAY_DAS_OP(OP, FN) \ - template \ + template \ MDiagArray2 \ operator OP (const MDiagArray2& a, const T& s) \ { \ @@ -65,7 +65,7 @@ // Element by element scalar by MDiagArray2 ops. -template +template MDiagArray2 operator * (const T& s, const MDiagArray2& a) { @@ -76,7 +76,7 @@ // Element by element MDiagArray2 by MDiagArray2 ops. #define MARRAY_DADA_OP(FCN, OP, FN) \ - template \ + template \ MDiagArray2 \ FCN (const MDiagArray2& a, const MDiagArray2& b) \ { \ @@ -92,14 +92,14 @@ // Unary MDiagArray2 ops. -template +template MDiagArray2 operator + (const MDiagArray2& a) { return a; } -template +template MDiagArray2 operator - (const MDiagArray2& a) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/MDiagArray2.h --- a/liboctave/array/MDiagArray2.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/MDiagArray2.h Sun Jan 24 13:50:04 2016 -0500 @@ -28,7 +28,7 @@ #include "DiagArray2.h" #include "MArray.h" -template class MDiagArray2; +template class MDiagArray2; template MDiagArray2 operator + (const MDiagArray2&); template MDiagArray2 operator - (const MDiagArray2&); @@ -46,7 +46,7 @@ const MDiagArray2&); //! Template for two dimensional diagonal array with math operators. -template +template class MDiagArray2 : public DiagArray2 { @@ -63,7 +63,7 @@ MDiagArray2 (const DiagArray2& a) : DiagArray2 (a) { } - template + template MDiagArray2 (const DiagArray2& a) : DiagArray2 (a) { } explicit MDiagArray2 (const Array& a) : DiagArray2 (a) { } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/MSparse.cc --- a/liboctave/array/MSparse.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/MSparse.cc Sun Jan 24 13:50:04 2016 -0500 @@ -25,7 +25,7 @@ // Element by element MSparse by MSparse ops. -template +template MSparse& plus_or_minus (MSparse& a, const MSparse& b, OP op, const char* op_name) { @@ -112,7 +112,7 @@ // Element by element MSparse by scalar ops. -template +template MArray plus_or_minus (const MSparse& a, const T& s, OP op) { @@ -142,7 +142,7 @@ } -template +template MSparse times_or_divide (const MSparse& a, const T& s, OP op) { @@ -180,7 +180,7 @@ // Element by element scalar by MSparse ops. -template +template MArray plus_or_minus (const T& s, const MSparse& a, OP op) { @@ -209,7 +209,7 @@ return plus_or_minus (s, a, std::minus ()); } -template +template MSparse times_or_divides (const T& s, const MSparse& a, OP op) { @@ -230,14 +230,14 @@ return r; } -template +template MSparse operator * (const T& s, const MSparse& a) { return times_or_divides (s, a, std::multiplies ()); } -template +template MSparse operator / (const T& s, const MSparse& a) { @@ -247,7 +247,7 @@ // Element by element MSparse by MSparse ops. -template +template MSparse plus_or_minus (const MSparse& a, const MSparse& b, OP op, const char* op_name, bool negate) @@ -366,21 +366,21 @@ return r; } -template +template MSparse operator+ (const MSparse& a, const MSparse& b) { return plus_or_minus (a, b, std::plus (), "operator +", false); } -template +template MSparse operator- (const MSparse& a, const MSparse& b) { return plus_or_minus (a, b, std::minus (), "operator -", true); } -template +template MSparse product (const MSparse& a, const MSparse& b) { @@ -477,7 +477,7 @@ return r; } -template +template MSparse quotient (const MSparse& a, const MSparse& b) { @@ -595,14 +595,14 @@ // Unary MSparse ops. -template +template MSparse operator + (const MSparse& a) { return a; } -template +template MSparse operator - (const MSparse& a) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/MSparse.h --- a/liboctave/array/MSparse.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/MSparse.h Sun Jan 24 13:50:04 2016 -0500 @@ -38,7 +38,7 @@ // Two dimensional sparse array with math ops. -template +template class MSparse : public Sparse { @@ -57,7 +57,7 @@ MSparse (const Sparse& a) : Sparse (a) { } - template + template MSparse (const Sparse& a) : Sparse (a) { } MSparse (const Array& a, const idx_vector& r, const idx_vector& c, @@ -112,12 +112,12 @@ } // FIXME: should go away. - template + template MSparse map (U (&fcn) (T)) const { return Sparse::template map (fcn); } - template + template MSparse map (U (&fcn) (const T&)) const { return Sparse::template map (fcn); } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/MatrixType.cc --- a/liboctave/array/MatrixType.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/MatrixType.cc Sun Jan 24 13:50:04 2016 -0500 @@ -80,7 +80,7 @@ } } -template +template MatrixType::matrix_type matrix_real_probe (const MArray& a) { @@ -138,7 +138,7 @@ return typ; } -template +template MatrixType::matrix_type matrix_complex_probe (const MArray >& a) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/Sparse.cc --- a/liboctave/array/Sparse.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/Sparse.cc Sun Jan 24 13:50:04 2016 -0500 @@ -52,7 +52,7 @@ #include "PermMatrix.h" -template +template Sparse::Sparse (const PermMatrix& a) : rep (new typename Sparse::SparseRep (a.rows (), a.cols (), a.rows ())), dimensions (dim_vector (a.rows (), a.cols ())) @@ -70,7 +70,7 @@ data (i) = 1.0; } -template +template T& Sparse::SparseRep::elem (octave_idx_type _r, octave_idx_type _c) { @@ -111,7 +111,7 @@ return d[i]; } -template +template T Sparse::SparseRep::celem (octave_idx_type _r, octave_idx_type _c) const { @@ -122,7 +122,7 @@ return T (); } -template +template void Sparse::SparseRep::maybe_compress (bool remove_zeros) { @@ -146,7 +146,7 @@ change_length (c[ncols]); } -template +template void Sparse::SparseRep::change_length (octave_idx_type nz) { @@ -177,14 +177,14 @@ } } -template +template bool Sparse::SparseRep::indices_ok (void) const { return sparse_indices_ok (r, c, nrows, ncols, nnz ()); } -template +template Sparse::Sparse (octave_idx_type nr, octave_idx_type nc, T val) : rep (0), dimensions (dim_vector (nr, nc)) { @@ -212,7 +212,7 @@ } } -template +template Sparse::Sparse (const dim_vector& dv) : rep (0), dimensions (dv) { @@ -223,7 +223,7 @@ rep = new typename Sparse::SparseRep (dv(0), dv(1), 0); } -template +template Sparse::Sparse (const Sparse& a, const dim_vector& dv) : rep (0), dimensions (dv) { @@ -265,7 +265,7 @@ xcidx (k+1) = new_nzmx; } -template +template Sparse::Sparse (const Array& a, const idx_vector& r, const idx_vector& c, octave_idx_type nr, octave_idx_type nc, bool sum_terms, @@ -625,7 +625,7 @@ } } -template +template Sparse::Sparse (const Array& a) : rep (0), dimensions (a.dims ()) { @@ -659,14 +659,14 @@ } } -template +template Sparse::~Sparse (void) { if (--rep->count == 0) delete rep; } -template +template Sparse& Sparse::operator = (const Sparse& a) { @@ -684,7 +684,7 @@ return *this; } -template +template octave_idx_type Sparse::compute_index (const Array& ra_idx) const { @@ -707,21 +707,21 @@ return retval; } -template +template T Sparse::range_error (const char *fcn, octave_idx_type n) const { (*current_liboctave_error_handler) ("%s (%d): range error", fcn, n); } -template +template T& Sparse::range_error (const char *fcn, octave_idx_type n) { (*current_liboctave_error_handler) ("%s (%d): range error", fcn, n); } -template +template T Sparse::range_error (const char *fcn, octave_idx_type i, octave_idx_type j) const @@ -729,14 +729,14 @@ (*current_liboctave_error_handler) ("%s (%d, %d): range error", fcn, i, j); } -template +template T& Sparse::range_error (const char *fcn, octave_idx_type i, octave_idx_type j) { (*current_liboctave_error_handler) ("%s (%d, %d): range error", fcn, i, j); } -template +template T Sparse::range_error (const char *fcn, const Array& ra_idx) const @@ -760,7 +760,7 @@ (*current_liboctave_error_handler) (buf_str.c_str ()); } -template +template T& Sparse::range_error (const char *fcn, const Array& ra_idx) { @@ -783,7 +783,7 @@ (*current_liboctave_error_handler) (buf_str.c_str ()); } -template +template Sparse Sparse::reshape (const dim_vector& new_dims) const { @@ -850,7 +850,7 @@ return retval; } -template +template Sparse Sparse::permute (const Array& perm_vec, bool) const { @@ -878,7 +878,7 @@ return trans ? this->transpose () : *this; } -template +template void Sparse::resize1 (octave_idx_type n) { @@ -897,7 +897,7 @@ err_invalid_resize (); } -template +template void Sparse::resize (const dim_vector& dv) { @@ -909,7 +909,7 @@ resize (dv(0), dv(1)); } -template +template void Sparse::resize (octave_idx_type r, octave_idx_type c) { @@ -959,7 +959,7 @@ rep->change_length (rep->nnz ()); } -template +template Sparse& Sparse::insert (const Sparse& a, octave_idx_type r, octave_idx_type c) { @@ -1040,7 +1040,7 @@ return *this; } -template +template Sparse& Sparse::insert (const Sparse& a, const Array& ra_idx) { @@ -1051,7 +1051,7 @@ return insert (a, ra_idx(0), ra_idx(1)); } -template +template Sparse Sparse::transpose (void) const { @@ -1107,7 +1107,7 @@ return std::lower_bound (ridx, ridx + nr, ri) - ridx; } -template +template void Sparse::delete_elements (const idx_vector& idx) { @@ -1208,7 +1208,7 @@ } } -template +template void Sparse::delete_elements (const idx_vector& idx_i, const idx_vector& idx_j) { @@ -1327,7 +1327,7 @@ } } -template +template void Sparse::delete_elements (int dim, const idx_vector& idx) { @@ -1339,7 +1339,7 @@ (*current_liboctave_error_handler) ("invalid dimension in delete_elements"); } -template +template Sparse Sparse::index (const idx_vector& idx, bool resize_ok) const { @@ -1540,7 +1540,7 @@ return retval; } -template +template Sparse Sparse::index (const idx_vector& idx_i, const idx_vector& idx_j, bool resize_ok) const @@ -1784,7 +1784,7 @@ return retval; } -template +template void Sparse::assign (const idx_vector& idx, const Sparse& rhs) { @@ -1936,7 +1936,7 @@ err_nonconformant ("=", dim_vector(idx.length (n),1), rhs.dims()); } -template +template void Sparse::assign (const idx_vector& idx_i, const idx_vector& idx_j, const Sparse& rhs) @@ -2178,7 +2178,7 @@ // Can't use versions of these in Array.cc due to duplication of the // instantiations for Array, etc -template +template bool sparse_ascending_compare (typename ref_param::type a, typename ref_param::type b) @@ -2186,7 +2186,7 @@ return (a < b); } -template +template bool sparse_descending_compare (typename ref_param::type a, typename ref_param::type b) @@ -2194,7 +2194,7 @@ return (a > b); } -template +template Sparse Sparse::sort (octave_idx_type dim, sortmode mode) const { @@ -2259,7 +2259,7 @@ return m; } -template +template Sparse Sparse::sort (Array &sidx, octave_idx_type dim, sortmode mode) const @@ -2365,7 +2365,7 @@ return m; } -template +template Sparse Sparse::diag (octave_idx_type k) const { @@ -2538,7 +2538,7 @@ return d; } -template +template Sparse Sparse::cat (int dim, octave_idx_type n, const Sparse *sparse_list) { @@ -2636,7 +2636,7 @@ return retval; } -template +template Array Sparse::array_value () const { @@ -2862,7 +2862,7 @@ */ -template +template void Sparse::print_info (std::ostream& os, const std::string& prefix) const { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/Sparse.h --- a/liboctave/array/Sparse.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/Sparse.h Sun Jan 24 13:50:04 2016 -0500 @@ -45,7 +45,7 @@ // Two dimensional sparse class. Handles the reference counting for // all the derived classes. -template +template class Sparse { @@ -204,7 +204,7 @@ explicit Sparse (const PermMatrix& a); // Type conversion case. Preserves capacity (). - template + template Sparse (const Sparse& a) : rep (new typename Sparse::SparseRep (a.rep->nrows, a.rep->ncols, a.rep->nzmx)), @@ -599,18 +599,18 @@ Array array_value (void) const; // Generic any/all test functionality with arbitrary predicate. - template + template bool test (F fcn) const { return any_all_test (fcn, data (), nnz ()); } // Simpler calls. - template + template bool test_any (F fcn) const { return test (fcn); } - template + template bool test_all (F fcn) const { return test (fcn); } @@ -627,7 +627,7 @@ bool test_all (bool (&fcn) (const T&)) const { return test (fcn); } - template + template Sparse map (F fcn) const { @@ -683,12 +683,12 @@ } // Overloads for function references. - template + template Sparse map (U (&fcn) (T)) const { return map (fcn); } - template + template Sparse map (U (&fcn) (const T&)) const { return map (fcn); } @@ -696,7 +696,7 @@ bool indices_ok (void) const { return rep->indices_ok (); } }; -template +template std::istream& read_sparse_matrix (std::istream& is, Sparse& a, T (*read_fcn) (std::istream&)) diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/dDiagMatrix.h --- a/liboctave/array/dDiagMatrix.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/dDiagMatrix.h Sun Jan 24 13:50:04 2016 -0500 @@ -52,7 +52,7 @@ DiagMatrix (const MDiagArray2& a) : MDiagArray2 (a) { } - template + template DiagMatrix (const DiagArray2& a) : MDiagArray2 (a) { } explicit DiagMatrix (const Array& a) : MDiagArray2 (a) { } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/dMatrix.h --- a/liboctave/array/dMatrix.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/dMatrix.h Sun Jan 24 13:50:04 2016 -0500 @@ -58,10 +58,10 @@ Matrix (const Matrix& a) : NDArray (a) { } - template + template Matrix (const MArray& a) : NDArray (a.as_matrix ()) { } - template + template Matrix (const Array& a) : NDArray (a.as_matrix ()) { } explicit Matrix (const RowVector& rv); @@ -383,7 +383,7 @@ MARRAY_FORWARD_DEFS (MArray, Matrix, double) -template +template void read_int (std::istream& is, bool swap_bytes, T& val); #endif diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/dNDArray.h --- a/liboctave/array/dNDArray.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/dNDArray.h Sun Jan 24 13:50:04 2016 -0500 @@ -48,13 +48,13 @@ NDArray (const Array& a, bool zero_based = false, bool negative_to_nan = false); - template + template NDArray (const MArray& a) : MArray (a) { } - template + template NDArray (const Array& a) : MArray (a) { } - template + template explicit NDArray (const intNDArray& a) : MArray (a) { } NDArray (const charNDArray&); diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/fCDiagMatrix.h --- a/liboctave/array/fCDiagMatrix.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/fCDiagMatrix.h Sun Jan 24 13:50:04 2016 -0500 @@ -67,7 +67,7 @@ FloatComplexDiagMatrix (const FloatComplexDiagMatrix& a) : MDiagArray2 (a) { } - template + template FloatComplexDiagMatrix (const DiagArray2& a) : MDiagArray2 (a) { } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/fCMatrix.h --- a/liboctave/array/fCMatrix.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/fCMatrix.h Sun Jan 24 13:50:04 2016 -0500 @@ -62,11 +62,11 @@ FloatComplexMatrix (const FloatComplexMatrix& a) : FloatComplexNDArray (a) { } - template + template FloatComplexMatrix (const MArray& a) : FloatComplexNDArray (a.as_matrix ()) { } - template + template FloatComplexMatrix (const Array& a) : FloatComplexNDArray (a.as_matrix ()) { } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/fCNDArray.h --- a/liboctave/array/fCNDArray.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/fCNDArray.h Sun Jan 24 13:50:04 2016 -0500 @@ -45,10 +45,10 @@ FloatComplexNDArray (const FloatComplexNDArray& a) : MArray (a) { } - template + template FloatComplexNDArray (const MArray& a) : MArray (a) { } - template + template FloatComplexNDArray (const Array& a) : MArray (a) { } FloatComplexNDArray (const charNDArray&); diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/fDiagMatrix.h --- a/liboctave/array/fDiagMatrix.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/fDiagMatrix.h Sun Jan 24 13:50:04 2016 -0500 @@ -52,7 +52,7 @@ FloatDiagMatrix (const MDiagArray2& a) : MDiagArray2 (a) { } - template + template FloatDiagMatrix (const DiagArray2& a) : MDiagArray2 (a) { } explicit FloatDiagMatrix (const Array& a) : MDiagArray2 (a) { } diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/fMatrix.h --- a/liboctave/array/fMatrix.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/fMatrix.h Sun Jan 24 13:50:04 2016 -0500 @@ -58,10 +58,10 @@ FloatMatrix (const FloatMatrix& a) : FloatNDArray (a) { } - template + template FloatMatrix (const MArray& a) : FloatNDArray (a.as_matrix ()) { } - template + template FloatMatrix (const Array& a) : FloatNDArray (a.as_matrix ()) { } explicit FloatMatrix (const FloatRowVector& rv); @@ -400,7 +400,7 @@ MARRAY_FORWARD_DEFS (MArray, FloatMatrix, float) -template +template void read_int (std::istream& is, bool swap_bytes, T& val); #endif diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/fNDArray.h --- a/liboctave/array/fNDArray.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/fNDArray.h Sun Jan 24 13:50:04 2016 -0500 @@ -45,13 +45,13 @@ FloatNDArray (const FloatNDArray& a) : MArray (a) { } - template + template FloatNDArray (const MArray& a) : MArray (a) { } - template + template FloatNDArray (const Array& a) : MArray (a) { } - template + template explicit FloatNDArray (const intNDArray& a) : MArray (a) { } FloatNDArray (const charNDArray&); diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/idx-vector.cc --- a/liboctave/array/idx-vector.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/idx-vector.cc Sun Jan 24 13:50:04 2016 -0500 @@ -231,7 +231,7 @@ return convert_index (static_cast (x), conv_error, ext); } -template +template inline octave_idx_type convert_index (octave_int x, bool& conv_error, octave_idx_type& ext) @@ -242,7 +242,7 @@ } -template +template idx_vector::idx_scalar_rep::idx_scalar_rep (T x) : data (0) { @@ -294,7 +294,7 @@ } -template +template idx_vector::idx_vector_rep::idx_vector_rep (const Array& nda) : data (0), len (nda.numel ()), ext (0), aowner (0), orig_dims (nda.dims ()) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/idx-vector.h --- a/liboctave/array/idx-vector.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/idx-vector.h Sun Jan 24 13:50:04 2016 -0500 @@ -36,8 +36,8 @@ #include "oct-inttypes.h" #include "oct-refcount.h" -template class Array; -template class Sparse; +template class Array; +template class Sparse; class Range; // Design rationale: @@ -63,7 +63,7 @@ class_mask }; - template friend class std::auto_ptr; + template friend class std::auto_ptr; private: @@ -228,7 +228,7 @@ // Zero-based constructor. idx_scalar_rep (octave_idx_type i); - template + template idx_scalar_rep (T x); octave_idx_type xelem (octave_idx_type) const { return data; } @@ -290,7 +290,7 @@ idx_vector_rep (const Array& inda, octave_idx_type _ext, direct); - template + template idx_vector_rep (const Array&); idx_vector_rep (bool); @@ -496,7 +496,7 @@ // Conversion constructors (used by interpreter). - template + template idx_vector (octave_int x) : rep (new idx_scalar_rep (x)) { chkerr (); } idx_vector (double x) : rep (new idx_scalar_rep (x)) { chkerr (); } @@ -506,7 +506,7 @@ // A scalar bool does not necessarily map to scalar index. idx_vector (bool x) : rep (new idx_mask_rep (x)) { chkerr (); } - template + template idx_vector (const Array >& nda) : rep (new idx_vector_rep (nda)) { chkerr (); } @@ -616,7 +616,7 @@ // dest[i] = src[idx(i)]; // return i; // - template + template octave_idx_type index (const T *src, octave_idx_type n, T *dest) const { @@ -690,7 +690,7 @@ // dest[idx(i)] = src[i]; // return i; // - template + template octave_idx_type assign (const T *src, octave_idx_type n, T *dest) const { @@ -762,7 +762,7 @@ // dest[idx(i)] = val; // return i; // - template + template octave_idx_type fill (const T& val, octave_idx_type n, T *dest) const { @@ -832,7 +832,7 @@ // // for (octave_idx_type i = 0; i < idx->length (n); i++) body (idx(i)); - template + template void loop (octave_idx_type n, Functor body) const { @@ -900,7 +900,7 @@ // return i; // - template + template octave_idx_type bloop (octave_idx_type n, Functor body) const { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/intNDArray.cc --- a/liboctave/array/intNDArray.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/intNDArray.cc Sun Jan 24 13:50:04 2016 -0500 @@ -33,7 +33,7 @@ // unary operations -template +template boolNDArray intNDArray::operator ! (void) const { @@ -45,7 +45,7 @@ return b; } -template +template bool intNDArray::any_element_not_one_or_zero (void) const { @@ -62,14 +62,14 @@ return false; } -template +template intNDArray intNDArray::diag (octave_idx_type k) const { return MArray::diag (k); } -template +template intNDArray intNDArray::diag (octave_idx_type m, octave_idx_type n) const { @@ -78,21 +78,21 @@ // FIXME: this is not quite the right thing. -template +template boolNDArray intNDArray::all (int dim) const { return do_mx_red_op (*this, dim, mx_inline_all); } -template +template boolNDArray intNDArray::any (int dim) const { return do_mx_red_op (*this, dim, mx_inline_any); } -template +template void intNDArray::increment_index (Array& ra_idx, const dim_vector& dimensions, @@ -101,7 +101,7 @@ ::increment_index (ra_idx, dimensions, start_dimension); } -template +template octave_idx_type intNDArray::compute_index (Array& ra_idx, const dim_vector& dimensions) @@ -109,7 +109,7 @@ return ::compute_index (ra_idx, dimensions); } -template +template intNDArray intNDArray::concat (const intNDArray& rb, const Array& ra_idx) @@ -119,7 +119,7 @@ return *this; } -template +template intNDArray& intNDArray::insert (const intNDArray& a, octave_idx_type r, octave_idx_type c) @@ -128,7 +128,7 @@ return *this; } -template +template intNDArray& intNDArray::insert (const intNDArray& a, const Array& ra_idx) @@ -139,7 +139,7 @@ // This contains no information on the array structure !!! -template +template std::ostream& operator << (std::ostream& os, const intNDArray& a) { @@ -151,7 +151,7 @@ return os; } -template +template std::istream& operator >> (std::istream& is, intNDArray& a) { @@ -179,7 +179,7 @@ // FIXME: should abs and signum just be mapper functions? -template +template intNDArray intNDArray::abs (void) const { @@ -195,7 +195,7 @@ return ret; } -template +template intNDArray intNDArray::signum (void) const { @@ -211,91 +211,91 @@ return ret; } -template +template intNDArray intNDArray::prod (int dim) const { return do_mx_red_op (*this, dim, mx_inline_prod); } -template +template intNDArray intNDArray::sum (int dim) const { return do_mx_red_op (*this, dim, mx_inline_sum); } -template +template NDArray intNDArray::dsum (int dim) const { return do_mx_red_op (*this, dim, mx_inline_dsum); } -template +template intNDArray intNDArray::cumsum (int dim) const { return do_mx_cum_op (*this, dim, mx_inline_cumsum); } -template +template intNDArray intNDArray::max (int dim) const { return do_mx_minmax_op (*this, dim, mx_inline_max); } -template +template intNDArray intNDArray::max (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_max); } -template +template intNDArray intNDArray::min (int dim) const { return do_mx_minmax_op (*this, dim, mx_inline_min); } -template +template intNDArray intNDArray::min (Array& idx_arg, int dim) const { return do_mx_minmax_op (*this, idx_arg, dim, mx_inline_min); } -template +template intNDArray intNDArray::cummax (int dim) const { return do_mx_cumminmax_op (*this, dim, mx_inline_cummax); } -template +template intNDArray intNDArray::cummax (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummax); } -template +template intNDArray intNDArray::cummin (int dim) const { return do_mx_cumminmax_op (*this, dim, mx_inline_cummin); } -template +template intNDArray intNDArray::cummin (Array& idx_arg, int dim) const { return do_mx_cumminmax_op (*this, idx_arg, dim, mx_inline_cummin); } -template +template intNDArray intNDArray::diff (octave_idx_type order, int dim) const { diff -r e2fca7d79169 -r 538b57866b90 liboctave/array/intNDArray.h --- a/liboctave/array/intNDArray.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/array/intNDArray.h Sun Jan 24 13:50:04 2016 -0500 @@ -27,7 +27,7 @@ #include "boolNDArray.h" class NDArray; -template +template class intNDArray : public MArray { @@ -44,13 +44,13 @@ intNDArray (const dim_vector& dv, T val) : MArray (dv, val) { } - template + template intNDArray (const Array& a) : MArray (a) { } - template + template intNDArray (const MArray& a) : MArray (a) { } - template + template intNDArray (const intNDArray& a) : MArray (a) { } intNDArray& operator = (const intNDArray& a) @@ -123,10 +123,10 @@ // i/o -template +template std::ostream& operator << (std::ostream& os, const intNDArray& a); -template +template std::istream& operator >> (std::istream& is, intNDArray& a); #endif diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/DET.h --- a/liboctave/numeric/DET.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/DET.h Sun Jan 24 13:50:04 2016 -0500 @@ -27,7 +27,7 @@ #include "oct-cmplx.h" #include "lo-mappers.h" -template +template class base_det { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/base-aepbal.h --- a/liboctave/numeric/base-aepbal.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/base-aepbal.h Sun Jan 24 13:50:04 2016 -0500 @@ -23,7 +23,7 @@ #if ! defined (octave_base_aepbal_h) #define octave_base_aepbal_h 1 -template +template class base_aepbal { protected: diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/base-lu.cc --- a/liboctave/numeric/base-lu.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/base-lu.cc Sun Jan 24 13:50:04 2016 -0500 @@ -27,7 +27,7 @@ #include "base-lu.h" -template +template base_lu::base_lu (const lu_type& l, const lu_type& u, const PermMatrix& p) : a_fact (u), l_fact (l), ipvt (p.transpose ().col_perm_vec ()) @@ -36,14 +36,14 @@ (*current_liboctave_error_handler) ("lu: dimension mismatch"); } -template +template bool base_lu :: packed (void) const { return l_fact.dims () == dim_vector (); } -template +template void base_lu :: unpack (void) { @@ -55,7 +55,7 @@ } } -template +template lu_type base_lu :: L (void) const { @@ -82,7 +82,7 @@ return l_fact; } -template +template lu_type base_lu :: U (void) const { @@ -106,7 +106,7 @@ return a_fact; } -template +template lu_type base_lu :: Y (void) const { @@ -117,7 +117,7 @@ return a_fact; } -template +template Array base_lu :: getp (void) const { @@ -148,14 +148,14 @@ return ipvt; } -template +template PermMatrix base_lu :: P (void) const { return PermMatrix (getp (), false); } -template +template ColumnVector base_lu :: P_vec (void) const { @@ -171,7 +171,7 @@ return p; } -template +template bool base_lu::regular (void) const { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/base-lu.h --- a/liboctave/numeric/base-lu.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/base-lu.h Sun Jan 24 13:50:04 2016 -0500 @@ -28,7 +28,7 @@ #include "dColVector.h" #include "PermMatrix.h" -template +template class base_lu { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/base-qr.cc --- a/liboctave/numeric/base-qr.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/base-qr.cc Sun Jan 24 13:50:04 2016 -0500 @@ -26,7 +26,7 @@ #include "base-qr.h" -template +template base_qr::base_qr (const qr_type& q_arg, const qr_type& r_arg) : q (q_arg), r (r_arg) { @@ -44,7 +44,7 @@ } } -template +template qr_type_t base_qr::get_type (void) const { @@ -60,7 +60,7 @@ return retval; } -template +template bool base_qr::regular (void) const { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/base-qr.h --- a/liboctave/numeric/base-qr.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/base-qr.h Sun Jan 24 13:50:04 2016 -0500 @@ -34,7 +34,7 @@ qr_type_economy }; -template +template class base_qr { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/bsxfun-defs.cc --- a/liboctave/numeric/bsxfun-defs.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/bsxfun-defs.cc Sun Jan 24 13:50:04 2016 -0500 @@ -33,7 +33,7 @@ #include "mx-inlines.cc" -template +template Array do_bsxfun_op (const Array& x, const Array& y, void (*op_vv) (size_t, R *, const X *, const Y *), @@ -134,7 +134,7 @@ return retval; } -template +template void do_inplace_bsxfun_op (Array& r, const Array& x, void (*op_vv) (size_t, R *, const X *), diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/eigs-base.cc --- a/liboctave/numeric/eigs-base.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/eigs-base.cc Sun Jan 24 13:50:04 2016 -0500 @@ -216,7 +216,7 @@ "an eigenvalue so convergence is not guaranteed"); } -template +template static octave_idx_type lusolve (const SM& L, const SM& U, M& m) { @@ -234,7 +234,7 @@ return err; } -template +template static M ltsolve (const SM& L, const ColumnVector& Q, const M& m) { @@ -261,7 +261,7 @@ return retval; } -template +template static M utsolve (const SM& U, const ColumnVector& Q, const M& m) { @@ -749,7 +749,7 @@ return true; } -template +template octave_idx_type EigsRealSymmetricMatrix (const M& m, const std::string typ, octave_idx_type k, octave_idx_type p, @@ -1019,7 +1019,7 @@ return ip(4); } -template +template octave_idx_type EigsRealSymmetricMatrixShift (const M& m, double sigma, octave_idx_type k, octave_idx_type p, @@ -1543,7 +1543,7 @@ return ip(4); } -template +template octave_idx_type EigsRealNonSymmetricMatrix (const M& m, const std::string typ, octave_idx_type k, octave_idx_type p, @@ -1861,7 +1861,7 @@ return ip(4); } -template +template octave_idx_type EigsRealNonSymmetricMatrixShift (const M& m, double sigmar, octave_idx_type k, octave_idx_type p, @@ -2488,7 +2488,7 @@ return ip(4); } -template +template octave_idx_type EigsComplexNonSymmetricMatrix (const M& m, const std::string typ, octave_idx_type k, octave_idx_type p, @@ -2760,7 +2760,7 @@ return ip(4); } -template +template octave_idx_type EigsComplexNonSymmetricMatrixShift (const M& m, Complex sigma, octave_idx_type k, octave_idx_type p, diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/lo-mappers.h --- a/liboctave/numeric/lo-mappers.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/lo-mappers.h Sun Jan 24 13:50:04 2016 -0500 @@ -75,13 +75,13 @@ extern OCTAVE_API bool octave_is_NA (double x); // Generic xmin, xmax definitions -template +template inline T xmin (T x, T y) { return x <= y ? x : y; } -template +template inline T xmax (T x, T y) { return x >= y ? x : y; diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/lo-specfun.cc --- a/liboctave/numeric/lo-specfun.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/lo-specfun.cc Sun Jan 24 13:50:04 2016 -0500 @@ -3692,7 +3692,7 @@ static const double pi = 3.14159265358979323846; -template +template static inline T xlog (const T& x) { @@ -3713,7 +3713,7 @@ return gnulib::logf (x); } -template +template static T Lanczos_approximation_psi (const T zc) { @@ -3739,7 +3739,7 @@ return p; } -template +template T psi (const T& z) { @@ -3795,7 +3795,7 @@ template double psi (const double& z); template float psi (const float& z); -template +template std::complex psi (const std::complex& z) { @@ -3845,12 +3845,12 @@ template FloatComplex psi (const FloatComplex& z); -template +template static inline void fortran_psifn (const T z, const octave_idx_type n, T* ans, octave_idx_type* ierr); -template<> +template <> inline void fortran_psifn (const double z, const octave_idx_type n, double* ans, octave_idx_type* ierr) @@ -3859,7 +3859,7 @@ F77_XFCN (dpsifn, DPSIFN, (&z, n, 1, 1, ans, &flag, ierr)); } -template<> +template <> inline void fortran_psifn (const float z, const octave_idx_type n, float* ans, octave_idx_type* ierr) @@ -3868,7 +3868,7 @@ F77_XFCN (psifn, PSIFN, (&z, n, 1, 1, ans, &flag, ierr)); } -template +template T psi (const octave_idx_type n, const T z) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/lo-specfun.h --- a/liboctave/numeric/lo-specfun.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/lo-specfun.h Sun Jan 24 13:50:04 2016 -0500 @@ -666,13 +666,13 @@ //! Digamma function. //! //! Only defined for double and float. -template +template extern OCTAVE_API T psi (const T& z); //! Digamma function for complex input. //! //! Only defined for double and float. -template +template extern OCTAVE_API std::complex psi (const std::complex& z); //! Polygamma function. @@ -680,7 +680,7 @@ //! Only defined for double and float. //! @param n must be non-negative. If zero, the digamma function is computed. //! @param z must be real and non-negative. -template +template extern OCTAVE_API T psi (const octave_idx_type n, const T z); #endif diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/oct-convn.cc --- a/liboctave/numeric/oct-convn.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/oct-convn.cc Sun Jan 24 13:50:04 2016 -0500 @@ -33,7 +33,7 @@ #include "oct-locbuf.h" // 2d convolution with a matrix kernel. -template +template static void convolve_2d (const T *a, octave_idx_type ma, octave_idx_type na, const R *b, octave_idx_type mb, octave_idx_type nb, @@ -73,7 +73,7 @@ FORWARD_IMPL (Complex, double, zd, ZD) FORWARD_IMPL (FloatComplex, float, cs, CS) -template +template void convolve_nd (const T *a, const dim_vector& ad, const dim_vector& acd, const R *b, const dim_vector& bd, const dim_vector& bcd, T *c, const dim_vector& ccd, int nd, bool inner) @@ -107,7 +107,7 @@ // Arbitrary convolutor. // The 2nd array is assumed to be the smaller one. -template +template static MArray convolve (const MArray& a, const MArray& b, convn_type ct) diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/oct-fftw.cc --- a/liboctave/numeric/oct-fftw.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/oct-fftw.cc Sun Jan 24 13:50:04 2016 -0500 @@ -738,7 +738,7 @@ return ret; } -template +template static inline void convert_packcomplex_1d (T *out, size_t nr, size_t nc, octave_idx_type stride, octave_idx_type dist) @@ -754,7 +754,7 @@ octave_quit (); } -template +template static inline void convert_packcomplex_Nd (T *out, const dim_vector &dv) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/oct-norm.cc --- a/liboctave/numeric/oct-norm.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/oct-norm.cc Sun Jan 24 13:50:04 2016 -0500 @@ -67,7 +67,7 @@ // the Matrix p-Norm." Numer. Math. 62, 539-555, 1992. // norm accumulator for the p-norm -template +template class norm_accumulator_p { R p,scl,sum; @@ -75,7 +75,7 @@ norm_accumulator_p () {} // we need this one for Array norm_accumulator_p (R pp) : p(pp), scl(0), sum(1) {} - template + template void accum (U val) { octave_quit (); @@ -95,7 +95,7 @@ }; // norm accumulator for the minus p-pseudonorm -template +template class norm_accumulator_mp { R p,scl,sum; @@ -103,7 +103,7 @@ norm_accumulator_mp () {} // we need this one for Array norm_accumulator_mp (R pp) : p(pp), scl(0), sum(1) {} - template + template void accum (U val) { octave_quit (); @@ -123,7 +123,7 @@ }; // norm accumulator for the 2-norm (euclidean) -template +template class norm_accumulator_2 { R scl,sum; @@ -156,13 +156,13 @@ }; // norm accumulator for the 1-norm (city metric) -template +template class norm_accumulator_1 { R sum; public: norm_accumulator_1 () : sum (0) {} - template + template void accum (U val) { sum += std::abs (val); @@ -171,13 +171,13 @@ }; // norm accumulator for the inf-norm (max metric) -template +template class norm_accumulator_inf { R max; public: norm_accumulator_inf () : max (0) {} - template + template void accum (U val) { max = std::max (max, std::abs (val)); @@ -186,13 +186,13 @@ }; // norm accumulator for the -inf pseudonorm (min abs value) -template +template class norm_accumulator_minf { R min; public: norm_accumulator_minf () : min (octave_Inf) {} - template + template void accum (U val) { min = std::min (min, std::abs (val)); @@ -201,13 +201,13 @@ }; // norm accumulator for the 0-pseudonorm (hamming distance) -template +template class norm_accumulator_0 { unsigned int num; public: norm_accumulator_0 () : num (0) {} - template + template void accum (U val) { if (val != static_cast (0)) ++num; @@ -218,7 +218,7 @@ // OK, we're armed :) Now let's go for the fun -template +template inline void vector_norm (const Array& v, R& res, ACC acc) { for (octave_idx_type i = 0; i < v.numel (); i++) @@ -228,7 +228,7 @@ } // dense versions -template +template void column_norms (const MArray& m, MArray& res, ACC acc) { res = MArray (dim_vector (1, m.columns ())); @@ -242,7 +242,7 @@ } } -template +template void row_norms (const MArray& m, MArray& res, ACC acc) { res = MArray (dim_vector (m.rows (), 1)); @@ -258,7 +258,7 @@ } // sparse versions -template +template void column_norms (const MSparse& m, MArray& res, ACC acc) { res = MArray (dim_vector (1, m.columns ())); @@ -272,7 +272,7 @@ } } -template +template void row_norms (const MSparse& m, MArray& res, ACC acc) { res = MArray (dim_vector (m.rows (), 1)); @@ -289,7 +289,7 @@ // now the dispatchers #define DEFINE_DISPATCHER(FUNC_NAME, ARG_TYPE, RES_TYPE) \ -template \ +template \ RES_TYPE FUNC_NAME (const ARG_TYPE& v, R p) \ { \ RES_TYPE res; \ @@ -322,7 +322,7 @@ // The approximate subproblem in Higham's method. Find lambda and mu such that // norm ([lambda, mu], p) == 1 and norm (y*lambda + col*mu, p) is maximized. // Real version. As in Higham's paper. -template +template static void higham_subp (const ColVectorT& y, const ColVectorT& col, octave_idx_type nsamp, R p, R& lambda, R& mu) @@ -350,7 +350,7 @@ // Complex version. Higham's paper does not deal with complex case, so we use a // simple extension. First, guess the magnitudes as in real version, then try // to rotate lambda to improve further. -template +template static void higham_subp (const ColVectorT& y, const ColVectorT& col, octave_idx_type nsamp, R p, @@ -395,7 +395,7 @@ } // the p-dual element (should work for both real and complex) -template +template inline T elem_dual_p (T x, R p) { return signum (x) * std::pow (std::abs (x), p-1); @@ -405,7 +405,7 @@ // a Matrix type to allow all the operations. For instance SparseMatrix // does not support multiplication with column/row vectors. // the dual vector -template +template VectorT dual_p (const VectorT& x, R p, R q) { VectorT res (x.dims ()); @@ -415,7 +415,7 @@ } // Higham's hybrid method -template +template R higham (const MatrixT& m, R p, R tol, int maxiter, VectorT& x) { @@ -475,7 +475,7 @@ static int max_norm_iter = 100; // version with SVD for dense matrices -template +template R matrix_norm (const MatrixT& m, R p, VectorT, SVDT) { R res = 0; @@ -501,7 +501,7 @@ } // SVD-free version for sparse matrices -template +template R matrix_norm (const MatrixT& m, R p, VectorT) { R res = 0; @@ -539,7 +539,7 @@ DEFINE_XNORM_FUNCS(FloatComplex, float) // this is needed to avoid copying the sparse matrix for xfrobnorm -template +template inline void array_norm_2 (const T* v, octave_idx_type n, R& res) { norm_accumulator_2 acc; diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/sparse-base-chol.cc --- a/liboctave/numeric/sparse-base-chol.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/sparse-base-chol.cc Sun Jan 24 13:50:04 2016 -0500 @@ -35,7 +35,7 @@ #ifdef HAVE_CHOLMOD // Can't use CHOLMOD_NAME(drop)(0.0, S, cm). It doesn't treat complex matrices -template +template void sparse_base_chol::sparse_base_chol_rep::drop_zeros (const cholmod_sparse* S) @@ -77,7 +77,7 @@ } #endif -template +template octave_idx_type sparse_base_chol::sparse_base_chol_rep::init (const chol_type& a, bool natural, bool force) @@ -218,7 +218,7 @@ #endif } -template +template chol_type sparse_base_chol::L (void) const { @@ -240,7 +240,7 @@ #endif } -template +template p_type sparse_base_chol:: sparse_base_chol_rep::Q (void) const @@ -263,7 +263,7 @@ #endif } -template +template chol_type sparse_base_chol::inverse (void) const { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/sparse-base-chol.h --- a/liboctave/numeric/sparse-base-chol.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/sparse-base-chol.h Sun Jan 24 13:50:04 2016 -0500 @@ -27,7 +27,7 @@ #include "oct-sparse.h" #include "dColVector.h" -template +template class sparse_base_chol { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/sparse-base-lu.cc --- a/liboctave/numeric/sparse-base-lu.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/sparse-base-lu.cc Sun Jan 24 13:50:04 2016 -0500 @@ -29,7 +29,7 @@ #include "PermMatrix.h" -template +template lu_type sparse_base_lu :: Y (void) const { @@ -64,7 +64,7 @@ return Yout; } -template +template p_type sparse_base_lu :: Pr (void) const { @@ -84,7 +84,7 @@ return Pout; } -template +template ColumnVector sparse_base_lu :: Pr_vec (void) const { @@ -99,14 +99,14 @@ return Pout; } -template +template PermMatrix sparse_base_lu :: Pr_mat (void) const { return PermMatrix (P, false); } -template +template p_type sparse_base_lu :: Pc (void) const { @@ -125,7 +125,7 @@ return Pout; } -template +template ColumnVector sparse_base_lu :: Pc_vec (void) const { @@ -140,7 +140,7 @@ return Pout; } -template +template PermMatrix sparse_base_lu :: Pc_mat (void) const { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/sparse-base-lu.h --- a/liboctave/numeric/sparse-base-lu.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/sparse-base-lu.h Sun Jan 24 13:50:04 2016 -0500 @@ -28,7 +28,7 @@ #include "MArray.h" #include "dSparse.h" -template +template class sparse_base_lu { diff -r e2fca7d79169 -r 538b57866b90 liboctave/numeric/sparse-dmsolve.cc --- a/liboctave/numeric/sparse-dmsolve.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/numeric/sparse-dmsolve.cc Sun Jan 24 13:50:04 2016 -0500 @@ -35,7 +35,7 @@ #include "oct-locbuf.h" #include "oct-inttypes.h" -template +template static MSparse dmsolve_extract (const MSparse &A, const octave_idx_type *Pinv, const octave_idx_type *Q, octave_idx_type rst, @@ -125,7 +125,7 @@ bool lazy); #endif -template +template static MArray dmsolve_extract (const MArray &m, const octave_idx_type *, const octave_idx_type *, octave_idx_type r1, @@ -163,7 +163,7 @@ octave_idx_type c2) #endif -template +template static void dmsolve_insert (MArray &a, const MArray &b, const octave_idx_type *Q, octave_idx_type r, octave_idx_type c) @@ -195,7 +195,7 @@ const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); #endif -template +template static void dmsolve_insert (MSparse &a, const MSparse &b, const octave_idx_type *Q, octave_idx_type r, octave_idx_type c) @@ -282,7 +282,7 @@ const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); #endif -template +template static void dmsolve_permute (MArray &a, const MArray& b, const octave_idx_type *p) { @@ -316,7 +316,7 @@ const octave_idx_type *p); #endif -template +template static void dmsolve_permute (MSparse &a, const MSparse& b, const octave_idx_type *p) { @@ -369,7 +369,7 @@ // an error for numerically rank defficient matrices } -template +template RT dmsolve (const ST &a, const T &b, octave_idx_type &info) { diff -r e2fca7d79169 -r 538b57866b90 liboctave/operators/mx-inlines.cc --- a/liboctave/operators/mx-inlines.cc Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/operators/mx-inlines.cc Sun Jan 24 13:50:04 2016 -0500 @@ -42,26 +42,26 @@ // Provides some commonly repeated, basic loop templates. -template +template inline void mx_inline_fill (size_t n, R *r, S s) throw () { for (size_t i = 0; i < n; i++) r[i] = s; } #define DEFMXUNOP(F, OP) \ -template \ +template \ inline void F (size_t n, R *r, const X *x) throw () \ { for (size_t i = 0; i < n; i++) r[i] = OP x[i]; } DEFMXUNOP (mx_inline_uminus, -) #define DEFMXUNOPEQ(F, OP) \ -template \ +template \ inline void F (size_t n, R *r) throw () \ { for (size_t i = 0; i < n; i++) r[i] = OP r[i]; } DEFMXUNOPEQ (mx_inline_uminus2, -) #define DEFMXUNBOOLOP(F, OP) \ -template \ +template \ inline void F (size_t n, bool *r, const X *x) throw () \ { const X zero = X (); for (size_t i = 0; i < n; i++) r[i] = x[i] OP zero; } @@ -69,13 +69,13 @@ DEFMXUNBOOLOP (mx_inline_notzero, !=) #define DEFMXBINOP(F, OP) \ -template \ +template \ inline void F (size_t n, R *r, const X *x, const Y *y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = x[i] OP y[i]; } \ -template \ +template \ inline void F (size_t n, R *r, const X *x, Y y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = x[i] OP y; } \ -template \ +template \ inline void F (size_t n, R *r, X x, const Y *y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = x OP y[i]; } @@ -85,10 +85,10 @@ DEFMXBINOP (mx_inline_div, /) #define DEFMXBINOPEQ(F, OP) \ -template \ +template \ inline void F (size_t n, R *r, const X *x) throw () \ { for (size_t i = 0; i < n; i++) r[i] OP x[i]; } \ -template \ +template \ inline void F (size_t n, R *r, X x) throw () \ { for (size_t i = 0; i < n; i++) r[i] OP x; } @@ -98,13 +98,13 @@ DEFMXBINOPEQ (mx_inline_div2, /=) #define DEFMXCMPOP(F, OP) \ -template \ +template \ inline void F (size_t n, bool *r, const X *x, const Y *y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = x[i] OP y[i]; } \ -template \ +template \ inline void F (size_t n, bool *r, const X *x, Y y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = x[i] OP y; } \ -template \ +template \ inline void F (size_t n, bool *r, X x, const Y *y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = x OP y[i]; } @@ -116,13 +116,13 @@ DEFMXCMPOP (mx_inline_ne, !=) // Convert to logical value, for logical op purposes. -template inline bool logical_value (T x) { return x; } -template inline bool logical_value (const std::complex& x) +template inline bool logical_value (T x) { return x; } +template inline bool logical_value (const std::complex& x) { return x.real () != 0 || x.imag () != 0; } -template inline bool logical_value (const octave_int& x) +template inline bool logical_value (const octave_int& x) { return x.value (); } -template +template void mx_inline_not (size_t n, bool *r, const X* x) throw () { for (size_t i = 0; i < n; i++) @@ -135,20 +135,20 @@ } #define DEFMXBOOLOP(F, NOT1, OP, NOT2) \ -template \ +template \ inline void F (size_t n, bool *r, const X *x, const Y *y) throw () \ { \ for (size_t i = 0; i < n; i++) \ r[i] = (NOT1 logical_value (x[i])) OP (NOT2 logical_value (y[i])); \ } \ -template \ +template \ inline void F (size_t n, bool *r, const X *x, Y y) throw () \ { \ const bool yy = (NOT2 logical_value (y)); \ for (size_t i = 0; i < n; i++) \ r[i] = (NOT1 logical_value (x[i])) OP yy; \ } \ -template \ +template \ inline void F (size_t n, bool *r, X x, const Y *y) throw () \ { \ const bool xx = (NOT1 logical_value (x)); \ @@ -164,20 +164,20 @@ DEFMXBOOLOP (mx_inline_or_not, , |, !) #define DEFMXBOOLOPEQ(F, OP) \ -template \ +template \ inline void F (size_t n, bool *r, const X *x) throw () \ { \ for (size_t i = 0; i < n; i++) \ r[i] OP logical_value (x[i]); \ } \ -template \ +template \ inline void F (size_t n, bool *r, X x) throw () \ { for (size_t i = 0; i < n; i++) r[i] OP x; } DEFMXBOOLOPEQ (mx_inline_and2, &=) DEFMXBOOLOPEQ (mx_inline_or2, |=) -template +template inline bool mx_inline_any_nan (size_t n, const T* x) throw () { @@ -190,7 +190,7 @@ return false; } -template +template inline bool mx_inline_all_finite (size_t n, const T* x) throw () { @@ -203,7 +203,7 @@ return true; } -template +template inline bool mx_inline_any_negative (size_t n, const T* x) throw () { @@ -216,7 +216,7 @@ return false; } -template +template inline bool mx_inline_any_positive (size_t n, const T* x) throw () { @@ -229,7 +229,7 @@ return false; } -template +template inline bool mx_inline_all_real (size_t n, const std::complex* x) throw () { @@ -243,26 +243,26 @@ } #define DEFMXMAPPER(F, FUN) \ -template \ +template \ inline void F (size_t n, T *r, const T *x) throw () \ { for (size_t i = 0; i < n; i++) r[i] = FUN (x[i]); } -template +template inline void mx_inline_real (size_t n, T *r, const std::complex* x) throw () { for (size_t i = 0; i < n; i++) r[i] = x[i].real (); } -template +template inline void mx_inline_imag (size_t n, T *r, const std::complex* x) throw () { for (size_t i = 0; i < n; i++) r[i] = x[i].imag (); } // Pairwise minimums/maximums #define DEFMXMAPPER2(F, FUN) \ -template \ +template \ inline void F (size_t n, T *r, const T *x, const T *y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = FUN (x[i], y[i]); } \ -template \ +template \ inline void F (size_t n, T *r, const T *x, T y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = FUN (x[i], y); } \ -template \ +template \ inline void F (size_t n, T *r, T x, const T *y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = FUN (x, y[i]); } @@ -295,13 +295,13 @@ // Pairwise power #define DEFMXMAPPER2X(F, FUN) \ -template \ +template \ inline void F (size_t n, R *r, const X *x, const Y *y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = FUN (x[i], y[i]); } \ -template \ +template \ inline void F (size_t n, R *r, const X *x, Y y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = FUN (x[i], y); } \ -template \ +template \ inline void F (size_t n, R *r, X x, const Y *y) throw () \ { for (size_t i = 0; i < n; i++) r[i] = FUN (x, y[i]); } @@ -312,18 +312,18 @@ // Arbitrary function appliers. The function is a template parameter to enable // inlining. -template +template inline void mx_inline_map (size_t n, R *r, const X *x) throw () { for (size_t i = 0; i < n; i++) r[i] = fun (x[i]); } -template +template inline void mx_inline_map (size_t n, R *r, const X *x) throw () { for (size_t i = 0; i < n; i++) r[i] = fun (x[i]); } // Appliers. Since these call the operation just once, we pass it as // a pointer, to allow the compiler reduce number of instances. -template +template inline Array do_mx_unary_op (const Array& x, void (*op) (size_t, R *, const X *) throw ()) @@ -335,21 +335,21 @@ // Shortcuts for applying mx_inline_map. -template +template inline Array do_mx_unary_map (const Array& x) { return do_mx_unary_op (x, mx_inline_map); } -template +template inline Array do_mx_unary_map (const Array& x) { return do_mx_unary_op (x, mx_inline_map); } -template +template inline Array& do_mx_inplace_op (Array& r, void (*op) (size_t, R *) throw ()) @@ -358,7 +358,7 @@ return r; } -template +template inline Array do_mm_binary_op (const Array& x, const Array& y, void (*op) (size_t, R *, const X *, const Y *) throw (), @@ -382,7 +382,7 @@ err_nonconformant (opname, dx, dy); } -template +template inline Array do_ms_binary_op (const Array& x, const Y& y, void (*op) (size_t, R *, const X *, Y) throw ()) @@ -392,7 +392,7 @@ return r; } -template +template inline Array do_sm_binary_op (const X& x, const Array& y, void (*op) (size_t, R *, X, const Y *) throw ()) @@ -402,7 +402,7 @@ return r; } -template +template inline Array& do_mm_inplace_op (Array& r, const Array& x, void (*op) (size_t, R *, const X *) throw (), @@ -421,7 +421,7 @@ return r; } -template +template inline Array& do_ms_inplace_op (Array& r, const X& x, void (*op) (size_t, R *, X) throw ()) @@ -430,7 +430,7 @@ return r; } -template +template inline bool mx_inline_equal (size_t n, const T1 *x, const T2 *y) throw () { @@ -440,7 +440,7 @@ return true; } -template +template inline bool do_mx_check (const Array& a, bool (*op) (size_t, const T *) throw ()) @@ -450,19 +450,19 @@ // NOTE: we don't use std::norm because it typically does some heavyweight // magic to avoid underflows, which we don't need here. -template +template inline T cabsq (const std::complex& c) { return c.real () * c.real () + c.imag () * c.imag (); } // default. works for integers and bool. -template +template inline bool xis_true (T x) { return x; } -template +template inline bool xis_false (T x) { return ! x; } // for octave_ints -template +template inline bool xis_true (const octave_int& x) { return x.value (); } -template +template inline bool xis_false (const octave_int& x) { return ! x.value (); } // for reals, we want to ignore NaNs. inline bool xis_true (double x) { return ! xisnan (x) && x != 0.0; } @@ -484,7 +484,7 @@ { ac *= el; } inline void op_dble_prod (Complex& ac, const FloatComplex& el) { ac *= el; } // FIXME: guaranteed? -template +template inline void op_dble_prod (double& ac, const octave_int& el) { ac *= el.double_value (); } @@ -492,7 +492,7 @@ { ac += el; } inline void op_dble_sum (Complex& ac, const FloatComplex& el) { ac += el; } // FIXME: guaranteed? -template +template inline void op_dble_sum (double& ac, const octave_int& el) { ac += el.double_value (); } @@ -501,7 +501,7 @@ #define OP_RED_ALLC(ac, el) if (xis_false (el)) { ac = false; break; } else continue #define OP_RED_FCN(F, TSRC, TRES, OP, ZERO) \ -template \ +template \ inline TRES \ F (const TSRC* v, octave_idx_type n) \ { \ @@ -525,7 +525,7 @@ #define OP_RED_FCN2(F, TSRC, TRES, OP, ZERO) \ -template \ +template \ inline void \ F (const TSRC* v, TRES *r, octave_idx_type m, octave_idx_type n) \ { \ @@ -558,7 +558,7 @@ // will achieve both, at the cost of a temporary octave_idx_type array. #define OP_ROW_SHORT_CIRCUIT(F, PRED, ZERO) \ -template \ +template \ inline void \ F (const T* v, bool *r, octave_idx_type m, octave_idx_type n) \ { \ @@ -589,7 +589,7 @@ OP_ROW_SHORT_CIRCUIT (mx_inline_all, xis_false, true) #define OP_RED_FCNN(F, TSRC, TRES) \ -template \ +template \ inline void \ F (const TSRC *v, TRES *r, octave_idx_type l, \ octave_idx_type n, octave_idx_type u) \ @@ -624,7 +624,7 @@ OP_RED_FCNN (mx_inline_all, T, bool) #define OP_CUM_FCN(F, TSRC, TRES, OP) \ -template \ +template \ inline void \ F (const TSRC *v, TRES *r, octave_idx_type n) \ { \ @@ -641,7 +641,7 @@ OP_CUM_FCN (mx_inline_cumcount, bool, T, +) #define OP_CUM_FCN2(F, TSRC, TRES, OP) \ -template \ +template \ inline void \ F (const TSRC *v, TRES *r, octave_idx_type m, octave_idx_type n) \ { \ @@ -665,7 +665,7 @@ OP_CUM_FCN2 (mx_inline_cumcount, bool, T, +) #define OP_CUM_FCNN(F, TSRC, TRES) \ -template \ +template \ inline void \ F (const TSRC *v, TRES *r, octave_idx_type l, \ octave_idx_type n, octave_idx_type u) \ @@ -694,7 +694,7 @@ OP_CUM_FCNN (mx_inline_cumcount, bool, T) #define OP_MINMAX_FCN(F, OP) \ -template \ +template \ void F (const T *v, T *r, octave_idx_type n) \ { \ if (! n) return; \ @@ -709,7 +709,7 @@ if (v[i] OP tmp) tmp = v[i]; \ *r = tmp; \ } \ -template \ +template \ void F (const T *v, T *r, octave_idx_type *ri, octave_idx_type n) \ { \ if (! n) return; \ @@ -735,7 +735,7 @@ // proceed to a faster code. #define OP_MINMAX_FCN2(F, OP) \ -template \ +template \ inline void \ F (const T *v, T *r, octave_idx_type m, octave_idx_type n) \ { \ @@ -767,7 +767,7 @@ j++; v += m; \ } \ } \ -template \ +template \ inline void \ F (const T *v, T *r, octave_idx_type *ri, \ octave_idx_type m, octave_idx_type n) \ @@ -806,7 +806,7 @@ OP_MINMAX_FCN2 (mx_inline_max, >) #define OP_MINMAX_FCNN(F) \ -template \ +template \ inline void \ F (const T *v, T *r, octave_idx_type l, \ octave_idx_type n, octave_idx_type u) \ @@ -830,7 +830,7 @@ } \ } \ } \ -template \ +template \ inline void \ F (const T *v, T *r, octave_idx_type *ri, \ octave_idx_type l, octave_idx_type n, octave_idx_type u) \ @@ -859,7 +859,7 @@ OP_MINMAX_FCNN (mx_inline_max) #define OP_CUMMINMAX_FCN(F, OP) \ -template \ +template \ void F (const T *v, T *r, octave_idx_type n) \ { \ if (! n) return; \ @@ -880,7 +880,7 @@ } \ for (; j < i; j++) r[j] = tmp; \ } \ -template \ +template \ void F (const T *v, T *r, octave_idx_type *ri, octave_idx_type n) \ { \ if (! n) return; \ @@ -910,7 +910,7 @@ // proceed to a faster code. #define OP_CUMMINMAX_FCN2(F, OP) \ -template \ +template \ inline void \ F (const T *v, T *r, octave_idx_type m, octave_idx_type n) \ { \ @@ -948,7 +948,7 @@ j++; v += m; r0 = r; r += m; \ } \ } \ -template \ +template \ inline void \ F (const T *v, T *r, octave_idx_type *ri, \ octave_idx_type m, octave_idx_type n) \ @@ -992,7 +992,7 @@ OP_CUMMINMAX_FCN2 (mx_inline_cummax, >) #define OP_CUMMINMAX_FCNN(F) \ -template \ +template \ inline void \ F (const T *v, T *r, octave_idx_type l, \ octave_idx_type n, octave_idx_type u) \ @@ -1016,7 +1016,7 @@ } \ } \ } \ -template \ +template \ inline void \ F (const T *v, T *r, octave_idx_type *ri, \ octave_idx_type l, octave_idx_type n, octave_idx_type u) \ @@ -1044,7 +1044,7 @@ OP_CUMMINMAX_FCNN (mx_inline_cummin) OP_CUMMINMAX_FCNN (mx_inline_cummax) -template +template void mx_inline_diff (const T *v, T *r, octave_idx_type n, octave_idx_type order) { @@ -1085,7 +1085,7 @@ } } -template +template void mx_inline_diff (const T *v, T *r, octave_idx_type m, octave_idx_type n, octave_idx_type order) @@ -1125,7 +1125,7 @@ } } -template +template inline void mx_inline_diff (const T *v, T *r, octave_idx_type l, octave_idx_type n, octave_idx_type u, @@ -1183,7 +1183,7 @@ // FIXME: is this the best design? C++ gives a lot of options here... // maybe it can be done without an explicit parameter? -template +template inline Array do_mx_red_op (const Array& src, int dim, void (*mx_red_op) (const T *, R *, octave_idx_type, @@ -1207,7 +1207,7 @@ return ret; } -template +template inline Array do_mx_cum_op (const Array& src, int dim, void (*mx_cum_op) (const T *, R *, octave_idx_type, @@ -1224,7 +1224,7 @@ return ret; } -template +template inline Array do_mx_minmax_op (const Array& src, int dim, void (*mx_minmax_op) (const R *, R *, octave_idx_type, @@ -1244,7 +1244,7 @@ return ret; } -template +template inline Array do_mx_minmax_op (const Array& src, Array& idx, int dim, void (*mx_minmax_op) (const R *, R *, octave_idx_type *, @@ -1267,7 +1267,7 @@ return ret; } -template +template inline Array do_mx_cumminmax_op (const Array& src, int dim, void (*mx_cumminmax_op) (const R *, R *, octave_idx_type, @@ -1283,7 +1283,7 @@ return ret; } -template +template inline Array do_mx_cumminmax_op (const Array& src, Array& idx, int dim, void (*mx_cumminmax_op) (const R *, R *, octave_idx_type *, @@ -1302,7 +1302,7 @@ return ret; } -template +template inline Array do_mx_diff_op (const Array& src, int dim, octave_idx_type order, void (*mx_diff_op) (const R *, R *, @@ -1340,7 +1340,7 @@ // Accurate Sum And Dot Product, // SIAM J. Sci. Computing, Vol. 26, 2005 -template +template inline void twosum_accum (T& s, T& e, const T& x) { @@ -1351,7 +1351,7 @@ e += e1; } -template +template inline T mx_inline_xsum (const T *v, octave_idx_type n) { @@ -1363,7 +1363,7 @@ return s + e; } -template +template inline void mx_inline_xsum (const T *v, T *r, octave_idx_type m, octave_idx_type n) diff -r e2fca7d79169 -r 538b57866b90 liboctave/util/action-container.h --- a/liboctave/util/action-container.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/util/action-container.h Sun Jan 24 13:50:04 2016 -0500 @@ -74,7 +74,7 @@ // An element that stores a variable of type T along with a void (*) (T) // function pointer, and calls the function with the parameter. - template + template class fcn_arg_elem : public elem { public: @@ -99,7 +99,7 @@ // void (*) (const T&) function pointer, and calls the function with // the parameter. - template + template class fcn_crefarg_elem : public elem { public: @@ -115,7 +115,7 @@ // An element for calling a member function. - template + template class method_elem : public elem { public: @@ -138,7 +138,7 @@ // An element for calling a member function with a single argument - template + template class method_arg_elem : public elem { public: @@ -162,7 +162,7 @@ // An element for calling a member function with a single argument - template + template class method_crefarg_elem : public elem { public: @@ -186,7 +186,7 @@ // An element that stores arbitrary variable, and restores it. - template + template class restore_var_elem : public elem { public: @@ -208,7 +208,7 @@ // Deletes a class allocated using new. - template + template class delete_ptr_elem : public elem { public: @@ -241,35 +241,35 @@ } // Call to void func (T). - template + template void add_fcn (void (*action) (T), T val) { add (new fcn_arg_elem (action, val)); } // Call to void func (const T&). - template + template void add_fcn (void (*action) (const T&), const T& val) { add (new fcn_crefarg_elem (action, val)); } // Call to T::method (void). - template + template void add_method (T *obj, void (T::*method) (void)) { add (new method_elem (obj, method)); } // Call to T::method (A). - template + template void add_method (T *obj, void (T::*method) (A), A arg) { add (new method_arg_elem (obj, method, arg)); } // Call to T::method (const A&). - template + template void add_method (T *obj, void (T::*method) (const A&), const A& arg) { add (new method_crefarg_elem (obj, method, arg)); @@ -277,21 +277,21 @@ // Call to delete (T*). - template + template void add_delete (T *obj) { add (new delete_ptr_elem (obj)); } // Protect any variable. - template + template void protect_var (T& var) { add (new restore_var_elem (var, var)); } // Protect any variable, value given. - template + template void protect_var (T& var, const T& val) { add (new restore_var_elem (var, val)); diff -r e2fca7d79169 -r 538b57866b90 liboctave/util/base-list.h --- a/liboctave/util/base-list.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/util/base-list.h Sun Jan 24 13:50:04 2016 -0500 @@ -46,7 +46,7 @@ iterator erase (iterator pos) { return lst.erase (pos); } - template + template void remove_if (P pred) { lst.remove_if (pred); diff -r e2fca7d79169 -r 538b57866b90 liboctave/util/lo-traits.h --- a/liboctave/util/lo-traits.h Sun Jan 24 10:11:43 2016 -0800 +++ b/liboctave/util/lo-traits.h Sun Jan 24 13:50:04 2016 -0500 @@ -32,7 +32,7 @@ template class if_then_else; -template +template class if_then_else { public: @@ -40,7 +40,7 @@ typedef T1 result; }; -template +template class if_then_else { public: @@ -49,7 +49,7 @@ }; // Determine whether two types are equal. -template +template class equal_types { public: @@ -57,7 +57,7 @@ static const bool value = false; }; -template +template class equal_types { public: @@ -67,7 +67,7 @@ // Determine whether a type is an instance of a template. -template