Mercurial > hg > octave-nkf
annotate src/ov-bool-sparse.h @ 10313:f3b65e1ae355
untabify src header files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:16:43 -0500 |
parents | cd96d29c5efa |
children | d9e57045b9e1 |
rev | line source |
---|---|
5164 | 1 /* |
2 | |
8920 | 3 Copyright (C) 2004, 2005, 2006, 2007, 2008 David Bateman |
7016 | 4 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Andy Adler |
5 | |
6 This file is part of Octave. | |
5164 | 7 |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5164 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5164 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_sparse_bool_matrix_h) | |
25 #define octave_sparse_bool_matrix_h 1 | |
26 | |
27 #include <cstdlib> | |
28 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
29 #include <iosfwd> |
5164 | 30 #include <string> |
31 | |
32 #include "mx-base.h" | |
33 #include "oct-alloc.h" | |
34 #include "str-vec.h" | |
35 | |
36 #include "error.h" | |
37 #include "oct-stream.h" | |
38 #include "ov-base.h" | |
39 #include "ov-typeinfo.h" | |
40 | |
41 #include "boolSparse.h" | |
42 #include "ov-base-sparse.h" | |
43 #include "ov-re-sparse.h" | |
44 | |
45 class Octave_map; | |
46 class octave_value_list; | |
47 | |
48 class tree_walker; | |
49 | |
50 class | |
6109 | 51 OCTINTERP_API |
5164 | 52 octave_sparse_bool_matrix : public octave_base_sparse<SparseBoolMatrix> |
53 { | |
54 public: | |
55 | |
56 octave_sparse_bool_matrix (void) | |
57 : octave_base_sparse<SparseBoolMatrix> () { } | |
58 | |
59 octave_sparse_bool_matrix (const SparseBoolMatrix& bnda) | |
60 : octave_base_sparse<SparseBoolMatrix> (bnda) { } | |
61 | |
62 octave_sparse_bool_matrix (const SparseBoolMatrix& bnda, | |
10313 | 63 const MatrixType& t) |
5164 | 64 : octave_base_sparse<SparseBoolMatrix> (bnda, t) { } |
65 | |
66 octave_sparse_bool_matrix (const boolNDArray& m) | |
67 : octave_base_sparse<SparseBoolMatrix> (SparseBoolMatrix (m)) { } | |
68 | |
69 octave_sparse_bool_matrix (const boolMatrix& m) | |
70 : octave_base_sparse<SparseBoolMatrix> (SparseBoolMatrix (m)) { } | |
71 | |
72 octave_sparse_bool_matrix (const Sparse<bool>& a) | |
73 : octave_base_sparse<SparseBoolMatrix> (a) { } | |
74 | |
75 octave_sparse_bool_matrix (const octave_sparse_bool_matrix& bm) | |
76 : octave_base_sparse<SparseBoolMatrix> (bm) { } | |
77 | |
78 ~octave_sparse_bool_matrix (void) { } | |
79 | |
5759 | 80 octave_base_value *clone (void) const { return new octave_sparse_bool_matrix (*this); } |
81 octave_base_value *empty_clone (void) const { return new octave_sparse_bool_matrix (); } | |
5164 | 82 |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
83 type_conv_info numeric_conversion_function (void) const; |
5164 | 84 |
5759 | 85 octave_base_value *try_narrowing_conversion (void); |
5164 | 86 |
5775 | 87 // FIXME Adapt idx_vector to allow sparse logical indexing!! |
5282 | 88 idx_vector index_vector (void) const |
89 { return idx_vector (bool_array_value ()); } | |
5164 | 90 |
9685 | 91 builtin_type_t builtin_type (void) const { return btyp_bool; } |
92 | |
5164 | 93 bool is_bool_matrix (void) const { return true; } |
94 | |
95 bool is_bool_type (void) const { return true; } | |
96 | |
97 bool is_real_type (void) const { return true; } | |
98 | |
99 double double_value (bool = false) const; | |
100 | |
101 double scalar_value (bool frc_str_conv = false) const | |
102 { return double_value (frc_str_conv); } | |
103 | |
104 Matrix matrix_value (bool = false) const; | |
105 | |
106 NDArray array_value (bool = false) const; | |
107 | |
108 Complex complex_value (bool = false) const; | |
109 | |
110 ComplexMatrix complex_matrix_value (bool = false) const; | |
111 | |
112 ComplexNDArray complex_array_value (bool = false) const; | |
113 | |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
114 charNDArray char_array_value (bool = false) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
115 |
5944 | 116 boolMatrix bool_matrix_value (bool = false) const; |
5164 | 117 |
5944 | 118 boolNDArray bool_array_value (bool = false) const; |
5164 | 119 |
5188 | 120 SparseMatrix sparse_matrix_value (bool = false) const; |
5164 | 121 |
5188 | 122 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const; |
5164 | 123 |
5189 | 124 SparseBoolMatrix sparse_bool_matrix_value (bool = false) const |
5164 | 125 { return matrix; } |
126 | |
5279 | 127 octave_value convert_to_str_internal (bool pad, bool force, char type) const; |
5164 | 128 |
129 bool save_binary (std::ostream& os, bool& save_as_floats); | |
130 | |
131 bool load_binary (std::istream& is, bool swap, | |
10313 | 132 oct_mach_info::float_format fmt); |
5164 | 133 |
134 #if defined (HAVE_HDF5) | |
135 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); | |
136 | |
9881
b3089dba88bf
Remove HDF5 cruft for older versions of HDF5
Kacper Kowalik
parents:
9812
diff
changeset
|
137 bool load_hdf5 (hid_t loc_id, const char *name); |
5164 | 138 #endif |
139 | |
5900 | 140 mxArray *as_mxArray (void) const; |
141 | |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
142 // Mapper functions are converted to double for treatment |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9685
diff
changeset
|
143 octave_value map (unary_mapper_t umap) const |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9685
diff
changeset
|
144 { |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9685
diff
changeset
|
145 octave_sparse_matrix m (sparse_matrix_value ()); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9685
diff
changeset
|
146 return m.map (umap); |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
147 } |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
148 |
5164 | 149 protected: |
150 | |
151 DECLARE_OCTAVE_ALLOCATOR | |
152 | |
153 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA | |
154 }; | |
155 | |
156 #endif |