GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ov-re-diag.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2008-2017 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_ov_re_diag_h)
24 #define octave_ov_re_diag_h 1
25 
26 #include "octave-config.h"
27 
28 #include "ov-base.h"
29 #include "ov-base-diag.h"
30 #include "ov-re-mat.h"
31 #include "ov-typeinfo.h"
32 
33 // Real diagonal matrix values.
34 
35 class
39 {
40 public:
41 
44 
47 
50 
52 
53  octave_base_value *clone (void) const
54  { return new octave_diag_matrix (*this); }
56  { return new octave_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  octave_value do_index_op (const octave_value_list& idx,
65  bool resize_ok = false);
66 
67  builtin_type_t builtin_type (void) const { return btyp_double; }
68 
69  bool is_real_matrix (void) const { return true; }
70 
71  bool is_real_type (void) const { return true; }
72 
73  bool is_double_type (void) const { return true; }
74 
75  bool is_float_type (void) const { return true; }
76 
77  DiagMatrix diag_matrix_value (bool = false) const;
78 
79  FloatDiagMatrix float_diag_matrix_value (bool = false) const;
80 
81  ComplexDiagMatrix complex_diag_matrix_value (bool = false) const;
82 
83  FloatComplexDiagMatrix float_complex_diag_matrix_value (bool = false) const;
84 
85  octave_value as_double (void) const;
86  octave_value as_single (void) const;
87 
88  octave_value as_int8 (void) const;
89  octave_value as_int16 (void) const;
90  octave_value as_int32 (void) const;
91  octave_value as_int64 (void) const;
92 
93  octave_value as_uint8 (void) const;
94  octave_value as_uint16 (void) const;
95  octave_value as_uint32 (void) const;
96  octave_value as_uint64 (void) const;
97 
98  bool save_binary (std::ostream& os, bool& save_as_floats);
99 
100  bool load_binary (std::istream& is, bool swap,
102 
103  octave_value map (unary_mapper_t umap) const;
104 
105 private:
106 
107  bool chk_valid_scalar (const octave_value&,
108  double&) const;
109 
111 };
112 
113 #endif
octave_diag_matrix(void)
Definition: ov-re-diag.h:42
octave_base_value * empty_clone(void) const
Definition: ov-re-diag.h:55
builtin_type_t
Definition: ov-base.h:61
bool is_real_matrix(void) const
Definition: ov-re-diag.h:69
octave_base_value * clone(void) const
Definition: ov-re-diag.h:53
bool swap
Definition: load-save.cc:725
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:148
#define OCTINTERP_API
Definition: mexproto.h:69
nd deftypefn *octave_map m
Definition: ov-struct.cc:2058
bool save_as_floats
Definition: load-save.cc:1581
Definition: dMatrix.h:37
~octave_diag_matrix(void)
Definition: ov-re-diag.h:51
builtin_type_t builtin_type(void) const
Definition: ov-re-diag.h:67
octave_diag_matrix(const DiagMatrix &m)
Definition: ov-re-diag.h:45
bool is_float_type(void) const
Definition: ov-re-diag.h:75
bool is_real_type(void) const
Definition: ov-re-diag.h:71
octave_map map(dims)
octave_diag_matrix(const octave_diag_matrix &m)
Definition: ov-re-diag.h:48
bool is_double_type(void) const
Definition: ov-re-diag.h:73
write the output to stdout if nargout is
Definition: load-save.cc:1576