Mercurial > hg > octave-nkf
annotate src/OPERATORS/op-sbm-b.cc @ 11523:fd0a3ac60b0e
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 14 Jan 2011 05:47:45 -0500 |
parents | ac4b97c6bf8b |
children | 12df7854fa7c |
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.h" | |
33 #include "ov-scalar.h" | |
34 #include "ops.h" | |
35 | |
36 #include "ov-re-sparse.h" | |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
37 #include "ov-bool-sparse.h" |
5164 | 38 |
39 // sparse bool matrix by bool ops. | |
40 | |
41 DEFBINOP_FN (ne, sparse_bool_matrix, bool, mx_el_ne) | |
42 DEFBINOP_FN (eq, sparse_bool_matrix, bool, mx_el_eq) | |
43 | |
44 DEFBINOP_FN (el_and, sparse_bool_matrix, bool, mx_el_and) | |
45 DEFBINOP_FN (el_or, sparse_bool_matrix, bool, mx_el_or) | |
46 | |
47 DEFCATOP (sbm_b, sparse_bool_matrix, bool) | |
48 { | |
49 CAST_BINOP_ARGS (octave_sparse_bool_matrix&, const octave_bool&); | |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
50 |
5164 | 51 SparseBoolMatrix tmp (1, 1, v2.bool_value ()); |
52 return octave_value (v1.sparse_bool_matrix_value (). concat (tmp, ra_idx)); | |
53 } | |
54 | |
55 DEFCATOP (sm_b, sparse_matrix, bool) | |
56 { | |
57 CAST_BINOP_ARGS (octave_sparse_matrix&, const octave_bool&); | |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
58 |
5164 | 59 SparseMatrix tmp (1, 1, v2.scalar_value ()); |
60 return octave_value (v1.sparse_matrix_value (). concat (tmp, ra_idx)); | |
61 } | |
62 | |
63 DEFCATOP (sbm_s, sparse_bool_matrix, scalar) | |
64 { | |
65 CAST_BINOP_ARGS (octave_sparse_bool_matrix&, const octave_scalar&); | |
9931
fb6b6fcafa62
untabify files in src/OPERATORS directory
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
66 |
5164 | 67 SparseMatrix tmp (1, 1, v2.scalar_value ()); |
68 return octave_value (v1.sparse_matrix_value (). concat (tmp, ra_idx)); | |
69 } | |
70 | |
71 DEFASSIGNOP (assign, sparse_bool_matrix, bool) | |
72 { | |
73 CAST_BINOP_ARGS (octave_sparse_bool_matrix&, const octave_bool&); | |
74 | |
75 SparseBoolMatrix tmp (1, 1, v2.bool_value ()); | |
76 v1.assign (idx, tmp); | |
77 return octave_value (); | |
78 } | |
79 | |
80 void | |
81 install_sbm_b_ops (void) | |
82 { | |
83 INSTALL_BINOP (op_eq, octave_sparse_bool_matrix, octave_bool, eq); | |
84 INSTALL_BINOP (op_ne, octave_sparse_bool_matrix, octave_bool, ne); | |
85 | |
86 INSTALL_BINOP (op_el_and, octave_sparse_bool_matrix, octave_bool, el_and); | |
87 INSTALL_BINOP (op_el_or, octave_sparse_bool_matrix, octave_bool, el_or); | |
88 | |
89 INSTALL_CATOP (octave_sparse_bool_matrix, octave_bool, sbm_b); | |
90 INSTALL_CATOP (octave_sparse_bool_matrix, octave_scalar, sbm_s); | |
91 INSTALL_CATOP (octave_sparse_matrix, octave_bool, sm_b); | |
92 | |
93 INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_bool_matrix, octave_bool, assign); | |
94 } |