Mercurial > hg > octave-nkf
annotate liboctave/boolSparse.h @ 12733:b67c2d580a25 stable
maint: clean up top-level directory
* build-aux/bootstrap: Rename from bootstrap.
* build-aux/bootstrap.conf: Rename from bootstrap.conf.
* build-aux/changelog.tmpl: Rename from changelog.tmpl.
* build-aux/bootstrap.conf: Update for new file locations.
* build-aux/common.mk: Rename from common.mk.
* build-aux/diff-template: Rename from diff-template.
* build-aux/mk-opts.pl: Rename from mk-opts.pl.
* build-aux/mkinstalldirs: Rename from mkinstalldirs.
* build-aux/move-if-change: Rename from move-if-change.
* etc/CHECKLIST: Rename from CHECKLIST.
* etc/HACKING: Rename from HACKING.
* etc/NEWS.1: Rename from NEWS.1.
* etc/NEWS.2: Rename from NEWS.2.
* etc/NEWS.3: Rename from NEWS.3.
* etc/OLD-ChangeLogs/ChangeLog: Rename from OLD-ChangeLogs/ChangeLog.
* etc/OLD-ChangeLogs/ChangeLog.1: Rename from
OLD-ChangeLogs/ChangeLog.1.
* etc/OLD-ChangeLogs/doc-ChangeLog: Rename from
OLD-ChangeLogs/doc-ChangeLog.
* etc/OLD-ChangeLogs/libcruft-ChangeLog: Rename from
OLD-ChangeLogs/libcruft-ChangeLog.
* etc/OLD-ChangeLogs/liboctave-ChangeLog: Rename from
OLD-ChangeLogs/liboctave-ChangeLog.
* etc/OLD-ChangeLogs/scripts-ChangeLog: Rename from
OLD-ChangeLogs/scripts-ChangeLog.
* etc/OLD-ChangeLogs/src-ChangeLog: Rename from
OLD-ChangeLogs/src-ChangeLog.
* etc/OLD-ChangeLogs/test-ChangeLog: Rename from
OLD-ChangeLogs/test-ChangeLog.
* etc/PROJECTS: Rename from PROJECTS.
* etc/README.Cygwin: Rename from README.Cygwin.
* etc/README.Linux: Rename from README.Linux.
* etc/README.MacOS: Rename from README.MacOS.
* etc/README.MinGW: Rename from README.MinGW.
* etc/README.Windows: Rename from README.Windows.
* etc/README.devel: Rename from README.devel.
* etc/README.ftp: Rename from README.ftp.
* etc/README.gnuplot: Rename from README.gnuplot.
* etc/README.kpathsea: Rename from README.kpathsea.
* etc/README.mirrors: Rename from README.mirrors.
* etc/README.snapshots: Rename from README.snapshots.
* etc/gdbinit: Rename from gdbinit.
* m4/acinclude.m4: Rename from acinclude.m4.
* src/mkoctfile.cc.in: Rename from mkoctfile.cc.in.
* src/mkoctfile.in: Rename from mkoctfile.in.
* src/octave-config.cc.in: Rename from octave-config.cc.in.
* src/octave-config.in: Rename from octave-config.in.
* config.guess, config.sub, missing, octave-sh: Delete.
* Makefile.am: Include build-aux/common.mk instead of common.mk.
* examples/Makefile.am, libcruft/Makefile.am,
liboctave/Makefile.am, liboctave/config-ops.sh,
scripts/Makefile.am, src/DLD-FUNCTIONS/config-module.sh,
test/Makefile.am, autogen.sh, doc/Makefile.am,
doc/faq/Makefile.am, doc/icons/Makefile.am,
doc/interpreter/Makefile.am, doc/interpreter/config-images.sh,
doc/liboctave/Makefile.am, doc/refcard/Makefile.am,
build-aux/common.mk, src/Makefile.am: Update for new file locations.
* Makefile.am: Don't build mkoctfile or octave-config here.
* README: Update INSTALL info.
* build-aux/mkinstalldirs: Update to new version.
* src/Makefile.am (mkoctfile, octave-config): New targets.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 10 Jun 2011 14:35:42 -0400 |
parents | 12df7854fa7c |
children | b646413c3d0e |
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 #if !defined (octave_boolSparse_h) | |
25 #define octave_boolSparse_h 1 | |
26 | |
27 #include "Sparse.h" | |
28 #include "MSparse-defs.h" | |
29 #include "Sparse-op-defs.h" | |
30 | |
10983
4b51c0a20a98
optimize sum of sparse logical matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
10527
diff
changeset
|
31 class SparseMatrix; |
4b51c0a20a98
optimize sum of sparse logical matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
10527
diff
changeset
|
32 |
5164 | 33 class |
6108 | 34 OCTAVE_API |
5164 | 35 SparseBoolMatrix : public Sparse<bool> |
36 { | |
37 public: | |
38 | |
39 SparseBoolMatrix (void) : Sparse<bool> () { } | |
40 | |
5275 | 41 SparseBoolMatrix (octave_idx_type r, octave_idx_type c) : Sparse<bool> (r, c) { } |
5164 | 42 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
43 explicit SparseBoolMatrix (octave_idx_type r, octave_idx_type c, bool val) |
5164 | 44 : Sparse<bool> (r, c, val) { } |
45 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
46 SparseBoolMatrix (const dim_vector& dv, octave_idx_type nz = 0) : |
6823 | 47 Sparse<bool> (dv, nz) { } |
48 | |
5164 | 49 SparseBoolMatrix (const Sparse<bool>& a) : Sparse<bool> (a) { } |
50 | |
51 SparseBoolMatrix (const SparseBoolMatrix& a) : Sparse<bool> (a) { } | |
52 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
53 SparseBoolMatrix (const SparseBoolMatrix& a, const dim_vector& dv) |
5164 | 54 : Sparse<bool> (a, dv) { } |
55 | |
56 explicit SparseBoolMatrix (const boolMatrix& a) : Sparse<bool> (a) { } | |
57 | |
58 explicit SparseBoolMatrix (const boolNDArray& a) : Sparse<bool> (a) { } | |
59 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
60 SparseBoolMatrix (const Array<bool>& a, const idx_vector& r, |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
61 const idx_vector& c, octave_idx_type nr = -1, |
10527
b4d2080b6df7
Replace nzmax by nnz as needed
David Bateman <dbateman@free.fr>
parents:
10480
diff
changeset
|
62 octave_idx_type nc = -1, bool sum_terms = true, |
b4d2080b6df7
Replace nzmax by nnz as needed
David Bateman <dbateman@free.fr>
parents:
10480
diff
changeset
|
63 octave_idx_type nzm = -1) |
b4d2080b6df7
Replace nzmax by nnz as needed
David Bateman <dbateman@free.fr>
parents:
10480
diff
changeset
|
64 : Sparse<bool> (a, r, c, nr, nc, sum_terms, nzm) { } |
10479
ded9beac7582
optimize sparse matrix assembly
Jaroslav Hajek <highegg@gmail.com>
parents:
10421
diff
changeset
|
65 |
5275 | 66 SparseBoolMatrix (octave_idx_type r, octave_idx_type c, octave_idx_type num_nz) : Sparse<bool> (r, c, num_nz) { } |
5164 | 67 |
68 SparseBoolMatrix& operator = (const SparseBoolMatrix& a) | |
69 { | |
70 Sparse<bool>::operator = (a); | |
71 return *this; | |
72 } | |
73 | |
74 bool operator == (const SparseBoolMatrix& a) const; | |
75 bool operator != (const SparseBoolMatrix& a) const; | |
76 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
77 SparseBoolMatrix transpose (void) const |
5164 | 78 { return Sparse<bool>::transpose (); } |
79 | |
80 // destructive insert/delete/reorder operations | |
81 | |
5275 | 82 SparseBoolMatrix& insert (const SparseBoolMatrix& a, octave_idx_type r, octave_idx_type c); |
5164 | 83 |
6823 | 84 SparseBoolMatrix& insert (const SparseBoolMatrix& a, const Array<octave_idx_type>& indx); |
85 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
86 SparseBoolMatrix concat (const SparseBoolMatrix& rb, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
87 const Array<octave_idx_type>& ra_idx); |
5164 | 88 |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
89 SparseBoolMatrix diag (octave_idx_type k = 0) const; |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
90 |
5164 | 91 boolMatrix matrix_value (void) const; |
92 | |
93 SparseBoolMatrix squeeze (void) const; | |
94 | |
10421
99e9bae2d81e
improve sparse indexing interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
95 SparseBoolMatrix index (const idx_vector& i, bool resize_ok) const; |
5164 | 96 |
10421
99e9bae2d81e
improve sparse indexing interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10312
diff
changeset
|
97 SparseBoolMatrix index (const idx_vector& i, const idx_vector& j, bool resize_ok) const; |
5164 | 98 |
99 SparseBoolMatrix reshape (const dim_vector& new_dims) const; | |
100 | |
5275 | 101 SparseBoolMatrix permute (const Array<octave_idx_type>& vec, bool inv = false) const; |
5164 | 102 |
5275 | 103 SparseBoolMatrix ipermute (const Array<octave_idx_type>& vec) const; |
5164 | 104 |
105 // unary operations | |
106 | |
107 SparseBoolMatrix operator ! (void) const; | |
108 | |
109 // other operations | |
110 | |
111 SparseBoolMatrix all (int dim = -1) const; | |
112 SparseBoolMatrix any (int dim = -1) const; | |
10983
4b51c0a20a98
optimize sum of sparse logical matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
10527
diff
changeset
|
113 SparseMatrix sum (int dim = -1) const; |
5164 | 114 |
115 // i/o | |
116 | |
6108 | 117 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const SparseBoolMatrix& a); |
118 friend OCTAVE_API std::istream& operator >> (std::istream& is, SparseBoolMatrix& a); | |
5164 | 119 }; |
120 | |
6708 | 121 SPARSE_SMS_EQNE_OP_DECLS (SparseBoolMatrix, bool, OCTAVE_API) |
122 SPARSE_SMS_BOOL_OP_DECLS (SparseBoolMatrix, bool, OCTAVE_API) | |
5164 | 123 |
6708 | 124 SPARSE_SSM_EQNE_OP_DECLS (bool, SparseBoolMatrix, OCTAVE_API) |
125 SPARSE_SSM_BOOL_OP_DECLS (bool, SparseBoolMatrix, OCTAVE_API) | |
5164 | 126 |
6708 | 127 SPARSE_SMSM_EQNE_OP_DECLS (SparseBoolMatrix, SparseBoolMatrix, OCTAVE_API) |
128 SPARSE_SMSM_BOOL_OP_DECLS (SparseBoolMatrix, SparseBoolMatrix, OCTAVE_API) | |
5164 | 129 |
130 #endif |