annotate liboctave/boolMatrix.h @ 5100:5a92c3177fc6 before-gnuplot-split

[project @ 2004-12-27 17:20:38 by jwe]
author jwe
date Mon, 27 Dec 2004 17:20:38 +0000
parents 5719210fff4c
children e35b034d3523
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
1 /*
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
2
2847
8b262e771614 [project @ 1997-03-27 16:18:26 by jwe]
jwe
parents: 2844
diff changeset
3 Copyright (C) 1996, 1997 John W. Eaton
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
4
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
6
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
10 later version.
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
11
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
15 for more details.
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
16
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
20
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
21 */
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
22
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
23 #if !defined (octave_boolMatrix_int_h)
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
24 #define octave_boolMatrix_int_h 1
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
25
4192
5719210fff4c [project @ 2002-11-20 16:56:47 by jwe]
jwe
parents: 4066
diff changeset
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
27 #pragma interface
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
28 #endif
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
29
2844
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
30 #include "Array2.h"
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
31
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
32 #include "mx-defs.h"
3685
9d8306640373 [project @ 2000-06-28 19:25:02 by jwe]
jwe
parents: 3504
diff changeset
33 #include "mx-op-defs.h"
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
34
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
35 class
2844
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
36 boolMatrix : public Array2<bool>
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
37 {
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
38 public:
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
39
2844
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
40 boolMatrix (void) : Array2<bool> () { }
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
41 boolMatrix (int r, int c) : Array2<bool> (r, c) { }
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
42 boolMatrix (int r, int c, bool val) : Array2<bool> (r, c, val) { }
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
43 boolMatrix (const Array2<bool>& a) : Array2<bool> (a) { }
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
44 boolMatrix (const boolMatrix& a) : Array2<bool> (a) { }
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
45
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
46 boolMatrix& operator = (const boolMatrix& a)
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
47 {
2844
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
48 Array2<bool>::operator = (a);
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
49 return *this;
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
50 }
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
51
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
52 bool operator == (const boolMatrix& a) const;
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
53 bool operator != (const boolMatrix& a) const;
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
54
3225
7aae2c3636a7 [project @ 1998-12-04 23:20:12 by jwe]
jwe
parents: 3203
diff changeset
55 boolMatrix transpose (void) const { return Array2<bool>::transpose (); }
7aae2c3636a7 [project @ 1998-12-04 23:20:12 by jwe]
jwe
parents: 3203
diff changeset
56
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
57 // destructive insert/delete/reorder operations
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
58
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
59 boolMatrix& insert (const boolMatrix& a, int r, int c);
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
60
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2847
diff changeset
61 // unary operations
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2847
diff changeset
62
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2847
diff changeset
63 boolMatrix operator ! (void) const;
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2847
diff changeset
64
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2847
diff changeset
65 // other operations
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 2847
diff changeset
66
4017
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
67 boolMatrix all (int dim = -1) const;
0eb247b9cc9b [project @ 2002-08-03 04:07:14 by jwe]
jwe
parents: 4015
diff changeset
68 boolMatrix any (int dim = -1) const;
2832
4dff308e9acc [project @ 1997-03-26 05:16:58 by jwe]
jwe
parents: 2828
diff changeset
69
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
70 #if 0
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
71 // i/o
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
72
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3225
diff changeset
73 friend std::ostream& operator << (std::ostream& os, const Matrix& a);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3225
diff changeset
74 friend std::istream& operator >> (std::istream& is, Matrix& a);
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
75 #endif
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
76
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3685
diff changeset
77 static bool resize_fill_value (void) { return false; }
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3685
diff changeset
78
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
79 private:
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
80
2844
71a47e9360c0 [project @ 1997-03-26 21:35:06 by jwe]
jwe
parents: 2832
diff changeset
81 boolMatrix (bool *b, int r, int c) : Array2<bool> (b, r, c) { }
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
82 };
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
83
3685
9d8306640373 [project @ 2000-06-28 19:25:02 by jwe]
jwe
parents: 3504
diff changeset
84 MM_CMP_OP_DECLS (boolMatrix, boolMatrix)
9d8306640373 [project @ 2000-06-28 19:25:02 by jwe]
jwe
parents: 3504
diff changeset
85
2828
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
86 #endif
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
87
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
88 /*
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
89 ;;; Local Variables: ***
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
90 ;;; mode: C++ ***
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
91 ;;; End: ***
92826d6e8bd9 [project @ 1997-03-25 23:41:41 by jwe]
jwe
parents:
diff changeset
92 */