GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-cx-diag.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2008-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_ov_cx_diag_h)
27#define octave_ov_cx_diag_h 1
28
29#include "octave-config.h"
30
31#include "ov-base.h"
32#include "ov-base-diag.h"
33#include "ov-cx-mat.h"
34#include "ov-typeinfo.h"
35
36// Real diagonal matrix values.
37
38class
41{
42public:
43
46
49
52
54
55 octave_base_value * clone (void) const
56 { return new octave_complex_diag_matrix (*this); }
58 { return new octave_complex_diag_matrix (); }
59
60 OCTINTERP_API type_conv_info numeric_conversion_function (void) const;
61
62 OCTINTERP_API type_conv_info numeric_demotion_function (void) const;
63
64 OCTINTERP_API octave_base_value * try_narrowing_conversion (void);
65
66 builtin_type_t builtin_type (void) const { return btyp_complex; }
67
68 bool is_complex_matrix (void) const { return true; }
69
70 bool iscomplex (void) const { return true; }
71
72 bool is_double_type (void) const { return true; }
73
74 bool isfloat (void) const { return true; }
75
76 OCTINTERP_API DiagMatrix diag_matrix_value (bool = false) const;
77
78 OCTINTERP_API FloatDiagMatrix float_diag_matrix_value (bool = false) const;
79
80 OCTINTERP_API ComplexDiagMatrix
81 complex_diag_matrix_value (bool = false) const;
82
83 OCTINTERP_API FloatComplexDiagMatrix
84 float_complex_diag_matrix_value (bool = false) const;
85
86 OCTINTERP_API octave_value as_double (void) const;
87 OCTINTERP_API octave_value as_single (void) const;
88
89 OCTINTERP_API bool save_binary (std::ostream& os, bool save_as_floats);
90
91 OCTINTERP_API bool
92 load_binary (std::istream& is, bool swap,
94
95 OCTINTERP_API octave_value map (unary_mapper_t umap) const;
96
97private:
98
99 OCTINTERP_API bool chk_valid_scalar (const octave_value&, Complex&) const;
100
102};
103
104#endif
bool is_complex_matrix(void) const
Definition: ov-cx-diag.h:68
~octave_complex_diag_matrix(void)=default
builtin_type_t builtin_type(void) const
Definition: ov-cx-diag.h:66
octave_complex_diag_matrix(const octave_complex_diag_matrix &m)
Definition: ov-cx-diag.h:50
bool iscomplex(void) const
Definition: ov-cx-diag.h:70
octave_complex_diag_matrix(const ComplexDiagMatrix &m)
Definition: ov-cx-diag.h:47
octave_base_value * clone(void) const
Definition: ov-cx-diag.h:55
octave_base_value * empty_clone(void) const
Definition: ov-cx-diag.h:57
bool isfloat(void) const
Definition: ov-cx-diag.h:74
bool is_double_type(void) const
Definition: ov-cx-diag.h:72
std::complex< double > Complex
Definition: oct-cmplx.h:33
static double as_double(OCTAVE_TIME_T sec, long usec)
Definition: oct-time.h:35
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:173
builtin_type_t
Definition: ov-base.h:75
@ btyp_complex
Definition: ov-base.h:78