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 |
|
26 #if defined (__GNUG__) |
|
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 |
3219
|
52 octave_complex_matrix : public octave_base_matrix<ComplexMatrix> |
2376
|
53 { |
|
54 public: |
|
55 |
|
56 octave_complex_matrix (void) |
3219
|
57 : octave_base_matrix<ComplexMatrix> () { } |
2376
|
58 |
|
59 octave_complex_matrix (const ComplexMatrix& m) |
3219
|
60 : octave_base_matrix<ComplexMatrix> (m) { } |
2376
|
61 |
|
62 octave_complex_matrix (const ComplexDiagMatrix& d) |
3587
|
63 : octave_base_matrix<ComplexMatrix> (ComplexMatrix (d)) { } |
2376
|
64 |
3418
|
65 octave_complex_matrix (const ComplexRowVector& v) |
|
66 : octave_base_matrix<ComplexMatrix> (ComplexMatrix (v)) { } |
2376
|
67 |
3418
|
68 octave_complex_matrix (const ComplexColumnVector& v) |
|
69 : octave_base_matrix<ComplexMatrix> (ComplexMatrix (v)) { } |
2376
|
70 |
|
71 octave_complex_matrix (const octave_complex_matrix& cm) |
3219
|
72 : octave_base_matrix<ComplexMatrix> (cm) { } |
2376
|
73 |
|
74 ~octave_complex_matrix (void) { } |
|
75 |
|
76 octave_value *clone (void) { return new octave_complex_matrix (*this); } |
|
77 |
2410
|
78 octave_value *try_narrowing_conversion (void); |
|
79 |
2376
|
80 void assign (const octave_value_list& idx, const ComplexMatrix& rhs); |
|
81 |
|
82 void assign (const octave_value_list& idx, const Matrix& rhs); |
|
83 |
|
84 bool is_complex_matrix (void) const { return true; } |
|
85 |
|
86 bool is_complex_type (void) const { return true; } |
|
87 |
|
88 bool valid_as_scalar_index (void) const; |
|
89 |
3145
|
90 double double_value (bool = false) const; |
2376
|
91 |
3145
|
92 double scalar_value (bool frc_str_conv = false) const |
|
93 { return double_value (frc_str_conv); } |
2916
|
94 |
2376
|
95 Matrix matrix_value (bool = false) const; |
|
96 |
|
97 Complex complex_value (bool = false) const; |
|
98 |
|
99 ComplexMatrix complex_matrix_value (bool = false) const; |
|
100 |
3107
|
101 void increment (void) { matrix += Complex (1.0); } |
2376
|
102 |
3107
|
103 void decrement (void) { matrix -= Complex (1.0); } |
2376
|
104 |
|
105 private: |
|
106 |
3219
|
107 DECLARE_OCTAVE_ALLOCATOR |
2477
|
108 |
3219
|
109 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2376
|
110 }; |
|
111 |
|
112 #endif |
|
113 |
|
114 /* |
|
115 ;;; Local Variables: *** |
|
116 ;;; mode: C++ *** |
|
117 ;;; End: *** |
|
118 */ |