GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ov-re-diag.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2008-2025 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_re_diag_h)
27#define octave_ov_re_diag_h 1
28
29#include "octave-config.h"
30
31#include "ov-base.h"
32#include "ov-base-diag.h"
33#include "ov-re-mat.h"
34#include "ov-typeinfo.h"
35
36// Real diagonal matrix values.
37
38extern template class OCTINTERP_EXTERN_TEMPLATE_API
40
41class OCTINTERP_API octave_diag_matrix
43{
44public:
45
48
51
54
55 ~octave_diag_matrix () = default;
56
58 { return new octave_diag_matrix (*this); }
60 { return new octave_diag_matrix (); }
61
62 type_conv_info numeric_conversion_function () const;
63
64 type_conv_info numeric_demotion_function () const;
65
66 octave_base_value * try_narrowing_conversion ();
67
68 octave_value do_index_op (const octave_value_list& idx,
69 bool resize_ok = false);
70
72
73 bool is_real_matrix () const { return true; }
74
75 bool isreal () const { return true; }
76
77 bool is_double_type () const { return true; }
78
79 bool isfloat () const { return true; }
80
81 DiagMatrix diag_matrix_value (bool = false) const;
82
83 FloatDiagMatrix float_diag_matrix_value (bool = false) const;
84
85 ComplexDiagMatrix complex_diag_matrix_value (bool = false) const;
86
87 FloatComplexDiagMatrix float_complex_diag_matrix_value (bool = false) const;
88
89 octave_value as_double () const;
90 octave_value as_single () const;
91
92 octave_value as_int8 () const;
93 octave_value as_int16 () const;
94 octave_value as_int32 () const;
95 octave_value as_int64 () const;
96
97 octave_value as_uint8 () const;
98 octave_value as_uint16 () const;
99 octave_value as_uint32 () const;
100 octave_value as_uint64 () const;
101
102 bool save_binary (std::ostream& os, bool save_as_floats);
103
104 bool load_binary (std::istream& is, bool swap,
105 octave::mach_info::float_format fmt);
106
107 octave_value map (unary_mapper_t umap) const;
108
109private:
110
111 bool chk_valid_scalar (const octave_value&,
112 double&) const;
113
115};
116
117#endif
octave_diag_matrix(const DiagMatrix &m)
Definition ov-re-diag.h:49
~octave_diag_matrix()=default
builtin_type_t builtin_type() const
Definition ov-re-diag.h:71
bool isreal() const
Definition ov-re-diag.h:75
bool is_real_matrix() const
Definition ov-re-diag.h:73
bool isfloat() const
Definition ov-re-diag.h:79
octave_diag_matrix(const octave_diag_matrix &m)
Definition ov-re-diag.h:52
octave_base_value * empty_clone() const
Definition ov-re-diag.h:59
bool is_double_type() const
Definition ov-re-diag.h:77
octave_base_value * clone() const
Definition ov-re-diag.h:57
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API(API)
Definition ov-base.h:185
builtin_type_t
Definition ov-base.h:83
@ btyp_double
Definition ov-base.h:84