00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026
00027 #include "gripes.h"
00028 #include "oct-obj.h"
00029 #include "ov.h"
00030 #include "ov-bool.h"
00031 #include "ov-bool-mat.h"
00032 #include "ov-scalar.h"
00033 #include "ov-float.h"
00034 #include "ov-re-mat.h"
00035 #include "ov-typeinfo.h"
00036 #include "ops.h"
00037 #include "xdiv.h"
00038 #include "xpow.h"
00039
00040
00041
00042
00043
00044 DEFUNOP_OP (not, bool, !)
00045
00046 UNOPDECL (uplus, a)
00047 {
00048 CAST_UNOP_ARG (const octave_bool&);
00049 return octave_value (v.double_value ());
00050 }
00051
00052 UNOPDECL (uminus, a)
00053 {
00054 CAST_UNOP_ARG (const octave_bool&);
00055 return octave_value (- v.double_value ());
00056 }
00057
00058 DEFUNOP_OP (transpose, bool, )
00059 DEFUNOP_OP (hermitian, bool, )
00060
00061
00062
00063 DEFBINOP_OP (eq, bool, bool, ==)
00064 DEFBINOP_OP (ne, bool, bool, !=)
00065 DEFBINOP_OP (el_and, bool, bool, &&)
00066 DEFBINOP_OP (el_or, bool, bool, ||)
00067
00068 DEFNDCATOP_FN (b_b, bool, bool, bool_array, bool_array, concat)
00069 DEFNDCATOP_FN (b_s, bool, scalar, array, array, concat)
00070 DEFNDCATOP_FN (s_b, scalar, bool, array, array, concat)
00071 DEFNDCATOP_FN (b_f, bool, float_scalar, float_array, float_array, concat)
00072 DEFNDCATOP_FN (f_b, float_scalar, bool, float_array, float_array, concat)
00073
00074 void
00075 install_b_b_ops (void)
00076 {
00077 INSTALL_UNOP (op_not, octave_bool, not);
00078 INSTALL_UNOP (op_uplus, octave_bool, uplus);
00079 INSTALL_UNOP (op_uminus, octave_bool, uminus);
00080 INSTALL_UNOP (op_transpose, octave_bool, transpose);
00081 INSTALL_UNOP (op_hermitian, octave_bool, hermitian);
00082
00083 INSTALL_BINOP (op_eq, octave_bool, octave_bool, eq);
00084 INSTALL_BINOP (op_ne, octave_bool, octave_bool, ne);
00085 INSTALL_BINOP (op_el_and, octave_bool, octave_bool, el_and);
00086 INSTALL_BINOP (op_el_or, octave_bool, octave_bool, el_or);
00087
00088 INSTALL_CATOP (octave_bool, octave_bool, b_b);
00089 INSTALL_CATOP (octave_bool, octave_scalar, b_s);
00090 INSTALL_CATOP (octave_scalar, octave_bool, s_b);
00091 INSTALL_CATOP (octave_bool, octave_float_scalar, b_f);
00092 INSTALL_CATOP (octave_float_scalar, octave_bool, f_b);
00093
00094 INSTALL_ASSIGNCONV (octave_bool, octave_bool, octave_bool_matrix);
00095 }