Mercurial > hg > octave-nkf
annotate src/OPERATORS/op-sbm-sbm.cc @ 11586:12df7854fa7c
strip trailing whitespace from source files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:24:59 -0500 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
rev | line source |
---|---|
5164 | 1 /* |
2 | |
11523 | 3 Copyright (C) 2004-2011 David Bateman |
4 Copyright (C) 1998-2004 Andy Adler | |
7016 | 5 |
6 This file is part of Octave. | |
5164 | 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 | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5164 | 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 | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5164 | 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 { | |
45 CAST_UNOP_ARG (const octave_sparse_bool_matrix&); | |
46 return octave_value (v.sparse_matrix_value ()); | |
47 } | |
48 | |
49 DEFUNOP (uminus, sparse_bool_matrix) | |
50 { | |
51 CAST_UNOP_ARG (const octave_sparse_bool_matrix&); | |
52 return octave_value ( - v.sparse_matrix_value ()); | |
53 } | |
54 | |
55 DEFUNOP (transpose, sparse_bool_matrix) | |
56 { | |
57 CAST_UNOP_ARG (const octave_sparse_bool_matrix&); | |
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 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
68 DEFNDCATOP_FN (sbm_sbm, sparse_bool_matrix, sparse_bool_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
69 sparse_bool_matrix, sparse_bool_matrix, concat) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
70 DEFNDCATOP_FN (sbm_sm, sparse_bool_matrix, sparse_matrix, sparse_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
71 sparse_matrix, concat) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
72 DEFNDCATOP_FN (sm_sbm, sparse_matrix, sparse_bool_matrix, sparse_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
73 sparse_matrix, concat) |
5164 | 74 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
75 DEFASSIGNOP_FN (assign, sparse_bool_matrix, sparse_bool_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
76 assign) |
5164 | 77 |
7004 | 78 CONVDECL (bool_matrix_to_double_matrix) |
79 { | |
80 CAST_CONV_ARG (const octave_sparse_bool_matrix&); | |
81 | |
82 return new octave_sparse_matrix (SparseMatrix (v.sparse_bool_matrix_value ())); | |
83 } | |
84 | |
5164 | 85 void |
86 install_sbm_sbm_ops (void) | |
87 { | |
88 INSTALL_UNOP (op_not, octave_sparse_bool_matrix, not); | |
89 INSTALL_UNOP (op_uplus, octave_sparse_bool_matrix, uplus); | |
90 INSTALL_UNOP (op_uminus, octave_sparse_bool_matrix, uminus); | |
91 INSTALL_UNOP (op_transpose, octave_sparse_bool_matrix, transpose); | |
92 INSTALL_UNOP (op_hermitian, octave_sparse_bool_matrix, transpose); | |
93 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
94 INSTALL_BINOP (op_eq, octave_sparse_bool_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
95 octave_sparse_bool_matrix, eq); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
96 INSTALL_BINOP (op_ne, octave_sparse_bool_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
97 octave_sparse_bool_matrix, ne); |
5164 | 98 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
99 INSTALL_BINOP (op_el_and, octave_sparse_bool_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
100 octave_sparse_bool_matrix, el_and); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
101 INSTALL_BINOP (op_el_or, octave_sparse_bool_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
102 octave_sparse_bool_matrix, el_or); |
5164 | 103 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
104 INSTALL_CATOP (octave_sparse_bool_matrix, octave_sparse_bool_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
105 sbm_sbm); |
5164 | 106 INSTALL_CATOP (octave_sparse_bool_matrix, octave_sparse_matrix, sbm_sm); |
107 INSTALL_CATOP (octave_sparse_matrix, octave_sparse_bool_matrix, sm_sbm); | |
108 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
109 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
110 octave_sparse_bool_matrix, assign); |
7004 | 111 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
112 INSTALL_CONVOP (octave_sparse_bool_matrix, octave_sparse_matrix, |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
7228
diff
changeset
|
113 bool_matrix_to_double_matrix); |
5164 | 114 } |