2928
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 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 2, or (at your option) any |
|
10 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, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
4192
|
23 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
2928
|
24 #pragma implementation |
|
25 #endif |
|
26 |
|
27 #ifdef HAVE_CONFIG_H |
|
28 #include <config.h> |
|
29 #endif |
|
30 |
|
31 #include "mx-cm-m.h" |
|
32 #include "mx-m-cm.h" |
4544
|
33 #include "mx-cnda-nda.h" |
|
34 #include "mx-nda-cnda.h" |
2928
|
35 |
|
36 #include "gripes.h" |
4055
|
37 #include "oct-obj.h" |
2928
|
38 #include "ov.h" |
|
39 #include "ov-cx-mat.h" |
|
40 #include "ov-re-mat.h" |
|
41 #include "ov-typeinfo.h" |
|
42 #include "ops.h" |
|
43 #include "xdiv.h" |
|
44 #include "xpow.h" |
|
45 |
|
46 // complex matrix by matrix ops. |
|
47 |
4543
|
48 DEFNDBINOP_OP (add, complex_matrix, matrix, array, array, +) |
|
49 DEFNDBINOP_OP (sub, complex_matrix, matrix, array, array, -) |
|
50 |
2928
|
51 DEFBINOP_OP (mul, complex_matrix, matrix, *) |
3766
|
52 DEFBINOP_FN (div, complex_matrix, matrix, xdiv) |
2928
|
53 |
|
54 DEFBINOPX (pow, complex_matrix, matrix) |
|
55 { |
|
56 error ("can't do A ^ B for A and B both matrices"); |
|
57 return octave_value (); |
|
58 } |
|
59 |
|
60 DEFBINOP_FN (ldiv, complex_matrix, matrix, xleftdiv) |
|
61 |
4543
|
62 DEFNDBINOP_FN (lt, complex_matrix, matrix, array, array, mx_el_lt) |
|
63 DEFNDBINOP_FN (le, complex_matrix, matrix, array, array, mx_el_le) |
|
64 DEFNDBINOP_FN (eq, complex_matrix, matrix, array, array, mx_el_eq) |
|
65 DEFNDBINOP_FN (ge, complex_matrix, matrix, array, array, mx_el_ge) |
|
66 DEFNDBINOP_FN (gt, complex_matrix, matrix, array, array, mx_el_gt) |
|
67 DEFNDBINOP_FN (ne, complex_matrix, matrix, array, array, mx_el_ne) |
2928
|
68 |
4543
|
69 DEFNDBINOP_FN (el_mul, complex_matrix, matrix, array, array, product) |
|
70 DEFNDBINOP_FN (el_div, complex_matrix, matrix, array, array, quotient) |
|
71 DEFNDBINOP_FN (el_pow, complex_matrix, matrix, array, array, elem_xpow) |
2928
|
72 |
|
73 DEFBINOP (el_ldiv, complex_matrix, matrix) |
|
74 { |
|
75 CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_matrix&); |
|
76 |
4543
|
77 return quotient (v2.array_value (), v1.array_value ()); |
2928
|
78 } |
|
79 |
4543
|
80 DEFNDBINOP_FN (el_and, complex_matrix, matrix, array, array, mx_el_and) |
|
81 DEFNDBINOP_FN (el_or, complex_matrix, matrix, array, array, mx_el_or) |
2928
|
82 |
|
83 DEFASSIGNOP_FN (assign, complex_matrix, matrix, assign) |
|
84 |
|
85 void |
|
86 install_cm_m_ops (void) |
|
87 { |
3538
|
88 INSTALL_BINOP (op_add, octave_complex_matrix, octave_matrix, add); |
|
89 INSTALL_BINOP (op_sub, octave_complex_matrix, octave_matrix, sub); |
|
90 INSTALL_BINOP (op_mul, octave_complex_matrix, octave_matrix, mul); |
|
91 INSTALL_BINOP (op_div, octave_complex_matrix, octave_matrix, div); |
|
92 INSTALL_BINOP (op_pow, octave_complex_matrix, octave_matrix, pow); |
|
93 INSTALL_BINOP (op_ldiv, octave_complex_matrix, octave_matrix, ldiv); |
|
94 INSTALL_BINOP (op_lt, octave_complex_matrix, octave_matrix, lt); |
|
95 INSTALL_BINOP (op_le, octave_complex_matrix, octave_matrix, le); |
|
96 INSTALL_BINOP (op_eq, octave_complex_matrix, octave_matrix, eq); |
|
97 INSTALL_BINOP (op_ge, octave_complex_matrix, octave_matrix, ge); |
|
98 INSTALL_BINOP (op_gt, octave_complex_matrix, octave_matrix, gt); |
|
99 INSTALL_BINOP (op_ne, octave_complex_matrix, octave_matrix, ne); |
|
100 INSTALL_BINOP (op_el_mul, octave_complex_matrix, octave_matrix, el_mul); |
|
101 INSTALL_BINOP (op_el_div, octave_complex_matrix, octave_matrix, el_div); |
|
102 INSTALL_BINOP (op_el_pow, octave_complex_matrix, octave_matrix, el_pow); |
|
103 INSTALL_BINOP (op_el_ldiv, octave_complex_matrix, octave_matrix, el_ldiv); |
|
104 INSTALL_BINOP (op_el_and, octave_complex_matrix, octave_matrix, el_and); |
|
105 INSTALL_BINOP (op_el_or, octave_complex_matrix, octave_matrix, el_or); |
2928
|
106 |
3538
|
107 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_matrix, assign); |
2928
|
108 } |
|
109 |
|
110 /* |
|
111 ;;; Local Variables: *** |
|
112 ;;; mode: C++ *** |
|
113 ;;; End: *** |
|
114 */ |