GNU Octave  4.2.1
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-2017 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 #if defined (HAVE_CONFIG_H)
25 # include "config.h"
26 #endif
27 
28 #include "errwarn.h"
29 #include "ovl.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  = dynamic_cast<const octave_sparse_bool_matrix&> (a);
47  return octave_value (v.sparse_matrix_value ());
48 }
49 
50 DEFUNOP (uminus, sparse_bool_matrix)
51 {
53  = dynamic_cast<const octave_sparse_bool_matrix&> (a);
54  return octave_value (- v.sparse_matrix_value ());
55 }
56 
57 DEFUNOP (transpose, sparse_bool_matrix)
58 {
60  = dynamic_cast<const octave_sparse_bool_matrix&> (a);
62 }
63 
64 // sparse bool matrix by sparse bool matrix ops.
65 
66 DEFBINOP_FN (eq, sparse_bool_matrix, sparse_bool_matrix, mx_el_eq)
67 DEFBINOP_FN (ne, sparse_bool_matrix, sparse_bool_matrix, mx_el_ne)
68 DEFBINOP_FN (el_and, sparse_bool_matrix, sparse_bool_matrix, mx_el_and)
69 DEFBINOP_FN (el_or, sparse_bool_matrix, sparse_bool_matrix, mx_el_or)
70 
71 DEFNDCATOP_FN (sbm_sbm, sparse_bool_matrix, sparse_bool_matrix,
72  sparse_bool_matrix, sparse_bool_matrix, concat)
73 DEFNDCATOP_FN (sbm_sm, sparse_bool_matrix, sparse_matrix, sparse_matrix,
74  sparse_matrix, concat)
75 DEFNDCATOP_FN (sm_sbm, sparse_matrix, sparse_bool_matrix, sparse_matrix,
76  sparse_matrix, concat)
77 
78 DEFASSIGNOP_FN (assign, sparse_bool_matrix, sparse_bool_matrix,
79  assign)
80 
81 void
83 {
89 
94 
99 
101  sbm_sbm);
104 
106  octave_sparse_bool_matrix, assign);
107 }
octave_value op_uplus(const octave_value &a)
Definition: ov.h:1485
#define DEFUNOP(name, t)
Definition: ops.h:172
octave_value op_eq(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1524
SparseMatrix sparse_matrix_value(bool=false) const
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:655
SparseBoolMatrix sparse_bool_matrix_value(bool=false) const
SparseBoolMatrix transpose(void) const
Definition: boolSparse.h:91
#define DEFUNOP_OP(name, t, op)
Definition: ops.h:176
#define INSTALL_ASSIGNOP(op, t1, t2, f)
Definition: ops.h:57
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
octave_value op_el_or(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1534
#define INSTALL_BINOP(op, t1, t2, f)
Definition: ops.h:48
octave_value op_not(const octave_value &a)
Definition: ov.h:1484
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1488
octave_value op_el_and(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1533
boolMatrix mx_el_ne(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:90
#define INSTALL_CATOP(t1, t2, f)
Definition: ops.h:53
void install_sbm_sbm_ops(void)
Definition: op-sbm-sbm.cc:82
boolMatrix mx_el_or(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:87
octave_value op_ne(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1527
boolMatrix mx_el_and(const boolMatrix &m1, const boolMatrix &m2)
Definition: boolMatrix.cc:87
#define INSTALL_UNOP(op, t, f)
Definition: ops.h:40
#define DEFBINOP_FN(name, t1, t2, f)
Definition: ops.h:283
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1489
#define DEFNDCATOP_FN(name, t1, t2, e1, e2, f)
Definition: ops.h:341
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:1486
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:80