Mercurial > hg > octave-lyh
annotate src/ov-cx-sparse.h @ 7829:8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
* * *
Add surface properties.
* * *
Add cdata -> RGB color conversion function. Use it in surface objects.
* * *
Add normals automatic computation to surface objects.
* * *
Make sure the correct "get" method is called.
* * *
Extend scaler interface to accept NDArray.
* * *
Surface rendering (1st part).
* * *
Fix wrong indexing.
* * *
Fix bug in xget_ancestor argument declaration.
* * *
Initialize OpenGL context correctly. Fix bug in surface rendering.
* * *
Set material color when rendering surface facets.
* * *
Add rendering of surface mesh and markers.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Thu, 14 Feb 2008 12:17:44 +0100 |
parents | 39930366b709 |
children | f336dd8e96d0 |
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 "so-array.h" | |
35 #include "str-vec.h" | |
36 | |
37 #include "error.h" | |
38 #include "oct-stream.h" | |
39 #include "ov-base.h" | |
40 #include "ov-typeinfo.h" | |
41 | |
42 #include "CSparse.h" | |
43 #include "ov-base-sparse.h" | |
44 #include "ov-re-sparse.h" | |
45 | |
46 class Octave_map; | |
47 class octave_value_list; | |
48 | |
49 class tree_walker; | |
50 | |
51 class | |
6109 | 52 OCTINTERP_API |
5164 | 53 octave_sparse_complex_matrix : public octave_base_sparse<SparseComplexMatrix> |
54 { | |
55 public: | |
56 | |
57 octave_sparse_complex_matrix (void) | |
58 : octave_base_sparse<SparseComplexMatrix> () { } | |
59 | |
60 octave_sparse_complex_matrix (const ComplexNDArray& m) | |
61 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { } | |
62 | |
63 octave_sparse_complex_matrix (const ComplexMatrix& m) | |
64 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { } | |
65 | |
66 octave_sparse_complex_matrix (const SparseComplexMatrix& m) | |
67 : octave_base_sparse<SparseComplexMatrix> (m) { } | |
68 | |
69 octave_sparse_complex_matrix (const SparseComplexMatrix& m, | |
5785 | 70 const MatrixType &t) |
5164 | 71 : octave_base_sparse<SparseComplexMatrix> (m, t) { } |
72 | |
73 octave_sparse_complex_matrix (const MSparse<Complex>& m) | |
74 : octave_base_sparse<SparseComplexMatrix> (m) { } | |
75 | |
6863 | 76 octave_sparse_complex_matrix (const MSparse<Complex>& m, |
77 const MatrixType &t) | |
78 : octave_base_sparse<SparseComplexMatrix> (m, t) { } | |
79 | |
80 octave_sparse_complex_matrix (const Sparse<Complex>& m, | |
81 const MatrixType &t) | |
82 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m), t) { } | |
83 | |
84 octave_sparse_complex_matrix (const Sparse<Complex>& m) | |
85 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { } | |
86 | |
5164 | 87 octave_sparse_complex_matrix (const octave_sparse_complex_matrix& cm) |
88 : octave_base_sparse<SparseComplexMatrix> (cm) { } | |
89 | |
90 ~octave_sparse_complex_matrix (void) { } | |
91 | |
5759 | 92 octave_base_value *clone (void) const { return new octave_sparse_complex_matrix (*this); } |
93 octave_base_value *empty_clone (void) const { return new octave_sparse_complex_matrix (); } | |
5164 | 94 |
5759 | 95 octave_base_value *try_narrowing_conversion (void); |
5164 | 96 |
97 void assign (const octave_value_list& idx, const SparseComplexMatrix& rhs); | |
98 | |
99 void assign (const octave_value_list& idx, const SparseMatrix& rhs); | |
100 | |
101 bool is_complex_matrix (void) const { return true; } | |
102 | |
103 bool is_complex_type (void) const { return true; } | |
104 | |
5895 | 105 bool is_double_type (void) const { return true; } |
106 | |
7576 | 107 bool is_float_type (void) const { return true; } |
108 | |
5164 | 109 bool valid_as_scalar_index (void) const; |
110 | |
111 double double_value (bool = false) const; | |
112 | |
113 double scalar_value (bool frc_str_conv = false) const | |
114 { return double_value (frc_str_conv); } | |
115 | |
116 Matrix matrix_value (bool = false) const; | |
117 | |
118 Complex complex_value (bool = false) const; | |
119 | |
120 ComplexMatrix complex_matrix_value (bool = false) const; | |
121 | |
122 ComplexNDArray complex_array_value (bool = false) const; | |
123 | |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
124 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
|
125 |
5164 | 126 SparseMatrix sparse_matrix_value (bool = false) const; |
127 | |
128 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const | |
129 { return matrix; } | |
130 | |
131 #if 0 | |
132 int write (octave_stream& os, int block_size, | |
133 oct_data_conv::data_type output_type, int skip, | |
134 oct_mach_info::float_format flt_fmt) const | |
135 { | |
136 // Yes, for compatibility, we drop the imaginary part here. | |
137 return os.write (matrix_value (true), block_size, output_type, | |
138 skip, flt_fmt); | |
139 } | |
140 #endif | |
141 | |
142 bool save_binary (std::ostream& os, bool& save_as_floats); | |
143 | |
144 bool load_binary (std::istream& is, bool swap, | |
145 oct_mach_info::float_format fmt); | |
146 | |
147 #if defined (HAVE_HDF5) | |
148 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); | |
149 | |
150 bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); | |
151 #endif | |
152 | |
5900 | 153 mxArray *as_mxArray (void) const; |
154 | |
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
|
155 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
|
156 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
|
157 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
|
158 octave_value lgamma (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
159 octave_value abs (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
160 octave_value acos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
161 octave_value acosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
162 octave_value angle (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
163 octave_value arg (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
164 octave_value asin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
165 octave_value asinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
166 octave_value atan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
167 octave_value atanh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
168 octave_value ceil (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
169 octave_value conj (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
170 octave_value cos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
171 octave_value cosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
172 octave_value exp (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
173 octave_value expm1 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
174 octave_value fix (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
175 octave_value floor (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
176 octave_value imag (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
177 octave_value log (void) const; |
7740 | 178 octave_value log2 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
179 octave_value log10 (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
180 octave_value log1p (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
181 octave_value real (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
182 octave_value round (void) const; |
7636
99c410f7f0b0
implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents:
7576
diff
changeset
|
183 octave_value roundb (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
184 octave_value signum (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
185 octave_value sin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
186 octave_value sinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
187 octave_value sqrt (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
188 octave_value tan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
189 octave_value tanh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
190 octave_value finite (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
191 octave_value isinf (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
192 octave_value isna (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
193 octave_value isnan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
194 |
5164 | 195 private: |
196 | |
197 DECLARE_OCTAVE_ALLOCATOR | |
198 | |
199 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA | |
200 }; | |
201 | |
202 #endif | |
203 | |
204 /* | |
205 ;;; Local Variables: *** | |
206 ;;; mode: C++ *** | |
207 ;;; End: *** | |
208 */ |