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 "gripes.h" |
4055
|
32 #include "oct-obj.h" |
2928
|
33 #include "ov.h" |
|
34 #include "ov-bool.h" |
4964
|
35 #include "ov-bool-mat.h" |
4915
|
36 #include "ov-scalar.h" |
|
37 #include "ov-re-mat.h" |
2928
|
38 #include "ov-typeinfo.h" |
|
39 #include "ops.h" |
|
40 #include "xdiv.h" |
|
41 #include "xpow.h" |
|
42 |
3203
|
43 // bool unary ops. |
|
44 |
|
45 // scalar unary ops. |
|
46 |
|
47 DEFUNOP_OP (not, bool, !) |
|
48 DEFUNOP_OP (transpose, bool, /* no-op */) |
|
49 DEFUNOP_OP (hermitian, bool, /* no-op */) |
|
50 |
2928
|
51 // bool by bool ops. |
|
52 |
|
53 DEFBINOP_OP (eq, bool, bool, ==) |
|
54 DEFBINOP_OP (ne, bool, bool, !=) |
3798
|
55 DEFBINOP_OP (el_and, bool, bool, &&) |
|
56 DEFBINOP_OP (el_or, bool, bool, ||) |
3797
|
57 |
4964
|
58 DEFNDCATOP_FN (b_b, bool, bool, bool_array, bool_array, concat) |
4915
|
59 DEFNDCATOP_FN (b_s, bool, scalar, array, array, concat) |
|
60 DEFNDCATOP_FN (s_b, scalar, bool, array, array, concat) |
|
61 |
2928
|
62 void |
|
63 install_b_b_ops (void) |
|
64 { |
3538
|
65 INSTALL_UNOP (op_not, octave_bool, not); |
|
66 INSTALL_UNOP (op_transpose, octave_bool, transpose); |
|
67 INSTALL_UNOP (op_hermitian, octave_bool, hermitian); |
3203
|
68 |
3538
|
69 INSTALL_BINOP (op_eq, octave_bool, octave_bool, eq); |
|
70 INSTALL_BINOP (op_ne, octave_bool, octave_bool, ne); |
3797
|
71 INSTALL_BINOP (op_el_and, octave_bool, octave_bool, el_and); |
|
72 INSTALL_BINOP (op_el_or, octave_bool, octave_bool, el_or); |
4915
|
73 |
|
74 INSTALL_CATOP (octave_bool, octave_bool, b_b); |
|
75 INSTALL_CATOP (octave_bool, octave_scalar, b_s); |
|
76 INSTALL_CATOP (octave_scalar, octave_bool, s_b); |
4964
|
77 |
|
78 INSTALL_ASSIGNCONV (octave_bool, octave_bool, octave_bool_matrix); |
2928
|
79 } |
|
80 |
|
81 /* |
|
82 ;;; Local Variables: *** |
|
83 ;;; mode: C++ *** |
|
84 ;;; End: *** |
|
85 */ |