2376
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
2376
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_complex_matrix_h) |
|
24 #define octave_complex_matrix_h 1 |
|
25 |
4192
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
2376
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <cstdlib> |
|
31 |
3503
|
32 #include <iostream> |
2376
|
33 #include <string> |
|
34 |
|
35 #include "mx-base.h" |
2477
|
36 #include "oct-alloc.h" |
2376
|
37 #include "str-vec.h" |
|
38 |
|
39 #include "error.h" |
|
40 #include "ov-base.h" |
3219
|
41 #include "ov-base-mat.h" |
2376
|
42 #include "ov-typeinfo.h" |
|
43 |
|
44 class Octave_map; |
|
45 class octave_value_list; |
|
46 |
|
47 class tree_walker; |
|
48 |
2477
|
49 // Complex matrix values. |
2376
|
50 |
|
51 class |
4513
|
52 octave_complex_matrix : public octave_base_matrix<ComplexNDArray> |
2376
|
53 { |
|
54 public: |
|
55 |
|
56 octave_complex_matrix (void) |
4513
|
57 : octave_base_matrix<ComplexNDArray> () { } |
|
58 |
|
59 octave_complex_matrix (const ComplexNDArray& m) |
|
60 : octave_base_matrix<ComplexNDArray> (m) { } |
2376
|
61 |
|
62 octave_complex_matrix (const ComplexMatrix& m) |
4513
|
63 : octave_base_matrix<ComplexNDArray> (m) { } |
2376
|
64 |
|
65 octave_complex_matrix (const ComplexDiagMatrix& d) |
4513
|
66 : octave_base_matrix<ComplexNDArray> (ComplexMatrix (d)) { } |
2376
|
67 |
3418
|
68 octave_complex_matrix (const ComplexRowVector& v) |
4513
|
69 : octave_base_matrix<ComplexNDArray> (ComplexMatrix (v)) { } |
2376
|
70 |
3418
|
71 octave_complex_matrix (const ComplexColumnVector& v) |
4513
|
72 : octave_base_matrix<ComplexNDArray> (ComplexMatrix (v)) { } |
2376
|
73 |
|
74 octave_complex_matrix (const octave_complex_matrix& cm) |
4513
|
75 : octave_base_matrix<ComplexNDArray> (cm) { } |
2376
|
76 |
|
77 ~octave_complex_matrix (void) { } |
|
78 |
3933
|
79 octave_value *clone (void) const { return new octave_complex_matrix (*this); } |
|
80 octave_value *empty_clone (void) const { return new octave_complex_matrix (); } |
2376
|
81 |
2410
|
82 octave_value *try_narrowing_conversion (void); |
|
83 |
4418
|
84 void assign (const octave_value_list& idx, const ComplexMatrix& rhs); |
2376
|
85 |
|
86 void assign (const octave_value_list& idx, const Matrix& rhs); |
|
87 |
|
88 bool is_complex_matrix (void) const { return true; } |
|
89 |
|
90 bool is_complex_type (void) const { return true; } |
|
91 |
|
92 bool valid_as_scalar_index (void) const; |
|
93 |
3145
|
94 double double_value (bool = false) const; |
2376
|
95 |
3145
|
96 double scalar_value (bool frc_str_conv = false) const |
|
97 { return double_value (frc_str_conv); } |
2916
|
98 |
2376
|
99 Matrix matrix_value (bool = false) const; |
|
100 |
|
101 Complex complex_value (bool = false) const; |
|
102 |
|
103 ComplexMatrix complex_matrix_value (bool = false) const; |
|
104 |
4543
|
105 ComplexNDArray array_value (void) const { return matrix; } |
|
106 |
3107
|
107 void increment (void) { matrix += Complex (1.0); } |
2376
|
108 |
3107
|
109 void decrement (void) { matrix -= Complex (1.0); } |
2376
|
110 |
|
111 private: |
|
112 |
3219
|
113 DECLARE_OCTAVE_ALLOCATOR |
2477
|
114 |
3219
|
115 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2376
|
116 }; |
|
117 |
|
118 #endif |
|
119 |
|
120 /* |
|
121 ;;; Local Variables: *** |
|
122 ;;; mode: C++ *** |
|
123 ;;; End: *** |
|
124 */ |