GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
op-b-b.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2013 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 3 of the License, or (at your
10 option) any 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, see
19 <http://www.gnu.org/licenses/>.
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"
32 #include "ov-scalar.h"
33 #include "ov-float.h"
34 #include "ov-re-mat.h"
35 #include "ov-typeinfo.h"
36 #include "ops.h"
37 #include "xdiv.h"
38 #include "xpow.h"
39 
40 // bool unary ops.
41 
42 // scalar unary ops.
43 
44 DEFUNOP_OP (not, bool, !)
45 
46 UNOPDECL (uplus, a)
47 {
48  CAST_UNOP_ARG (const octave_bool&);
49  return octave_value (v.double_value ());
50 }
51 
52 UNOPDECL (uminus, a)
53 {
54  CAST_UNOP_ARG (const octave_bool&);
55  return octave_value (- v.double_value ());
56 }
57 
58 DEFUNOP_OP (transpose, bool, /* no-op */)
59 DEFUNOP_OP (hermitian, bool, /* no-op */)
60 
61 // bool by bool ops.
62 
63 DEFBINOP_OP (eq, bool, bool, ==)
64 DEFBINOP_OP (ne, bool, bool, !=)
65 DEFBINOP_OP (el_and, bool, bool, &&)
66 DEFBINOP_OP (el_or, bool, bool, ||)
67 
68 DEFNDCATOP_FN (b_b, bool, bool, bool_array, bool_array, concat)
69 DEFNDCATOP_FN (b_s, bool, scalar, array, array, concat)
70 DEFNDCATOP_FN (s_b, scalar, bool, array, array, concat)
71 DEFNDCATOP_FN (b_f, bool, float_scalar, float_array, float_array, concat)
72 DEFNDCATOP_FN (f_b, float_scalar, bool, float_array, float_array, concat)
73 
74 void
76 {
82 
87 
93 
95 }