Mercurial > hg > octave-lyh
annotate src/ov-cx-sparse.h @ 8500:aaddb450b9aa
[docs] can not => cannot
author | Brian Gough <bjg@gnu.org> |
---|---|
date | Tue, 13 Jan 2009 00:36:52 -0500 |
parents | f00578b495e9 |
children | eb63fbe60fab |
rev | line source |
---|---|
5164 | 1 /* |
2 | |
7017 | 3 Copyright (C) 2004, 2005, 2006, 2007 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 | |
29 #include <iostream> | |
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, | |
5785 | 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, |
76 const MatrixType &t) | |
77 : octave_base_sparse<SparseComplexMatrix> (m, t) { } | |
78 | |
79 octave_sparse_complex_matrix (const Sparse<Complex>& m, | |
80 const MatrixType &t) | |
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 | |
100 bool is_complex_matrix (void) const { return true; } | |
101 | |
102 bool is_complex_type (void) const { return true; } | |
103 | |
5895 | 104 bool is_double_type (void) const { return true; } |
105 | |
7576 | 106 bool is_float_type (void) const { return true; } |
107 | |
5164 | 108 double double_value (bool = false) const; |
109 | |
110 double scalar_value (bool frc_str_conv = false) const | |
111 { return double_value (frc_str_conv); } | |
112 | |
113 Matrix matrix_value (bool = false) const; | |
114 | |
115 Complex complex_value (bool = false) const; | |
116 | |
117 ComplexMatrix complex_matrix_value (bool = false) const; | |
118 | |
119 ComplexNDArray complex_array_value (bool = false) const; | |
120 | |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
121 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
|
122 |
5164 | 123 SparseMatrix sparse_matrix_value (bool = false) const; |
124 | |
125 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const | |
126 { return matrix; } | |
127 | |
128 #if 0 | |
129 int write (octave_stream& os, int block_size, | |
130 oct_data_conv::data_type output_type, int skip, | |
131 oct_mach_info::float_format flt_fmt) const | |
132 { | |
133 // Yes, for compatibility, we drop the imaginary part here. | |
134 return os.write (matrix_value (true), block_size, output_type, | |
135 skip, flt_fmt); | |
136 } | |
137 #endif | |
138 | |
139 bool save_binary (std::ostream& os, bool& save_as_floats); | |
140 | |
141 bool load_binary (std::istream& is, bool swap, | |
142 oct_mach_info::float_format fmt); | |
143 | |
144 #if defined (HAVE_HDF5) | |
145 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); | |
146 | |
147 bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); | |
148 #endif | |
149 | |
5900 | 150 mxArray *as_mxArray (void) const; |
151 | |
7667
fb3a6c53c2b2
Allow negative zero imaginary part to be treated as zero for erf, erfc, gamma and lgamma mapper function
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
152 octave_value erf (void) const; |
fb3a6c53c2b2
Allow negative zero imaginary part to be treated as zero for erf, erfc, gamma and lgamma mapper function
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
153 octave_value erfc (void) const; |
fb3a6c53c2b2
Allow negative zero imaginary part to be treated as zero for erf, erfc, gamma and lgamma mapper function
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
154 octave_value gamma (void) const; |
fb3a6c53c2b2
Allow negative zero imaginary part to be treated as zero for erf, erfc, gamma and lgamma mapper function
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
155 octave_value lgamma (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
156 octave_value abs (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
157 octave_value acos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
158 octave_value acosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
159 octave_value angle (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
160 octave_value arg (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
161 octave_value asin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
162 octave_value asinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
163 octave_value atan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
164 octave_value atanh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
165 octave_value ceil (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
166 octave_value conj (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
167 octave_value cos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
168 octave_value cosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
169 octave_value exp (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
170 octave_value expm1 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
171 octave_value fix (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
172 octave_value floor (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
173 octave_value imag (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
174 octave_value log (void) const; |
7740 | 175 octave_value log2 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
176 octave_value log10 (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
177 octave_value log1p (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
178 octave_value real (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
179 octave_value round (void) const; |
7636
99c410f7f0b0
implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents:
7576
diff
changeset
|
180 octave_value roundb (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
181 octave_value signum (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
182 octave_value sin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
183 octave_value sinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
184 octave_value sqrt (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
185 octave_value tan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
186 octave_value tanh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
187 octave_value finite (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
188 octave_value isinf (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
189 octave_value isna (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
190 octave_value isnan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
191 |
5164 | 192 private: |
193 | |
194 DECLARE_OCTAVE_ALLOCATOR | |
195 | |
196 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA | |
197 }; | |
198 | |
199 #endif | |
200 | |
201 /* | |
202 ;;; Local Variables: *** | |
203 ;;; mode: C++ *** | |
204 ;;; End: *** | |
205 */ |