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-sbm-sbm.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2015 David Bateman
4 Copyright (C) 1998-2004 Andy Adler
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27 
28 #include "gripes.h"
29 #include "oct-obj.h"
30 #include "ov.h"
31 #include "ov-typeinfo.h"
32 #include "ov-bool-mat.h"
33 #include "ov-scalar.h"
34 #include "ops.h"
35 
36 #include "ov-re-sparse.h"
37 #include "ov-bool-sparse.h"
38 
39 // unary sparse bool matrix ops.
40 
41 DEFUNOP_OP (not, sparse_bool_matrix, !)
42 
43 DEFUNOP (uplus, sparse_bool_matrix)
44 {
46  return octave_value (v.sparse_matrix_value ());
47 }
48 
49 DEFUNOP (uminus, sparse_bool_matrix)
50 {
52  return octave_value (- v.sparse_matrix_value ());
53 }
54 
55 DEFUNOP (transpose, sparse_bool_matrix)
56 {
58  return octave_value (v.sparse_bool_matrix_value ().transpose ());
59 }
60 
61 // sparse bool matrix by sparse bool matrix ops.
62 
63 DEFBINOP_FN (eq, sparse_bool_matrix, sparse_bool_matrix, mx_el_eq)
64 DEFBINOP_FN (ne, sparse_bool_matrix, sparse_bool_matrix, mx_el_ne)
65 DEFBINOP_FN (el_and, sparse_bool_matrix, sparse_bool_matrix, mx_el_and)
66 DEFBINOP_FN (el_or, sparse_bool_matrix, sparse_bool_matrix, mx_el_or)
67 
68 DEFNDCATOP_FN (sbm_sbm, sparse_bool_matrix, sparse_bool_matrix,
69  sparse_bool_matrix, sparse_bool_matrix, concat)
70 DEFNDCATOP_FN (sbm_sm, sparse_bool_matrix, sparse_matrix, sparse_matrix,
71  sparse_matrix, concat)
72 DEFNDCATOP_FN (sm_sbm, sparse_matrix, sparse_bool_matrix, sparse_matrix,
73  sparse_matrix, concat)
74 
75 DEFASSIGNOP_FN (assign, sparse_bool_matrix, sparse_bool_matrix,
76  assign)
77 
78 CONVDECL (bool_matrix_to_double_matrix)
79 {
81 
83  (v.sparse_bool_matrix_value ()));
84 }
85 
86 void
88 {
94 
99 
101  octave_sparse_bool_matrix, el_and);
104 
106  sbm_sbm);
109 
112 
114  bool_matrix_to_double_matrix);
115 }
octave_value op_uplus(const octave_value &a)
Definition: ov.h:1294
#define DEFUNOP(name, t)
Definition: ops.h:231
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 INSTALL_ASSIGNOP(op, t1, t2, f)
Definition: ops.h:55
#define INSTALL_CONVOP(t1, t2, f)
Definition: ops.h:68
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
#define CAST_CONV_ARG(t)
Definition: ops.h:83
octave_value op_not(const octave_value &a)
Definition: ov.h:1293
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1297
octave_value op_el_and(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1344
boolMatrix mx_el_ne(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:90
#define INSTALL_CATOP(t1, t2, f)
Definition: ops.h:51
void install_sbm_sbm_ops(void)
Definition: op-sbm-sbm.cc:87
boolMatrix mx_el_or(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:87
void assign(octave_value::assign_op, const octave_value &)
Definition: oct-lvalue.cc:33
octave_value op_ne(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1338
boolMatrix mx_el_and(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:87
#define INSTALL_UNOP(op, t, f)
Definition: ops.h:38
#define CAST_UNOP_ARG(t)
Definition: ops.h:76
#define DEFBINOP_FN(name, t1, t2, f)
Definition: ops.h:323
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1298
#define DEFNDCATOP_FN(name, t1, t2, e1, e2, f)
Definition: ops.h:364
boolMatrix mx_el_eq(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:90
octave_value op_uminus(const octave_value &a)
Definition: ov.h:1295
#define CONVDECL(name)
Definition: ops.h:166
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
#define DEFASSIGNOP_FN(name, t1, t2, f)
Definition: ops.h:107