annotate src/OPERATORS/op-cm-m.cc @ 4915:c638c144d4da

[project @ 2004-07-23 19:01:22 by jwe]
author jwe
date Fri, 23 Jul 2004 19:01:23 +0000
parents c7ae43dfdea4
children 57077d0ddc8e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
1 /*
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
2
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
3 Copyright (C) 1996, 1997 John W. Eaton
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
4
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
6
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
10 later version.
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
11
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
15 for more details.
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
16
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
20
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
21 */
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
22
4192
5719210fff4c [project @ 2002-11-20 16:56:47 by jwe]
jwe
parents: 4066
diff changeset
23 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
24 #pragma implementation
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
25 #endif
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
26
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
27 #ifdef HAVE_CONFIG_H
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
28 #include <config.h>
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
29 #endif
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
30
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
31 #include "mx-cm-m.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
32 #include "mx-m-cm.h"
4544
74c92e375b54 [project @ 2003-10-23 23:48:29 by jwe]
jwe
parents: 4543
diff changeset
33 #include "mx-cnda-nda.h"
74c92e375b54 [project @ 2003-10-23 23:48:29 by jwe]
jwe
parents: 4543
diff changeset
34 #include "mx-nda-cnda.h"
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
35
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
36 #include "gripes.h"
4055
7690958e7726 [project @ 2002-08-18 01:56:58 by jwe]
jwe
parents: 3766
diff changeset
37 #include "oct-obj.h"
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
38 #include "ov.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
39 #include "ov-cx-mat.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
40 #include "ov-re-mat.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
41 #include "ov-typeinfo.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
42 #include "ops.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
43 #include "xdiv.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
44 #include "xpow.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
45
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
46 // complex matrix by matrix ops.
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
47
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
48 DEFNDBINOP_OP (add, complex_matrix, matrix, complex_array, array, +)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
49 DEFNDBINOP_OP (sub, complex_matrix, matrix, complex_array, array, -)
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4192
diff changeset
50
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
51 DEFBINOP_OP (mul, complex_matrix, matrix, *)
3766
df962bbf1788 [project @ 2001-01-29 14:33:07 by jwe]
jwe
parents: 3538
diff changeset
52 DEFBINOP_FN (div, complex_matrix, matrix, xdiv)
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
53
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
54 DEFBINOPX (pow, complex_matrix, matrix)
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
55 {
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
56 error ("can't do A ^ B for A and B both matrices");
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
57 return octave_value ();
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
58 }
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
59
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
60 DEFBINOP_FN (ldiv, complex_matrix, matrix, xleftdiv)
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
61
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
62 DEFNDBINOP_FN (lt, complex_matrix, matrix, complex_array, array, mx_el_lt)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
63 DEFNDBINOP_FN (le, complex_matrix, matrix, complex_array, array, mx_el_le)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
64 DEFNDBINOP_FN (eq, complex_matrix, matrix, complex_array, array, mx_el_eq)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
65 DEFNDBINOP_FN (ge, complex_matrix, matrix, complex_array, array, mx_el_ge)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
66 DEFNDBINOP_FN (gt, complex_matrix, matrix, complex_array, array, mx_el_gt)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
67 DEFNDBINOP_FN (ne, complex_matrix, matrix, complex_array, array, mx_el_ne)
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
68
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
69 DEFNDBINOP_FN (el_mul, complex_matrix, matrix, complex_array, array, product)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
70 DEFNDBINOP_FN (el_div, complex_matrix, matrix, complex_array, array, quotient)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
71 DEFNDBINOP_FN (el_pow, complex_matrix, matrix, complex_array, array, elem_xpow)
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
72
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
73 DEFBINOP (el_ldiv, complex_matrix, matrix)
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
74 {
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
75 CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_matrix&);
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
76
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
77 return quotient (v2.array_value (), v1.complex_array_value ());
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
78 }
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
79
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
80 DEFNDBINOP_FN (el_and, complex_matrix, matrix, complex_array, array, mx_el_and)
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4544
diff changeset
81 DEFNDBINOP_FN (el_or, complex_matrix, matrix, complex_array, array, mx_el_or)
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
82
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4686
diff changeset
83 DEFNDCATOP_FN (cm_m, complex_matrix, matrix, complex_array, array, concat)
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4686
diff changeset
84
4686
c7ae43dfdea4 [project @ 2004-01-06 19:29:23 by jwe]
jwe
parents: 4550
diff changeset
85 DEFNDASSIGNOP_FN (assign, complex_matrix, matrix, complex_array, assign)
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
86
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
87 void
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
88 install_cm_m_ops (void)
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
89 {
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
90 INSTALL_BINOP (op_add, octave_complex_matrix, octave_matrix, add);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
91 INSTALL_BINOP (op_sub, octave_complex_matrix, octave_matrix, sub);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
92 INSTALL_BINOP (op_mul, octave_complex_matrix, octave_matrix, mul);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
93 INSTALL_BINOP (op_div, octave_complex_matrix, octave_matrix, div);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
94 INSTALL_BINOP (op_pow, octave_complex_matrix, octave_matrix, pow);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
95 INSTALL_BINOP (op_ldiv, octave_complex_matrix, octave_matrix, ldiv);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
96 INSTALL_BINOP (op_lt, octave_complex_matrix, octave_matrix, lt);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
97 INSTALL_BINOP (op_le, octave_complex_matrix, octave_matrix, le);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
98 INSTALL_BINOP (op_eq, octave_complex_matrix, octave_matrix, eq);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
99 INSTALL_BINOP (op_ge, octave_complex_matrix, octave_matrix, ge);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
100 INSTALL_BINOP (op_gt, octave_complex_matrix, octave_matrix, gt);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
101 INSTALL_BINOP (op_ne, octave_complex_matrix, octave_matrix, ne);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
102 INSTALL_BINOP (op_el_mul, octave_complex_matrix, octave_matrix, el_mul);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
103 INSTALL_BINOP (op_el_div, octave_complex_matrix, octave_matrix, el_div);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
104 INSTALL_BINOP (op_el_pow, octave_complex_matrix, octave_matrix, el_pow);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
105 INSTALL_BINOP (op_el_ldiv, octave_complex_matrix, octave_matrix, el_ldiv);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
106 INSTALL_BINOP (op_el_and, octave_complex_matrix, octave_matrix, el_and);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
107 INSTALL_BINOP (op_el_or, octave_complex_matrix, octave_matrix, el_or);
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
108
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4686
diff changeset
109 INSTALL_CATOP (octave_complex_matrix, octave_matrix, cm_m);
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4686
diff changeset
110
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 2928
diff changeset
111 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_matrix, assign);
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
112 }
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
113
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
114 /*
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
115 ;;; Local Variables: ***
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
116 ;;; mode: C++ ***
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
117 ;;; End: ***
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
118 */