GNU Octave  4.0.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-2015 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 "ov-null-mat.h"
37 #include "ops.h"
38 #include "xdiv.h"
39 #include "xpow.h"
40 
41 // bool unary ops.
42 
43 // scalar unary ops.
44 
45 DEFUNOP_OP (not, bool, !)
46 
47 UNOPDECL (uplus, a)
48 {
49  CAST_UNOP_ARG (const octave_bool&);
50  return octave_value (v.double_value ());
51 }
52 
53 UNOPDECL (uminus, a)
54 {
55  CAST_UNOP_ARG (const octave_bool&);
56  return octave_value (- v.double_value ());
57 }
58 
59 DEFUNOP_OP (transpose, bool, /* no-op */)
60 DEFUNOP_OP (hermitian, bool, /* no-op */)
61 
62 // bool by bool ops.
63 
64 DEFBINOP_OP (eq, bool, bool, ==)
65 DEFBINOP_OP (ne, bool, bool, !=)
66 DEFBINOP_OP (el_and, bool, bool, &&)
67 DEFBINOP_OP (el_or, bool, bool, ||)
68 
69 DEFNDCATOP_FN (b_b, bool, bool, bool_array, bool_array, concat)
70 DEFNDCATOP_FN (b_s, bool, scalar, array, array, concat)
71 DEFNDCATOP_FN (s_b, scalar, bool, array, array, concat)
72 DEFNDCATOP_FN (b_f, bool, float_scalar, float_array, float_array, concat)
73 DEFNDCATOP_FN (f_b, float_scalar, bool, float_array, float_array, concat)
74 
75 void
77 {
83 
88 
94 
96 
100 }
octave_value op_uplus(const octave_value &a)
Definition: ov.h:1294
octave_value op_eq(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1335
static void transpose(octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *ridx2, octave_idx_type *cidx2)
Definition: symrcm.cc:382
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:664
#define DEFUNOP_OP(name, t, op)
Definition: ops.h:234
#define DEFBINOP_OP(name, t1, t2, op)
Definition: ops.h:282
octave_value op_el_or(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1345
#define INSTALL_BINOP(op, t1, t2, f)
Definition: ops.h:46
octave_value op_not(const octave_value &a)
Definition: ov.h:1293
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1297
#define UNOPDECL(name, a)
Definition: ops.h:224
octave_value op_el_and(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1344
#define INSTALL_CATOP(t1, t2, f)
Definition: ops.h:51
octave_value op_ne(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1338
#define INSTALL_UNOP(op, t, f)
Definition: ops.h:38
#define CAST_UNOP_ARG(t)
Definition: ops.h:76
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1298
#define INSTALL_ASSIGNCONV(t1, t2, tr)
Definition: ops.h:64
#define DEFNDCATOP_FN(name, t1, t2, e1, e2, f)
Definition: ops.h:364
octave_value op_uminus(const octave_value &a)
Definition: ov.h:1295
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
static bool scalar(const dim_vector &dims)
Definition: ov-struct.cc:736
void install_b_b_ops(void)
Definition: op-b-b.cc:76