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