Mercurial > jwe > octave
comparison libinterp/corefcn/tril.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 | 63374982750b |
children | fcac5dbbf9ed |
comparison
equal
deleted
inserted
replaced
21138:e2fca7d79169 | 21139:538b57866b90 |
---|---|
36 #include "defun.h" | 36 #include "defun.h" |
37 #include "error.h" | 37 #include "error.h" |
38 #include "ovl.h" | 38 #include "ovl.h" |
39 | 39 |
40 // The bulk of the work. | 40 // The bulk of the work. |
41 template <class T> | 41 template <typename T> |
42 static Array<T> | 42 static Array<T> |
43 do_tril (const Array<T>& a, octave_idx_type k, bool pack) | 43 do_tril (const Array<T>& a, octave_idx_type k, bool pack) |
44 { | 44 { |
45 octave_idx_type nr = a.rows (); | 45 octave_idx_type nr = a.rows (); |
46 octave_idx_type nc = a.columns (); | 46 octave_idx_type nc = a.columns (); |
78 | 78 |
79 return r; | 79 return r; |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 template <class T> | 83 template <typename T> |
84 static Array<T> | 84 static Array<T> |
85 do_triu (const Array<T>& a, octave_idx_type k, bool pack) | 85 do_triu (const Array<T>& a, octave_idx_type k, bool pack) |
86 { | 86 { |
87 octave_idx_type nr = a.rows (); | 87 octave_idx_type nr = a.rows (); |
88 octave_idx_type nc = a.columns (); | 88 octave_idx_type nc = a.columns (); |
124 } | 124 } |
125 | 125 |
126 // These two are by David Bateman. | 126 // These two are by David Bateman. |
127 // FIXME: optimizations possible. "pack" support missing. | 127 // FIXME: optimizations possible. "pack" support missing. |
128 | 128 |
129 template <class T> | 129 template <typename T> |
130 static Sparse<T> | 130 static Sparse<T> |
131 do_tril (const Sparse<T>& a, octave_idx_type k, bool pack) | 131 do_tril (const Sparse<T>& a, octave_idx_type k, bool pack) |
132 { | 132 { |
133 if (pack) // FIXME | 133 if (pack) // FIXME |
134 error ("tril: \"pack\" not implemented for sparse matrices"); | 134 error ("tril: \"pack\" not implemented for sparse matrices"); |
144 m.maybe_compress (true); | 144 m.maybe_compress (true); |
145 | 145 |
146 return m; | 146 return m; |
147 } | 147 } |
148 | 148 |
149 template <class T> | 149 template <typename T> |
150 static Sparse<T> | 150 static Sparse<T> |
151 do_triu (const Sparse<T>& a, octave_idx_type k, bool pack) | 151 do_triu (const Sparse<T>& a, octave_idx_type k, bool pack) |
152 { | 152 { |
153 if (pack) // FIXME | 153 if (pack) // FIXME |
154 error ("triu: \"pack\" not implemented for sparse matrices"); | 154 error ("triu: \"pack\" not implemented for sparse matrices"); |
164 m.maybe_compress (true); | 164 m.maybe_compress (true); |
165 return m; | 165 return m; |
166 } | 166 } |
167 | 167 |
168 // Convenience dispatchers. | 168 // Convenience dispatchers. |
169 template <class T> | 169 template <typename T> |
170 static Array<T> | 170 static Array<T> |
171 do_trilu (const Array<T>& a, octave_idx_type k, bool lower, bool pack) | 171 do_trilu (const Array<T>& a, octave_idx_type k, bool lower, bool pack) |
172 { | 172 { |
173 return lower ? do_tril (a, k, pack) : do_triu (a, k, pack); | 173 return lower ? do_tril (a, k, pack) : do_triu (a, k, pack); |
174 } | 174 } |
175 | 175 |
176 template <class T> | 176 template <typename T> |
177 static Sparse<T> | 177 static Sparse<T> |
178 do_trilu (const Sparse<T>& a, octave_idx_type k, bool lower, bool pack) | 178 do_trilu (const Sparse<T>& a, octave_idx_type k, bool lower, bool pack) |
179 { | 179 { |
180 return lower ? do_tril (a, k, pack) : do_triu (a, k, pack); | 180 return lower ? do_tril (a, k, pack) : do_triu (a, k, pack); |
181 } | 181 } |