Mercurial > hg > octave-lyh
annotate src/ov-cx-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 | aac9f4265048 |
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_complex_matrix_h) | |
25 #define octave_sparse_complex_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 "CSparse.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_complex_matrix : public octave_base_sparse<SparseComplexMatrix> |
53 { | |
54 public: | |
55 | |
56 octave_sparse_complex_matrix (void) | |
57 : octave_base_sparse<SparseComplexMatrix> () { } | |
58 | |
59 octave_sparse_complex_matrix (const ComplexNDArray& m) | |
60 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { } | |
61 | |
62 octave_sparse_complex_matrix (const ComplexMatrix& m) | |
63 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { } | |
64 | |
65 octave_sparse_complex_matrix (const SparseComplexMatrix& m) | |
66 : octave_base_sparse<SparseComplexMatrix> (m) { } | |
67 | |
68 octave_sparse_complex_matrix (const SparseComplexMatrix& m, | |
10313 | 69 const MatrixType &t) |
5164 | 70 : octave_base_sparse<SparseComplexMatrix> (m, t) { } |
71 | |
72 octave_sparse_complex_matrix (const MSparse<Complex>& m) | |
73 : octave_base_sparse<SparseComplexMatrix> (m) { } | |
74 | |
6863 | 75 octave_sparse_complex_matrix (const MSparse<Complex>& m, |
10313 | 76 const MatrixType &t) |
6863 | 77 : octave_base_sparse<SparseComplexMatrix> (m, t) { } |
78 | |
79 octave_sparse_complex_matrix (const Sparse<Complex>& m, | |
10313 | 80 const MatrixType &t) |
6863 | 81 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m), t) { } |
82 | |
83 octave_sparse_complex_matrix (const Sparse<Complex>& m) | |
84 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { } | |
85 | |
5164 | 86 octave_sparse_complex_matrix (const octave_sparse_complex_matrix& cm) |
87 : octave_base_sparse<SparseComplexMatrix> (cm) { } | |
88 | |
89 ~octave_sparse_complex_matrix (void) { } | |
90 | |
5759 | 91 octave_base_value *clone (void) const { return new octave_sparse_complex_matrix (*this); } |
92 octave_base_value *empty_clone (void) const { return new octave_sparse_complex_matrix (); } | |
5164 | 93 |
5759 | 94 octave_base_value *try_narrowing_conversion (void); |
5164 | 95 |
96 void assign (const octave_value_list& idx, const SparseComplexMatrix& rhs); | |
97 | |
98 void assign (const octave_value_list& idx, const SparseMatrix& rhs); | |
99 | |
9685 | 100 builtin_type_t builtin_type (void) const { return btyp_complex; } |
101 | |
5164 | 102 bool is_complex_matrix (void) const { return true; } |
103 | |
104 bool is_complex_type (void) const { return true; } | |
105 | |
5895 | 106 bool is_double_type (void) const { return true; } |
107 | |
7576 | 108 bool is_float_type (void) const { return true; } |
109 | |
5164 | 110 double double_value (bool = false) const; |
111 | |
112 double scalar_value (bool frc_str_conv = false) const | |
113 { return double_value (frc_str_conv); } | |
114 | |
115 Matrix matrix_value (bool = false) const; | |
116 | |
117 Complex complex_value (bool = false) const; | |
118 | |
119 ComplexMatrix complex_matrix_value (bool = false) const; | |
120 | |
121 ComplexNDArray complex_array_value (bool = false) const; | |
122 | |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
123 charNDArray char_array_value (bool frc_str_conv = false) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
124 |
5164 | 125 SparseMatrix sparse_matrix_value (bool = false) const; |
126 | |
127 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const | |
128 { return matrix; } | |
129 | |
9853
8d9e4752441a
implement complex built-in logical conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
130 SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const; |
8d9e4752441a
implement complex built-in logical conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
131 |
5164 | 132 #if 0 |
133 int write (octave_stream& os, int block_size, | |
10313 | 134 oct_data_conv::data_type output_type, int skip, |
135 oct_mach_info::float_format flt_fmt) const | |
5164 | 136 { |
137 // Yes, for compatibility, we drop the imaginary part here. | |
138 return os.write (matrix_value (true), block_size, output_type, | |
10313 | 139 skip, flt_fmt); |
5164 | 140 } |
141 #endif | |
142 | |
143 bool save_binary (std::ostream& os, bool& save_as_floats); | |
144 | |
145 bool load_binary (std::istream& is, bool swap, | |
10313 | 146 oct_mach_info::float_format fmt); |
5164 | 147 |
148 #if defined (HAVE_HDF5) | |
149 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); | |
150 | |
9881
b3089dba88bf
Remove HDF5 cruft for older versions of HDF5
Kacper Kowalik
parents:
9853
diff
changeset
|
151 bool load_hdf5 (hid_t loc_id, const char *name); |
5164 | 152 #endif |
153 | |
5900 | 154 mxArray *as_mxArray (void) const; |
155 | |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9685
diff
changeset
|
156 octave_value map (unary_mapper_t umap) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
157 |
5164 | 158 private: |
159 | |
160 DECLARE_OCTAVE_ALLOCATOR | |
161 | |
162 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA | |
163 }; | |
164 | |
165 #endif |