comparison libinterp/corefcn/data.cc @ 21139:538b57866b90

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.
author John W. Eaton <jwe@octave.org>
date Sun, 24 Jan 2016 13:50:04 -0500
parents 228b65504557
children fcac5dbbf9ed
comparison
equal deleted inserted replaced
21138:e2fca7d79169 21139:538b57866b90
459 %! assert (nnz (y), 1); 459 %! assert (nnz (y), 1);
460 %! assert (y, sparse ([0 1])); 460 %! assert (y, sparse ([0 1]));
461 461
462 */ 462 */
463 463
464 template<typename T, typename ET> 464 template <typename T, typename ET>
465 void 465 void
466 map_2_xlog2 (const Array<T>& x, Array<T>& f, Array<ET>& e) 466 map_2_xlog2 (const Array<T>& x, Array<T>& f, Array<ET>& e)
467 { 467 {
468 f = Array<T>(x.dims ()); 468 f = Array<T>(x.dims ());
469 e = Array<ET>(x.dims ()); 469 e = Array<ET>(x.dims ());
1680 return false; 1680 return false;
1681 1681
1682 return true; 1682 return true;
1683 } 1683 }
1684 1684
1685 template <class TYPE, class T> 1685 template <typename TYPE, typename T>
1686 static void 1686 static void
1687 single_type_concat (Array<T>& result, 1687 single_type_concat (Array<T>& result,
1688 const octave_value_list& args, 1688 const octave_value_list& args,
1689 int dim) 1689 int dim)
1690 { 1690 {
1723 1723
1724 result = Array<T>::cat (dim, n_args, array_list); 1724 result = Array<T>::cat (dim, n_args, array_list);
1725 } 1725 }
1726 } 1726 }
1727 1727
1728 template <class TYPE, class T> 1728 template <typename TYPE, typename T>
1729 static void 1729 static void
1730 single_type_concat (Sparse<T>& result, 1730 single_type_concat (Sparse<T>& result,
1731 const octave_value_list& args, 1731 const octave_value_list& args,
1732 int dim) 1732 int dim)
1733 { 1733 {
1743 1743
1744 result = Sparse<T>::cat (dim, n_args, sparse_list); 1744 result = Sparse<T>::cat (dim, n_args, sparse_list);
1745 } 1745 }
1746 1746
1747 // Dispatcher. 1747 // Dispatcher.
1748 template<class TYPE> 1748 template <typename TYPE>
1749 static TYPE 1749 static TYPE
1750 do_single_type_concat (const octave_value_list& args, int dim) 1750 do_single_type_concat (const octave_value_list& args, int dim)
1751 { 1751 {
1752 TYPE result; 1752 TYPE result;
1753 1753
1754 single_type_concat<TYPE, typename TYPE::element_type> (result, args, dim); 1754 single_type_concat<TYPE, typename TYPE::element_type> (result, args, dim);
1755 1755
1756 return result; 1756 return result;
1757 } 1757 }
1758 1758
1759 template<class MAP> 1759 template <typename MAP>
1760 static void 1760 static void
1761 single_type_concat_map (octave_map& result, 1761 single_type_concat_map (octave_map& result,
1762 const octave_value_list& args, 1762 const octave_value_list& args,
1763 int dim) 1763 int dim)
1764 { 1764 {
4809 @end deftypefn") 4809 @end deftypefn")
4810 { 4810 {
4811 return fill_matrix (args, true, "true"); 4811 return fill_matrix (args, true, "true");
4812 } 4812 }
4813 4813
4814 template <class MT> 4814 template <typename MT>
4815 octave_value 4815 octave_value
4816 identity_matrix (int nr, int nc) 4816 identity_matrix (int nr, int nc)
4817 { 4817 {
4818 octave_value retval; 4818 octave_value retval;
4819 4819
5023 %!assert (eye (2, 3, "int8"), int8 ([1, 0, 0; 0, 1, 0])) 5023 %!assert (eye (2, 3, "int8"), int8 ([1, 0, 0; 0, 1, 0]))
5024 5024
5025 %!error eye (1, 2, 3) 5025 %!error eye (1, 2, 3)
5026 */ 5026 */
5027 5027
5028 template <class MT> 5028 template <typename MT>
5029 static octave_value 5029 static octave_value
5030 do_linspace (const octave_value& base, const octave_value& limit, 5030 do_linspace (const octave_value& base, const octave_value& limit,
5031 octave_idx_type n) 5031 octave_idx_type n)
5032 { 5032 {
5033 typedef typename MT::column_vector_type CVT; 5033 typedef typename MT::column_vector_type CVT;
6927 } 6927 }
6928 6928
6929 return retval; 6929 return retval;
6930 } 6930 }
6931 6931
6932 template <class NDT> 6932 template <typename NDT>
6933 static NDT 6933 static NDT
6934 do_accumarray_sum (const idx_vector& idx, const NDT& vals, 6934 do_accumarray_sum (const idx_vector& idx, const NDT& vals,
6935 octave_idx_type n = -1) 6935 octave_idx_type n = -1)
6936 { 6936 {
6937 typedef typename NDT::element_type T; 6937 typedef typename NDT::element_type T;
7012 } 7012 }
7013 7013
7014 return retval; 7014 return retval;
7015 } 7015 }
7016 7016
7017 template <class NDT> 7017 template <typename NDT>
7018 static NDT 7018 static NDT
7019 do_accumarray_minmax (const idx_vector& idx, const NDT& vals, 7019 do_accumarray_minmax (const idx_vector& idx, const NDT& vals,
7020 octave_idx_type n, bool ismin, 7020 octave_idx_type n, bool ismin,
7021 const typename NDT::element_type& zero_val) 7021 const typename NDT::element_type& zero_val)
7022 { 7022 {
7142 @end deftypefn") 7142 @end deftypefn")
7143 { 7143 {
7144 return do_accumarray_minmax_fun (args, false); 7144 return do_accumarray_minmax_fun (args, false);
7145 } 7145 }
7146 7146
7147 template <class NDT> 7147 template <typename NDT>
7148 static NDT 7148 static NDT
7149 do_accumdim_sum (const idx_vector& idx, const NDT& vals, 7149 do_accumdim_sum (const idx_vector& idx, const NDT& vals,
7150 int dim = -1, octave_idx_type n = -1) 7150 int dim = -1, octave_idx_type n = -1)
7151 { 7151 {
7152 typedef typename NDT::element_type T; 7152 typedef typename NDT::element_type T;
7232 } 7232 }
7233 7233
7234 return retval; 7234 return retval;
7235 } 7235 }
7236 7236
7237 template <class NDT> 7237 template <typename NDT>
7238 static NDT 7238 static NDT
7239 do_merge (const Array<bool>& mask, 7239 do_merge (const Array<bool>& mask,
7240 const NDT& tval, const NDT& fval) 7240 const NDT& tval, const NDT& fval)
7241 { 7241 {
7242 typedef typename NDT::element_type T; 7242 typedef typename NDT::element_type T;
7403 7403
7404 DEFALIAS (ifelse, merge); 7404 DEFALIAS (ifelse, merge);
7405 7405
7406 #undef MAKE_INT_BRANCH 7406 #undef MAKE_INT_BRANCH
7407 7407
7408 template <class SparseT> 7408 template <typename SparseT>
7409 static SparseT 7409 static SparseT
7410 do_sparse_diff (const SparseT& array, octave_idx_type order, 7410 do_sparse_diff (const SparseT& array, octave_idx_type order,
7411 int dim) 7411 int dim)
7412 { 7412 {
7413 SparseT retval = array; 7413 SparseT retval = array;
7604 %!error diff (1, 2, 3, 4) 7604 %!error diff (1, 2, 3, 4)
7605 %!error diff ("foo") 7605 %!error diff ("foo")
7606 %!error diff ([1, 2; 3, 4], -1) 7606 %!error diff ([1, 2; 3, 4], -1)
7607 */ 7607 */
7608 7608
7609 template <class T> 7609 template <typename T>
7610 static Array<T> 7610 static Array<T>
7611 do_repelems (const Array<T>& src, const Array<octave_idx_type>& rep) 7611 do_repelems (const Array<T>& src, const Array<octave_idx_type>& rep)
7612 { 7612 {
7613 Array<T> retval; 7613 Array<T> retval;
7614 7614