comparison src/ov-cx-diag.h @ 8366:8b1a2555c4e2

implement diagonal matrix objects * * *
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 03 Dec 2008 13:32:57 +0100
parents
children ad896677a2e2
comparison
equal deleted inserted replaced
8365:65ca196fff28 8366:8b1a2555c4e2
1 /*
2
3 Copyright (C) 2008 Jaroslav Hajek
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 3 of the License, or (at your
10 option) any 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, see
19 <http://www.gnu.org/licenses/>.
20
21 */
22
23 #if !defined (octave_complex_diag_matrix_h)
24 #define octave_complex_diag_matrix_h 1
25
26 #include "ov-base.h"
27 #include "ov-base-diag.h"
28 #include "ov-cx-mat.h"
29 #include "ov-typeinfo.h"
30
31 // Real diagonal matrix values.
32
33 class
34 OCTINTERP_API
35 octave_complex_diag_matrix
36 : public octave_base_diag<ComplexDiagMatrix, ComplexMatrix>
37 {
38 public:
39
40 octave_complex_diag_matrix (void)
41 : octave_base_diag<ComplexDiagMatrix, ComplexMatrix> () { }
42
43 octave_complex_diag_matrix (const ComplexDiagMatrix& m)
44 : octave_base_diag<ComplexDiagMatrix, ComplexMatrix> (m) { }
45
46 octave_complex_diag_matrix (const octave_complex_diag_matrix& m)
47 : octave_base_diag<ComplexDiagMatrix, ComplexMatrix> (m) { }
48
49 ~octave_complex_diag_matrix (void) { }
50
51 octave_base_value *clone (void) const { return new octave_complex_diag_matrix (*this); }
52 octave_base_value *empty_clone (void) const { return new octave_complex_diag_matrix (); }
53
54 type_conv_info numeric_conversion_function (void) const;
55
56 type_conv_info numeric_demotion_function (void) const;
57
58 octave_base_value *try_narrowing_conversion (void);
59
60 bool is_complex_matrix (void) const { return true; }
61
62 bool is_complex_type (void) const { return true; }
63
64 bool is_double_type (void) const { return true; }
65
66 bool is_float_type (void) const { return true; }
67
68 DiagMatrix diag_matrix_value (bool = false) const;
69
70 FloatDiagMatrix float_diag_matrix_value (bool = false) const;
71
72 ComplexDiagMatrix complex_diag_matrix_value (bool = false) const;
73
74 FloatComplexDiagMatrix float_complex_diag_matrix_value (bool = false) const;
75
76 octave_value abs (void) const;
77 octave_value conj (void) const;
78 octave_value imag (void) const;
79 octave_value real (void) const;
80
81 private:
82 DECLARE_OCTAVE_ALLOCATOR
83
84 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
85 };
86
87 #endif