annotate src/OPERATORS/op-m-m.cc @ 8982:dc6bda6f9994

implement compound logical ops
author Jaroslav Hajek <highegg@gmail.com>
date Sat, 14 Mar 2009 23:08:08 +0100
parents eb63fbe60fab
children 6769599e3458
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
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8150
diff changeset
4 2006, 2007, 2008 John W. Eaton
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
5
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
7
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
8 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
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5785
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5785
diff changeset
11 option) any later version.
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
12
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
13 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
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
15 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
16 for more details.
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
17
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5785
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5785
diff changeset
20 <http://www.gnu.org/licenses/>.
2928
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 */
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
23
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
25 #include <config.h>
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
26 #endif
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
27
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
28 #include "gripes.h"
4055
7690958e7726 [project @ 2002-08-18 01:56:58 by jwe]
jwe
parents: 3766
diff changeset
29 #include "oct-obj.h"
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
30 #include "ov.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
31 #include "ov-re-mat.h"
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
32 #include "ov-flt-re-mat.h"
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
33 #include "ov-typeinfo.h"
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7800
diff changeset
34 #include "ov-null-mat.h"
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
35 #include "ops.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
36 #include "xdiv.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
37 #include "xpow.h"
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
38
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
39 // matrix unary ops.
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
40
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4543
diff changeset
41 DEFNDUNOP_OP (not, matrix, array, !)
4965
c0d8e8afa82f [project @ 2004-09-06 20:19:57 by jwe]
jwe
parents: 4915
diff changeset
42 DEFNDUNOP_OP (uplus, matrix, array, /* no-op */)
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4543
diff changeset
43 DEFNDUNOP_OP (uminus, matrix, array, -)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
44
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
45 DEFUNOP (transpose, matrix)
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
46 {
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
47 CAST_UNOP_ARG (const octave_matrix&);
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
48
4673
6639c2574023 [project @ 2003-12-10 16:11:54 by jwe]
jwe
parents: 4550
diff changeset
49 if (v.ndims () > 2)
6639c2574023 [project @ 2003-12-10 16:11:54 by jwe]
jwe
parents: 4550
diff changeset
50 {
6639c2574023 [project @ 2003-12-10 16:11:54 by jwe]
jwe
parents: 4550
diff changeset
51 error ("transpose not defined for N-d objects");
6639c2574023 [project @ 2003-12-10 16:11:54 by jwe]
jwe
parents: 4550
diff changeset
52 return octave_value ();
6639c2574023 [project @ 2003-12-10 16:11:54 by jwe]
jwe
parents: 4550
diff changeset
53 }
6639c2574023 [project @ 2003-12-10 16:11:54 by jwe]
jwe
parents: 4550
diff changeset
54 else
6639c2574023 [project @ 2003-12-10 16:11:54 by jwe]
jwe
parents: 4550
diff changeset
55 return octave_value (v.matrix_value().transpose ());
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
56 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
57
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
58 DEFNCUNOP_METHOD (incr, matrix, increment)
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
59 DEFNCUNOP_METHOD (decr, matrix, decrement)
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
60
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
61 // matrix by matrix ops.
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
62
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
63 DEFNDBINOP_OP (add, matrix, matrix, array, array, +)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
64 DEFNDBINOP_OP (sub, matrix, matrix, array, array, -)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
65
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
66 DEFBINOP_OP (mul, matrix, matrix, *)
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
67
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
68 DEFBINOP (div, matrix, matrix)
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
69 {
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
70 CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&);
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
71 MatrixType typ = v2.matrix_type ();
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
72
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
73 Matrix ret = xdiv (v1.matrix_value (), v2.matrix_value (), typ);
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
74
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
75 v2.matrix_type (typ);
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
76 return ret;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
77 }
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 DEFBINOPX (pow, matrix, matrix)
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
80 {
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
81 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
82 return octave_value ();
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
83 }
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
84
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
85 DEFBINOP (ldiv, matrix, matrix)
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
86 {
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
87 CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&);
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
88 MatrixType typ = v1.matrix_type ();
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
89
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
90 Matrix ret = xleftdiv (v1.matrix_value (), v2.matrix_value (), typ);
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
91
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
92 v1.matrix_type (typ);
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
93 return ret;
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5307
diff changeset
94 }
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
95
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
96 DEFBINOP (trans_mul, matrix, matrix)
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
97 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
98 CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
99 return octave_value(xgemm (true, v1.matrix_value (), false, v2.matrix_value ()));
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
100 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
101
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
102 DEFBINOP (mul_trans, matrix, matrix)
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
103 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
104 CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
105 return octave_value(xgemm (false, v1.matrix_value (), true, v2.matrix_value ()));
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
106 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
107
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
108 DEFNDBINOP_FN (lt, matrix, matrix, array, array, mx_el_lt)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
109 DEFNDBINOP_FN (le, matrix, matrix, array, array, mx_el_le)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
110 DEFNDBINOP_FN (eq, matrix, matrix, array, array, mx_el_eq)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
111 DEFNDBINOP_FN (ge, matrix, matrix, array, array, mx_el_ge)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
112 DEFNDBINOP_FN (gt, matrix, matrix, array, array, mx_el_gt)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
113 DEFNDBINOP_FN (ne, matrix, matrix, array, array, mx_el_ne)
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
114
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
115 DEFNDBINOP_FN (el_mul, matrix, matrix, array, array, product)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
116 DEFNDBINOP_FN (el_div, matrix, matrix, array, array, quotient)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
117 DEFNDBINOP_FN (el_pow, matrix, matrix, array, array, elem_xpow)
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
118
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
119 DEFBINOP (el_ldiv, matrix, matrix)
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
120 {
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
121 CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&);
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
122
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
123 return octave_value (quotient (v2.array_value (), v1.array_value ()));
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
124 }
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
125
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
126 DEFNDBINOP_FN (el_and, matrix, matrix, array, array, mx_el_and)
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 4532
diff changeset
127 DEFNDBINOP_FN (el_or, matrix, matrix, array, array, mx_el_or)
8982
dc6bda6f9994 implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
128 DEFNDBINOP_FN (el_not_and, matrix, matrix, array, array, mx_el_not_and)
dc6bda6f9994 implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
129 DEFNDBINOP_FN (el_not_or, matrix, matrix, array, array, mx_el_not_or)
dc6bda6f9994 implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
130 DEFNDBINOP_FN (el_and_not, matrix, matrix, array, array, mx_el_and_not)
dc6bda6f9994 implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
131 DEFNDBINOP_FN (el_or_not, matrix, matrix, array, array, mx_el_or_not)
dc6bda6f9994 implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
132
4532
01ee68d18069 [project @ 2003-10-10 00:49:54 by jwe]
jwe
parents: 4192
diff changeset
133
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4686
diff changeset
134 DEFNDCATOP_FN (m_m, matrix, matrix, array, array, concat)
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4686
diff changeset
135
4686
c7ae43dfdea4 [project @ 2004-01-06 19:29:23 by jwe]
jwe
parents: 4673
diff changeset
136 DEFNDASSIGNOP_FN (assign, matrix, matrix, array, assign)
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
137 DEFNDASSIGNOP_FN (sgl_assign, float_matrix, matrix, float_array, assign)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
138
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7800
diff changeset
139 DEFNULLASSIGNOP_FN (null_assign, matrix, delete_elements)
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7800
diff changeset
140
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
141 CONVDECL (matrix_to_float_matrix)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
142 {
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
143 CAST_CONV_ARG (const octave_matrix&);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
144
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
145 return new octave_float_matrix (FloatNDArray (v.array_value ()));
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
146 }
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
147
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
148 void
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
149 install_m_m_ops (void)
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
150 {
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
151 INSTALL_UNOP (op_not, octave_matrix, not);
4965
c0d8e8afa82f [project @ 2004-09-06 20:19:57 by jwe]
jwe
parents: 4915
diff changeset
152 INSTALL_UNOP (op_uplus, octave_matrix, uplus);
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
153 INSTALL_UNOP (op_uminus, octave_matrix, uminus);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
154 INSTALL_UNOP (op_transpose, octave_matrix, transpose);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
155 INSTALL_UNOP (op_hermitian, octave_matrix, transpose);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
156
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
157 INSTALL_NCUNOP (op_incr, octave_matrix, incr);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
158 INSTALL_NCUNOP (op_decr, octave_matrix, decr);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2928
diff changeset
159
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
160 INSTALL_BINOP (op_add, octave_matrix, octave_matrix, add);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
161 INSTALL_BINOP (op_sub, octave_matrix, octave_matrix, sub);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
162 INSTALL_BINOP (op_mul, octave_matrix, octave_matrix, mul);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
163 INSTALL_BINOP (op_div, octave_matrix, octave_matrix, div);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
164 INSTALL_BINOP (op_pow, octave_matrix, octave_matrix, pow);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
165 INSTALL_BINOP (op_ldiv, octave_matrix, octave_matrix, ldiv);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
166 INSTALL_BINOP (op_lt, octave_matrix, octave_matrix, lt);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
167 INSTALL_BINOP (op_le, octave_matrix, octave_matrix, le);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
168 INSTALL_BINOP (op_eq, octave_matrix, octave_matrix, eq);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
169 INSTALL_BINOP (op_ge, octave_matrix, octave_matrix, ge);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
170 INSTALL_BINOP (op_gt, octave_matrix, octave_matrix, gt);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
171 INSTALL_BINOP (op_ne, octave_matrix, octave_matrix, ne);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
172 INSTALL_BINOP (op_el_mul, octave_matrix, octave_matrix, el_mul);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
173 INSTALL_BINOP (op_el_div, octave_matrix, octave_matrix, el_div);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
174 INSTALL_BINOP (op_el_pow, octave_matrix, octave_matrix, el_pow);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
175 INSTALL_BINOP (op_el_ldiv, octave_matrix, octave_matrix, el_ldiv);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
176 INSTALL_BINOP (op_el_and, octave_matrix, octave_matrix, el_and);
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
177 INSTALL_BINOP (op_el_or, octave_matrix, octave_matrix, el_or);
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
178 INSTALL_BINOP (op_trans_mul, octave_matrix, octave_matrix, trans_mul);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
179 INSTALL_BINOP (op_mul_trans, octave_matrix, octave_matrix, mul_trans);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
180 INSTALL_BINOP (op_herm_mul, octave_matrix, octave_matrix, trans_mul);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
181 INSTALL_BINOP (op_mul_herm, octave_matrix, octave_matrix, mul_trans);
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
182
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4686
diff changeset
183 INSTALL_CATOP (octave_matrix, octave_matrix, m_m);
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4686
diff changeset
184
3538
0ff7323dab8b [project @ 2000-02-02 12:36:25 by jwe]
jwe
parents: 3203
diff changeset
185 INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_matrix, assign);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
186 INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_matrix, sgl_assign);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
187
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7800
diff changeset
188 INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_null_matrix, null_assign);
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7800
diff changeset
189 INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_null_str, null_assign);
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7800
diff changeset
190 INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_null_sq_str, null_assign);
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7800
diff changeset
191
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
192 INSTALL_CONVOP (octave_matrix, octave_float_matrix, matrix_to_float_matrix);
2928
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
193 }
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
194
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
195 /*
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
196 ;;; Local Variables: ***
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
197 ;;; mode: C++ ***
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
198 ;;; End: ***
295f037b4b3e [project @ 1997-05-05 05:32:33 by jwe]
jwe
parents:
diff changeset
199 */