GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
op-fcdm-fcdm.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2008-2024 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 (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include "errwarn.h"
31 #include "ovl.h"
32 #include "ov.h"
33 #include "ov-flt-cx-mat.h"
34 #include "ov-flt-cx-diag.h"
35 #include "ov-cx-diag.h"
36 #include "ov-typeinfo.h"
37 #include "ops.h"
38 #include "xdiv.h"
39 #include "xpow.h"
40 
42 
43 // matrix unary ops.
44 
45 DEFUNOP_OP (uplus, float_complex_diag_matrix, /* no-op */)
46 DEFUNOP_OP (uminus, float_complex_diag_matrix, -)
47 
48 DEFUNOP (transpose, float_complex_diag_matrix)
49 {
51  return octave_value (v.float_complex_diag_matrix_value ().transpose ());
52 }
53 
54 DEFUNOP (hermitian, float_complex_diag_matrix)
55 {
57  return octave_value (v.float_complex_diag_matrix_value ().hermitian ());
58 }
59 
60 // matrix by matrix ops.
61 
62 DEFBINOP_OP (add, float_complex_diag_matrix, float_complex_diag_matrix, +)
63 DEFBINOP_OP (sub, float_complex_diag_matrix, float_complex_diag_matrix, -)
64 DEFBINOP_OP (mul, float_complex_diag_matrix, float_complex_diag_matrix, *)
65 
66 DEFBINOP (div, float_complex_diag_matrix, float_complex_diag_matrix)
67 {
70 
71  return xdiv (v1.float_complex_diag_matrix_value (),
73 }
74 
75 DEFBINOP (ldiv, float_complex_diag_matrix, float_complex_diag_matrix)
76 {
79 
80  return xleftdiv (v1.float_complex_diag_matrix_value (),
82 }
83 
84 CONVDECL (float_complex_diag_matrix_to_complex_diag_matrix)
85 {
87 
88  return new octave_complex_diag_matrix (v.complex_diag_matrix_value ());
89 }
90 
91 void
92 install_fcdm_fcdm_ops (octave::type_info& ti)
93 {
98 
109 
114  float_complex_diag_matrix_to_complex_diag_matrix);
115 }
116 
117 OCTAVE_END_NAMESPACE(octave)
virtual FloatComplexDiagMatrix float_complex_diag_matrix_value(bool=false) const
Definition: ov-base.cc:735
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void install_fcdm_fcdm_ops(octave::type_info &ti)
Definition: op-fcdm-fcdm.cc:92
const octave_base_value & a2
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
const octave_char_matrix & v2
#define DEFUNOP_OP(name, t, op)
Definition: ops.h:198
#define DEFBINOP(name, t1, t2)
Definition: ops.h:245
#define DEFBINOP_OP(name, t1, t2, op)
Definition: ops.h:250
#define INSTALL_ASSIGNCONV_TI(ti, t1, t2, tr)
Definition: ops.h:88
#define OCTAVE_CAST_BASE_VALUE(T, T_VAL, BASE_VAL)
Definition: ops.h:52
#define INSTALL_BINOP_TI(ti, op, t1, t2, f)
Definition: ops.h:70
#define INSTALL_WIDENOP_TI(ti, t1, t2, f)
Definition: ops.h:92
#define CONVDECL(name)
Definition: ops.h:183
#define DEFUNOP(name, t)
Definition: ops.h:194
#define INSTALL_UNOP_TI(ti, op, t, f)
Definition: ops.h:62
octave_value op_uplus(const octave_value &a)
Definition: ov.h:1634
octave_value op_add(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1663
octave_value op_uminus(const octave_value &a)
Definition: ov.h:1635
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1637
octave_value op_sub(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1664
octave_value op_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1665
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1638
octave_value op_ldiv(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1669
octave_value op_div(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1666
Matrix xdiv(const Matrix &a, const SparseMatrix &b, MatrixType &typ)
Definition: sparse-xdiv.cc:137
Matrix xleftdiv(const SparseMatrix &a, const Matrix &b, MatrixType &typ)
Definition: sparse-xdiv.cc:469