op-b-bm.cc

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2003-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
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-flt-re-mat.h"
00036 #include "ov-typeinfo.h"
00037 #include "ops.h"
00038 #include "xdiv.h"
00039 #include "xpow.h"
00040 
00041 // bool matrix by bool ops.
00042 
00043 DEFNDBINOP_FN (el_and, bool, bool_matrix, bool, bool_array, mx_el_and)
00044 DEFNDBINOP_FN (el_or, bool, bool_matrix, bool, bool_array, mx_el_or)
00045 
00046 DEFNDBINOP_FN (el_and_not, bool, bool_matrix, bool, bool_array, mx_el_and_not)
00047 DEFNDBINOP_FN (el_or_not, bool, bool_matrix, bool, bool_array, mx_el_or_not)
00048 
00049 DEFNDCATOP_FN (b_bm, bool, bool_matrix, bool_array, bool_array, concat)
00050 DEFNDCATOP_FN (b_m, bool, matrix, array, array, concat)
00051 DEFNDCATOP_FN (s_bm, scalar, bool_matrix, array, array, concat)
00052 
00053 DEFNDCATOP_FN (b_fm, bool, float_matrix, float_array, float_array, concat)
00054 DEFNDCATOP_FN (f_bm, float_scalar, bool_matrix, float_array, float_array, concat)
00055 
00056 DEFCONV (bool_matrix_conv, bool, bool_matrix)
00057 {
00058   CAST_CONV_ARG (const octave_bool&);
00059 
00060   return new octave_bool_matrix (v.bool_matrix_value ());
00061 }
00062 
00063 void
00064 install_b_bm_ops (void)
00065 {
00066   INSTALL_BINOP (op_el_and, octave_bool, octave_bool_matrix, el_and);
00067   INSTALL_BINOP (op_el_or, octave_bool, octave_bool_matrix, el_or);
00068   INSTALL_BINOP (op_el_and_not, octave_bool, octave_bool_matrix, el_and_not);
00069   INSTALL_BINOP (op_el_or_not, octave_bool, octave_bool_matrix, el_or_not);
00070 
00071   INSTALL_CATOP (octave_bool, octave_bool_matrix, b_bm);
00072   INSTALL_CATOP (octave_bool, octave_matrix, b_m);
00073   INSTALL_CATOP (octave_scalar, octave_bool_matrix, s_bm);
00074   INSTALL_CATOP (octave_bool, octave_float_matrix, b_fm);
00075   INSTALL_CATOP (octave_float_scalar, octave_bool_matrix, f_bm);
00076 
00077   INSTALL_ASSIGNCONV (octave_bool, octave_bool_matrix, octave_bool_matrix);
00078 
00079   INSTALL_WIDENOP (octave_bool, octave_bool_matrix, bool_matrix_conv);
00080 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines