GNU Octave  3.8.0
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
op-fm-fcm.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2013 John W. Eaton
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 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 #include "mx-fm-fcm.h"
28 #include "mx-fcm-fm.h"
29 #include "mx-fnda-fcnda.h"
30 #include "mx-fcnda-fnda.h"
31 
32 #include "gripes.h"
33 #include "oct-obj.h"
34 #include "ov.h"
35 #include "ov-re-mat.h"
36 #include "ov-flt-re-mat.h"
37 #include "ov-cx-mat.h"
38 #include "ov-flt-cx-mat.h"
39 #include "ov-typeinfo.h"
40 #include "ops.h"
41 #include "xdiv.h"
42 #include "xpow.h"
43 
44 // matrix by complex matrix ops.
45 
46 DEFNDBINOP_OP (add, float_matrix, float_complex_matrix, float_array,
47  float_complex_array, +)
48 DEFNDBINOP_OP (sub, float_matrix, float_complex_matrix, float_array,
49  float_complex_array, -)
50 
51 DEFBINOP_OP (mul, float_matrix, float_complex_matrix, *)
52 
53 DEFBINOP (trans_mul, float_matrix, float_complex_matrix)
54 {
57 
60 
62  xgemm (m1, imag (m2), blas_trans, blas_no_trans));
63 }
64 
65 DEFBINOP (div, float_matrix, float_complex_matrix)
66 {
69  MatrixType typ = v2.matrix_type ();
70 
73 
74  v2.matrix_type (typ);
75  return ret;
76 }
77 
78 DEFBINOPX (pow, float_matrix, float_complex_matrix)
79 {
80  error ("can't do A ^ B for A and B both matrices");
81  return octave_value ();
82 }
83 
84 DEFBINOP (ldiv, float_matrix, float_complex_matrix)
85 {
88  MatrixType typ = v1.matrix_type ();
89 
92 
93  v1.matrix_type (typ);
94  return ret;
95 }
96 
97 DEFBINOP (trans_ldiv, float_matrix, float_complex_matrix)
98 {
101  MatrixType typ = v1.matrix_type ();
102 
105  typ, blas_trans);
106 
107  v1.matrix_type (typ);
108  return ret;
109 }
110 
111 DEFNDCMPLXCMPOP_FN (lt, float_matrix, float_complex_matrix, float_array,
112  float_complex_array, mx_el_lt)
113 DEFNDCMPLXCMPOP_FN (le, float_matrix, float_complex_matrix, float_array,
114  float_complex_array, mx_el_le)
115 DEFNDCMPLXCMPOP_FN (eq, float_matrix, float_complex_matrix, float_array,
116  float_complex_array, mx_el_eq)
117 DEFNDCMPLXCMPOP_FN (ge, float_matrix, float_complex_matrix, float_array,
118  float_complex_array, mx_el_ge)
119 DEFNDCMPLXCMPOP_FN (gt, float_matrix, float_complex_matrix, float_array,
120  float_complex_array, mx_el_gt)
121 DEFNDCMPLXCMPOP_FN (ne, float_matrix, float_complex_matrix, float_array,
122  float_complex_array, mx_el_ne)
123 
124 DEFNDBINOP_FN (el_mul, float_matrix, float_complex_matrix, float_array,
125  float_complex_array, product)
126 DEFNDBINOP_FN (el_div, float_matrix, float_complex_matrix, float_array,
127  float_complex_array, quotient)
128 DEFNDBINOP_FN (el_pow, float_matrix, float_complex_matrix, float_array,
129  float_complex_array, elem_xpow)
130 
131 DEFBINOP (el_ldiv, float_matrix, float_complex_matrix)
132 {
135 
137 }
138 
139 DEFNDBINOP_FN (el_and, float_matrix, float_complex_matrix, float_array,
140  float_complex_array, mx_el_and)
141 DEFNDBINOP_FN (el_or, float_matrix, float_complex_matrix, float_array,
142  float_complex_array, mx_el_or)
143 
144 DEFNDCATOP_FN (fm_fcm, float_matrix, float_complex_matrix, float_array,
145  float_complex_array, concat)
146 
147 DEFNDCATOP_FN (m_fcm, matrix, float_complex_matrix, float_array,
148  float_complex_array, concat)
149 
150 DEFNDCATOP_FN (fm_cm, float_matrix, complex_matrix, float_array,
151  float_complex_array, concat)
152 
153 DEFCONV (float_complex_matrix_conv, float_matrix, float_complex_matrix)
154 {
156 
158  (v.float_array_value ()));
159 }
160 
161 void
163 {
184  octave_float_complex_matrix, el_ldiv);
194  octave_float_complex_matrix, trans_ldiv);
196  octave_float_complex_matrix, trans_ldiv);
197 
201 
206 
208  float_complex_matrix_conv);
209 }