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" |
|
33 |
|
34 #include "gripes.h" |
4055
|
35 #include "oct-obj.h" |
2928
|
36 #include "ov.h" |
|
37 #include "ov-cx-mat.h" |
|
38 #include "ov-re-mat.h" |
|
39 #include "ov-typeinfo.h" |
|
40 #include "ops.h" |
|
41 #include "xdiv.h" |
|
42 #include "xpow.h" |
|
43 |
|
44 // complex matrix by matrix ops. |
|
45 |
|
46 DEFBINOP_OP (add, complex_matrix, matrix, +) |
|
47 DEFBINOP_OP (sub, complex_matrix, matrix, -) |
|
48 DEFBINOP_OP (mul, complex_matrix, matrix, *) |
3766
|
49 DEFBINOP_FN (div, complex_matrix, matrix, xdiv) |
2928
|
50 |
|
51 DEFBINOPX (pow, complex_matrix, matrix) |
|
52 { |
|
53 error ("can't do A ^ B for A and B both matrices"); |
|
54 return octave_value (); |
|
55 } |
|
56 |
|
57 DEFBINOP_FN (ldiv, complex_matrix, matrix, xleftdiv) |
|
58 |
|
59 DEFBINOP_FN (lt, complex_matrix, matrix, mx_el_lt) |
|
60 DEFBINOP_FN (le, complex_matrix, matrix, mx_el_le) |
|
61 DEFBINOP_FN (eq, complex_matrix, matrix, mx_el_eq) |
|
62 DEFBINOP_FN (ge, complex_matrix, matrix, mx_el_ge) |
|
63 DEFBINOP_FN (gt, complex_matrix, matrix, mx_el_gt) |
|
64 DEFBINOP_FN (ne, complex_matrix, matrix, mx_el_ne) |
|
65 |
|
66 DEFBINOP_FN (el_mul, complex_matrix, matrix, product) |
|
67 DEFBINOP_FN (el_div, complex_matrix, matrix, quotient) |
|
68 DEFBINOP_FN (el_pow, complex_matrix, matrix, elem_xpow) |
|
69 |
|
70 DEFBINOP (el_ldiv, complex_matrix, matrix) |
|
71 { |
|
72 CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_matrix&); |
|
73 |
|
74 return quotient (v2.matrix_value (), v1.complex_matrix_value ()); |
|
75 } |
|
76 |
|
77 DEFBINOP_FN (el_and, complex_matrix, matrix, mx_el_and) |
|
78 DEFBINOP_FN (el_or, complex_matrix, matrix, mx_el_or) |
|
79 |
|
80 DEFASSIGNOP_FN (assign, complex_matrix, matrix, assign) |
|
81 |
|
82 void |
|
83 install_cm_m_ops (void) |
|
84 { |
3538
|
85 INSTALL_BINOP (op_add, octave_complex_matrix, octave_matrix, add); |
|
86 INSTALL_BINOP (op_sub, octave_complex_matrix, octave_matrix, sub); |
|
87 INSTALL_BINOP (op_mul, octave_complex_matrix, octave_matrix, mul); |
|
88 INSTALL_BINOP (op_div, octave_complex_matrix, octave_matrix, div); |
|
89 INSTALL_BINOP (op_pow, octave_complex_matrix, octave_matrix, pow); |
|
90 INSTALL_BINOP (op_ldiv, octave_complex_matrix, octave_matrix, ldiv); |
|
91 INSTALL_BINOP (op_lt, octave_complex_matrix, octave_matrix, lt); |
|
92 INSTALL_BINOP (op_le, octave_complex_matrix, octave_matrix, le); |
|
93 INSTALL_BINOP (op_eq, octave_complex_matrix, octave_matrix, eq); |
|
94 INSTALL_BINOP (op_ge, octave_complex_matrix, octave_matrix, ge); |
|
95 INSTALL_BINOP (op_gt, octave_complex_matrix, octave_matrix, gt); |
|
96 INSTALL_BINOP (op_ne, octave_complex_matrix, octave_matrix, ne); |
|
97 INSTALL_BINOP (op_el_mul, octave_complex_matrix, octave_matrix, el_mul); |
|
98 INSTALL_BINOP (op_el_div, octave_complex_matrix, octave_matrix, el_div); |
|
99 INSTALL_BINOP (op_el_pow, octave_complex_matrix, octave_matrix, el_pow); |
|
100 INSTALL_BINOP (op_el_ldiv, octave_complex_matrix, octave_matrix, el_ldiv); |
|
101 INSTALL_BINOP (op_el_and, octave_complex_matrix, octave_matrix, el_and); |
|
102 INSTALL_BINOP (op_el_or, octave_complex_matrix, octave_matrix, el_or); |
2928
|
103 |
3538
|
104 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_matrix, assign); |
2928
|
105 } |
|
106 |
|
107 /* |
|
108 ;;; Local Variables: *** |
|
109 ;;; mode: C++ *** |
|
110 ;;; End: *** |
|
111 */ |