Mercurial > jwe > octave
annotate libinterp/octave-value/ov-base-int.h @ 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 | f7084eae3318 |
children | 1473547f50f5 |
rev | line source |
---|---|
4903 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19598
diff
changeset
|
3 Copyright (C) 2004-2015 John W. Eaton |
4903 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
4903 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
4903 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20126
diff
changeset
|
23 #if ! defined (octave_ov_base_int_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
24 #define octave_ov_base_int_h 1 |
4903 | 25 |
26 #include <cstdlib> | |
27 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
28 #include <iosfwd> |
4903 | 29 #include <string> |
30 | |
31 #include "mx-base.h" | |
32 #include "str-vec.h" | |
33 | |
34 #include "error.h" | |
35 #include "ov-base.h" | |
36 #include "ov-base-mat.h" | |
37 #include "ov-base-scalar.h" | |
38 #include "ov-typeinfo.h" | |
39 | |
40 // base int matrix values. | |
41 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
42 template <typename T> |
4903 | 43 class |
44 octave_base_int_matrix : public octave_base_matrix<T> | |
45 { | |
46 public: | |
47 | |
48 octave_base_int_matrix (void) : octave_base_matrix<T> () { } | |
49 | |
50 octave_base_int_matrix (const T& nda) : octave_base_matrix<T> (nda) { } | |
51 | |
52 ~octave_base_int_matrix (void) { } | |
53 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
54 octave_base_value *clone (void) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
55 { return new octave_base_int_matrix (*this); } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
56 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
57 octave_base_value *empty_clone (void) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
58 { return new octave_base_int_matrix (); } |
4903 | 59 |
5759 | 60 octave_base_value *try_narrowing_conversion (void); |
4903 | 61 |
62 bool is_real_type (void) const { return true; } | |
63 | |
64 // void increment (void) { matrix += 1; } | |
65 | |
66 // void decrement (void) { matrix -= 1; } | |
67 | |
68 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; | |
69 | |
5992 | 70 octave_value convert_to_str_internal (bool, bool, char type) const; |
71 | |
6974 | 72 bool save_ascii (std::ostream& os); |
4903 | 73 |
74 bool load_ascii (std::istream& is); | |
75 | |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
17822
diff
changeset
|
76 bool save_binary (std::ostream& os, bool&); |
4903 | 77 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
78 bool load_binary (std::istream& is, bool swap, |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
17822
diff
changeset
|
79 oct_mach_info::float_format); |
4903 | 80 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
81 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool); |
4903 | 82 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
83 bool load_hdf5 (octave_hdf5_id loc_id, const char *name); |
4903 | 84 }; |
85 | |
86 // base int scalar values. | |
87 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
88 template <typename T> |
4903 | 89 class |
90 octave_base_int_scalar : public octave_base_scalar<T> | |
91 { | |
92 public: | |
93 | |
94 octave_base_int_scalar (void) : octave_base_scalar<T> () { } | |
95 | |
96 octave_base_int_scalar (const T& s) : octave_base_scalar<T> (s) { } | |
97 | |
98 ~octave_base_int_scalar (void) { } | |
99 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
100 octave_base_value *clone (void) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
101 { return new octave_base_int_scalar (*this); } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
102 octave_base_value *empty_clone (void) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
103 { return new octave_base_int_scalar (); } |
4903 | 104 |
5759 | 105 octave_base_value *try_narrowing_conversion (void) { return 0; } |
4903 | 106 |
107 bool is_real_type (void) const { return true; } | |
108 | |
20126
d34e31b07966
Return true for is_real_scalar() for integer scalar types (bug #44917).
Rik <rik@octave.org>
parents:
19863
diff
changeset
|
109 bool is_real_scalar (void) const { return true; } |
d34e31b07966
Return true for is_real_scalar() for integer scalar types (bug #44917).
Rik <rik@octave.org>
parents:
19863
diff
changeset
|
110 |
4903 | 111 // void increment (void) { scalar += 1; } |
112 | |
113 // void decrement (void) { scalar -= 1; } | |
114 | |
5992 | 115 octave_value convert_to_str_internal (bool, bool, char type) const; |
116 | |
6974 | 117 bool save_ascii (std::ostream& os); |
4903 | 118 |
119 bool load_ascii (std::istream& is); | |
120 | |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
17822
diff
changeset
|
121 bool save_binary (std::ostream& os, bool&); |
4903 | 122 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
123 bool load_binary (std::istream& is, bool swap, |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
17822
diff
changeset
|
124 oct_mach_info::float_format); |
4903 | 125 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
126 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool); |
4903 | 127 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
128 bool load_hdf5 (octave_hdf5_id loc_id, const char *name); |
4903 | 129 }; |
130 | |
131 #endif |