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-sbm-sbm.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2013 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 }