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-fcm-fs.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-cm-s.h"
28 #include "mx-cnda-s.h"
29 
30 #include "gripes.h"
31 #include "oct-obj.h"
32 #include "ov.h"
33 #include "ov-cx-mat.h"
34 #include "ov-flt-cx-mat.h"
35 #include "ov-flt-re-mat.h"
36 #include "ov-float.h"
37 #include "ov-scalar.h"
38 #include "ov-typeinfo.h"
39 #include "ops.h"
40 #include "xdiv.h"
41 #include "xpow.h"
42 
43 // complex matrix by scalar ops.
44 
45 DEFNDBINOP_OP (add, float_complex_matrix, float_scalar, float_complex_array,
46  float_scalar, +)
47 DEFNDBINOP_OP (sub, float_complex_matrix, float_scalar, float_complex_array,
48  float_scalar, -)
49 DEFNDBINOP_OP (mul, float_complex_matrix, float_scalar, float_complex_array,
50  float_scalar, *)
51 
52 DEFBINOP (div, float_complex_matrix, float)
53 {
55  const octave_float_scalar&);
56 
57  float d = v2.float_value ();
58 
59  if (d == 0.0)
61 
63 }
64 
65 DEFBINOP_FN (pow, float_complex_matrix, float_scalar, xpow)
66 
67 DEFBINOP (ldiv, float_complex_matrix, float)
68 {
70  const octave_float_scalar&);
71 
74  MatrixType typ = v1.matrix_type ();
75 
76  FloatComplexMatrix ret = xleftdiv (m1, m2, typ);
77 
78  v1.matrix_type (typ);
79  return ret;
80 }
81 
82 DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_scalar, float_complex_array,
83  float_scalar, mx_el_lt)
84 DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_scalar, float_complex_array,
85  float_scalar, mx_el_le)
86 DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_scalar, float_complex_array,
87  float_scalar, mx_el_eq)
88 DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_scalar, float_complex_array,
89  float_scalar, mx_el_ge)
90 DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_scalar, float_complex_array,
91  float_scalar, mx_el_gt)
92 DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_scalar, float_complex_array,
93  float_scalar, mx_el_ne)
94 
95 DEFNDBINOP_OP (el_mul, float_complex_matrix, float_scalar, float_complex_array,
96  float_scalar, *)
97 
98 DEFBINOP (el_div, float_complex_matrix, float)
99 {
101  const octave_float_scalar&);
102 
103  float d = v2.float_value ();
104 
105  if (d == 0.0)
107 
109 }
110 
111 DEFNDBINOP_FN (el_pow, float_complex_matrix, float_scalar, float_complex_array,
112  float_scalar, elem_xpow)
113 
114 DEFBINOP (el_ldiv, float_complex_matrix, float)
115 {
117  const octave_float_scalar&);
118 
120 }
121 
122 DEFNDBINOP_FN (el_and, float_complex_matrix, float_scalar, float_complex_array,
123  float_scalar, mx_el_and)
124 DEFNDBINOP_FN (el_or, float_complex_matrix, float_scalar, float_complex_array,
125  float_scalar, mx_el_or)
126 
127 DEFNDCATOP_FN (fcm_fs, float_complex_matrix, float_scalar, float_complex_array,
128  float_array, concat)
129 
130 DEFNDCATOP_FN (cm_fs, complex_matrix, float_scalar, float_complex_array,
131  float_array, concat)
132 
133 DEFNDCATOP_FN (fcm_s, float_complex_matrix, scalar, float_complex_array,
134  float_array, concat)
135 
136 DEFNDASSIGNOP_FN (assign, float_complex_matrix, float_scalar,
137  float_complex_array, assign)
138 DEFNDASSIGNOP_FN (dbl_assign, complex_matrix, float_scalar, complex_array,
139  assign)
140 
141 DEFNDASSIGNOP_OP (assign_mul, float_complex_matrix, float_scalar,
142  float_scalar, *=)
143 DEFNDASSIGNOP_OP (assign_div, float_complex_matrix, float_scalar,
144  float_scalar, /=)
145 
146 void
148 {
155  ldiv);
163  el_mul);
165  el_div);
167  el_pow);
169  el_ldiv);
171  el_and);
173  el_or);
174 
178 
180  octave_float_scalar, assign);
182  octave_float_scalar, dbl_assign);
183 
185  octave_float_scalar, assign_mul);
187  octave_float_scalar, assign_div);
188 }