4669
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 2003, 2004, 2005, 2007 John W. Eaton |
4669
|
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 |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
4669
|
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 |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
4669
|
20 |
|
21 */ |
|
22 |
|
23 #ifdef HAVE_CONFIG_H |
|
24 #include <config.h> |
|
25 #endif |
|
26 |
|
27 #include "gripes.h" |
|
28 #include "oct-obj.h" |
|
29 #include "ov.h" |
|
30 #include "ov-bool.h" |
|
31 #include "ov-bool-mat.h" |
4915
|
32 #include "ov-scalar.h" |
|
33 #include "ov-re-mat.h" |
4669
|
34 #include "ov-typeinfo.h" |
|
35 #include "ops.h" |
|
36 #include "xdiv.h" |
|
37 #include "xpow.h" |
|
38 |
|
39 // bool matrix by bool ops. |
|
40 |
|
41 DEFNDBINOP_FN (el_and, bool, bool_matrix, bool, bool_array, mx_el_and) |
|
42 DEFNDBINOP_FN (el_or, bool, bool_matrix, bool, bool_array, mx_el_or) |
|
43 |
4964
|
44 DEFNDCATOP_FN (b_bm, bool, bool_matrix, bool_array, bool_array, concat) |
4915
|
45 DEFNDCATOP_FN (b_m, bool, matrix, array, array, concat) |
|
46 DEFNDCATOP_FN (s_bm, scalar, bool_matrix, array, array, concat) |
|
47 |
4964
|
48 DEFCONV (bool_matrix_conv, bool, bool_matrix) |
|
49 { |
|
50 CAST_CONV_ARG (const octave_bool&); |
|
51 |
|
52 return new octave_bool_matrix (v.bool_matrix_value ()); |
|
53 } |
|
54 |
4669
|
55 void |
|
56 install_b_bm_ops (void) |
|
57 { |
|
58 INSTALL_BINOP (op_el_and, octave_bool, octave_bool_matrix, el_and); |
|
59 INSTALL_BINOP (op_el_or, octave_bool, octave_bool_matrix, el_or); |
4915
|
60 |
|
61 INSTALL_CATOP (octave_bool, octave_bool_matrix, b_bm); |
|
62 INSTALL_CATOP (octave_bool, octave_matrix, b_m); |
|
63 INSTALL_CATOP (octave_scalar, octave_bool_matrix, s_bm); |
4964
|
64 |
|
65 INSTALL_ASSIGNCONV (octave_bool, octave_bool_matrix, octave_bool_matrix); |
|
66 |
|
67 INSTALL_WIDENOP (octave_bool, octave_bool_matrix, bool_matrix_conv); |
4669
|
68 } |
|
69 |
|
70 /* |
|
71 ;;; Local Variables: *** |
|
72 ;;; mode: C++ *** |
|
73 ;;; End: *** |
|
74 */ |