GNU Octave  4.4.1
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-2018 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
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License 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 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_ov_cx_diag_h)
24 #define octave_ov_cx_diag_h 1
25 
26 #include "octave-config.h"
27 
28 #include "ov-base.h"
29 #include "ov-base-diag.h"
30 #include "ov-cx-mat.h"
31 #include "ov-typeinfo.h"
32 
33 // Real diagonal matrix values.
34 
35 class
36 OCTINTERP_API
39 {
40 public:
41 
44 
47 
50 
51  ~octave_complex_diag_matrix (void) = default;
52 
53  octave_base_value * clone (void) const
54  { return new octave_complex_diag_matrix (*this); }
56  { return new octave_complex_diag_matrix (); }
57 
58  type_conv_info numeric_conversion_function (void) const;
59 
60  type_conv_info numeric_demotion_function (void) const;
61 
62  octave_base_value * try_narrowing_conversion (void);
63 
64  builtin_type_t builtin_type (void) const { return btyp_complex; }
65 
66  bool is_complex_matrix (void) const { return true; }
67 
68  bool iscomplex (void) const { return true; }
69 
70  bool is_double_type (void) const { return true; }
71 
72  bool isfloat (void) const { return true; }
73 
74  DiagMatrix diag_matrix_value (bool = false) const;
75 
76  FloatDiagMatrix float_diag_matrix_value (bool = false) const;
77 
78  ComplexDiagMatrix complex_diag_matrix_value (bool = false) const;
79 
80  FloatComplexDiagMatrix float_complex_diag_matrix_value (bool = false) const;
81 
82  octave_value as_double (void) const;
83  octave_value as_single (void) const;
84 
85  bool save_binary (std::ostream& os, bool& save_as_floats);
86 
87  bool load_binary (std::istream& is, bool swap,
89 
90  octave_value map (unary_mapper_t umap) const;
91 
92 private:
93 
94  bool chk_valid_scalar (const octave_value&,
95  Complex&) const;
96 
98 };
99 
100 #endif
octave_complex_diag_matrix(const octave_complex_diag_matrix &m)
Definition: ov-cx-diag.h:48
octave_base_value * empty_clone(void) const
Definition: ov-cx-diag.h:55
builtin_type_t
Definition: ov-base.h:71
bool iscomplex(void) const
Definition: ov-cx-diag.h:68
static double as_double(time_t sec, long usec)
Definition: oct-time.h:34
bool swap
Definition: load-save.cc:738
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:158
builtin_type_t builtin_type(void) const
Definition: ov-cx-diag.h:64
octave_base_value * clone(void) const
Definition: ov-cx-diag.h:53
bool save_as_floats
Definition: load-save.cc:1617
bool is_complex_matrix(void) const
Definition: ov-cx-diag.h:66
octave_map map(dims)
bool isfloat(void) const
Definition: ov-cx-diag.h:72
octave_complex_diag_matrix(const ComplexDiagMatrix &m)
Definition: ov-cx-diag.h:45
std::complex< double > Complex
Definition: oct-cmplx.h:31
bool is_double_type(void) const
Definition: ov-cx-diag.h:70
write the output to stdout if nargout is
Definition: load-save.cc:1612
octave::stream os
Definition: file-io.cc:627