4647
|
1 /* |
|
2 |
|
3 Copyright (C) 2003 John W. Eaton |
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
4647
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_streamoff_array_h) |
|
25 #define octave_streamoff_array_h 1 |
|
26 |
|
27 #include <iostream> |
|
28 |
|
29 #include "ArrayN.h" |
|
30 #include "mx-op-defs.h" |
|
31 |
|
32 class boolNDArray; |
|
33 |
|
34 // Stream offsets. |
|
35 |
|
36 class streamoff_array : public ArrayN<std::streamoff> |
|
37 { |
|
38 public: |
|
39 |
|
40 streamoff_array (void) : ArrayN<std::streamoff> () { } |
|
41 |
|
42 streamoff_array (const dim_vector& dv, |
|
43 const std::streamoff& val = resize_fill_value ()) |
|
44 : ArrayN<std::streamoff> (dv, val) { } |
|
45 |
|
46 streamoff_array (const ArrayN<std::streamoff>& sa) |
|
47 : ArrayN<std::streamoff> (sa) { } |
|
48 |
|
49 streamoff_array (const streamoff_array& sa) |
|
50 : ArrayN<std::streamoff> (sa) { } |
|
51 |
|
52 ~streamoff_array (void) { } |
|
53 |
4655
|
54 streamoff_array& operator = (const streamoff_array& sa) |
4647
|
55 { |
4655
|
56 if (this != &sa) |
|
57 ArrayN<std::streamoff>::operator = (sa); |
4647
|
58 |
|
59 return *this; |
|
60 } |
|
61 |
|
62 streamoff_array squeeze (void) const |
|
63 { return ArrayN<std::streamoff>::squeeze (); } |
|
64 |
|
65 boolNDArray all (int dim = -1) const; |
|
66 boolNDArray any (int dim = -1) const; |
|
67 |
5275
|
68 static octave_idx_type compute_index (Array<int>& ra_idx, |
4647
|
69 const dim_vector& dimensions); |
|
70 |
|
71 static std::streamoff resize_fill_value (void) { return 0; } |
|
72 }; |
|
73 |
|
74 streamoff_array& operator += (streamoff_array& l, const std::streamoff& r); |
|
75 streamoff_array& operator -= (streamoff_array& l, const std::streamoff& r); |
|
76 |
|
77 streamoff_array& operator += (streamoff_array& l, const streamoff_array& r); |
|
78 streamoff_array& operator -= (streamoff_array& l, const streamoff_array& r); |
|
79 |
|
80 NDCMP_OP_DECL (mx_el_eq, std::streamoff, streamoff_array); |
|
81 NDCMP_OP_DECL (mx_el_ne, std::streamoff, streamoff_array); |
|
82 |
|
83 NDCMP_OP_DECL (mx_el_eq, streamoff_array, std::streamoff); |
|
84 NDCMP_OP_DECL (mx_el_ne, streamoff_array, std::streamoff); |
|
85 |
|
86 NDCMP_OP_DECL (mx_el_eq, streamoff_array, streamoff_array); |
|
87 NDCMP_OP_DECL (mx_el_ne, streamoff_array, streamoff_array); |
|
88 |
|
89 BIN_OP_DECL (streamoff_array, operator +, streamoff_array, streamoff_array); |
|
90 BIN_OP_DECL (streamoff_array, operator -, streamoff_array, streamoff_array); |
|
91 |
|
92 BIN_OP_DECL (streamoff_array, operator +, streamoff_array, std::streamoff); |
|
93 BIN_OP_DECL (streamoff_array, operator -, streamoff_array, std::streamoff); |
|
94 |
|
95 BIN_OP_DECL (streamoff_array, operator +, std::streamoff, streamoff_array); |
|
96 BIN_OP_DECL (streamoff_array, operator -, std::streamoff, streamoff_array); |
|
97 |
|
98 #endif |
|
99 |
|
100 /* |
|
101 ;;; Local Variables: *** |
|
102 ;;; mode: C++ *** |
|
103 ;;; End: *** |
|
104 */ |