annotate libinterp/octave-value/ov-cx-diag.h @ 23220:092078913d54

maint: Merge stable to default.
author John W. Eaton <jwe@octave.org>
date Wed, 22 Feb 2017 12:58:07 -0500
parents ef4d915df748 3ac9f9ecfae5
children cd4e1ee28716
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
1 /*
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
2
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23083
diff changeset
3 Copyright (C) 2008-2017 Jaroslav Hajek
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
4
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
5 This file is part of Octave.
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
6
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
8 under the terms of the GNU General Public License as published by
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
9 the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
10 (at your option) any later version.
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
11
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
12 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
15 GNU General Public License for more details.
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
16
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
20
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
21 */
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
22
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
23 #if ! defined (octave_ov_cx_diag_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17787
diff changeset
24 #define octave_ov_cx_diag_h 1
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
25
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
26 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
27
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
28 #include "ov-base.h"
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
29 #include "ov-base-diag.h"
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
30 #include "ov-cx-mat.h"
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
31 #include "ov-typeinfo.h"
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
32
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
33 // Real diagonal matrix values.
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
34
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
35 class
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
36 OCTINTERP_API
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
37 octave_complex_diag_matrix
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
38 : public octave_base_diag<ComplexDiagMatrix, ComplexMatrix>
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
39 {
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
40 public:
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
41
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
42 octave_complex_diag_matrix (void)
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
43 : octave_base_diag<ComplexDiagMatrix, ComplexMatrix> () { }
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
44
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
45 octave_complex_diag_matrix (const ComplexDiagMatrix& m)
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
46 : octave_base_diag<ComplexDiagMatrix, ComplexMatrix> (m) { }
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
47
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
48 octave_complex_diag_matrix (const octave_complex_diag_matrix& m)
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
49 : octave_base_diag<ComplexDiagMatrix, ComplexMatrix> (m) { }
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
50
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
51 ~octave_complex_diag_matrix (void) = default;
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
52
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
53 octave_base_value *clone (void) const
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
54 { return new octave_complex_diag_matrix (*this); }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
55 octave_base_value *empty_clone (void) const
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
56 { return new octave_complex_diag_matrix (); }
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
57
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
58 type_conv_info numeric_conversion_function (void) const;
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
59
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
60 type_conv_info numeric_demotion_function (void) const;
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
61
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
62 octave_base_value *try_narrowing_conversion (void);
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
63
9685
e793865ede63 implement builtin_type
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
64 builtin_type_t builtin_type (void) const { return btyp_complex; }
e793865ede63 implement builtin_type
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
65
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
66 bool is_complex_matrix (void) const { return true; }
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
67
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
68 bool is_complex_type (void) const { return true; }
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
69
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
70 bool is_double_type (void) const { return true; }
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
71
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
72 bool is_float_type (void) const { return true; }
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
73
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
74 DiagMatrix diag_matrix_value (bool = false) const;
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
75
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
76 FloatDiagMatrix float_diag_matrix_value (bool = false) const;
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
77
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
78 ComplexDiagMatrix complex_diag_matrix_value (bool = false) const;
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
79
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
80 FloatComplexDiagMatrix float_complex_diag_matrix_value (bool = false) const;
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
81
22296
8b18f46f6427 revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents: 22022
diff changeset
82 octave_value as_double (void) const;
8b18f46f6427 revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents: 22022
diff changeset
83 octave_value as_single (void) const;
8b18f46f6427 revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents: 22022
diff changeset
84
8381
ad896677a2e2 implement binary saving of diag & perm matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8366
diff changeset
85 bool save_binary (std::ostream& os, bool& save_as_floats);
ad896677a2e2 implement binary saving of diag & perm matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8366
diff changeset
86
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
87 bool load_binary (std::istream& is, bool swap,
21739
c4ab2e54f100 use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
88 octave::mach_info::float_format fmt);
8381
ad896677a2e2 implement binary saving of diag & perm matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8366
diff changeset
89
9812
f80c566bc751 improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents: 9685
diff changeset
90 octave_value map (unary_mapper_t umap) const;
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
91
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
92 private:
8398
d95282fa0579 allow element assignment to diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8381
diff changeset
93
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
94 bool chk_valid_scalar (const octave_value&,
8398
d95282fa0579 allow element assignment to diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8381
diff changeset
95 Complex&) const;
d95282fa0579 allow element assignment to diagonal matrices
Jaroslav Hajek <highegg@gmail.com>
parents: 8381
diff changeset
96
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
97 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
98 };
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
99
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
100 #endif