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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_streamoff_array_h) |
|
24 #define octave_streamoff_array_h 1 |
|
25 |
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <iostream> |
|
31 |
|
32 #include "ArrayN.h" |
|
33 #include "mx-op-defs.h" |
|
34 |
|
35 class boolNDArray; |
|
36 |
|
37 // Stream offsets. |
|
38 |
|
39 class streamoff_array : public ArrayN<std::streamoff> |
|
40 { |
|
41 public: |
|
42 |
|
43 streamoff_array (void) : ArrayN<std::streamoff> () { } |
|
44 |
|
45 streamoff_array (const dim_vector& dv, |
|
46 const std::streamoff& val = resize_fill_value ()) |
|
47 : ArrayN<std::streamoff> (dv, val) { } |
|
48 |
|
49 streamoff_array (const ArrayN<std::streamoff>& sa) |
|
50 : ArrayN<std::streamoff> (sa) { } |
|
51 |
|
52 streamoff_array (const streamoff_array& sa) |
|
53 : ArrayN<std::streamoff> (sa) { } |
|
54 |
|
55 ~streamoff_array (void) { } |
|
56 |
4655
|
57 streamoff_array& operator = (const streamoff_array& sa) |
4647
|
58 { |
4655
|
59 if (this != &sa) |
|
60 ArrayN<std::streamoff>::operator = (sa); |
4647
|
61 |
|
62 return *this; |
|
63 } |
|
64 |
|
65 streamoff_array squeeze (void) const |
|
66 { return ArrayN<std::streamoff>::squeeze (); } |
|
67 |
|
68 boolNDArray all (int dim = -1) const; |
|
69 boolNDArray any (int dim = -1) const; |
|
70 |
|
71 static int compute_index (Array<int>& ra_idx, |
|
72 const dim_vector& dimensions); |
|
73 |
|
74 static std::streamoff resize_fill_value (void) { return 0; } |
|
75 }; |
|
76 |
|
77 streamoff_array& operator += (streamoff_array& l, const std::streamoff& r); |
|
78 streamoff_array& operator -= (streamoff_array& l, const std::streamoff& r); |
|
79 |
|
80 streamoff_array& operator += (streamoff_array& l, const streamoff_array& r); |
|
81 streamoff_array& operator -= (streamoff_array& l, const streamoff_array& r); |
|
82 |
|
83 NDCMP_OP_DECL (mx_el_eq, std::streamoff, streamoff_array); |
|
84 NDCMP_OP_DECL (mx_el_ne, std::streamoff, streamoff_array); |
|
85 |
|
86 NDCMP_OP_DECL (mx_el_eq, streamoff_array, std::streamoff); |
|
87 NDCMP_OP_DECL (mx_el_ne, streamoff_array, std::streamoff); |
|
88 |
|
89 NDCMP_OP_DECL (mx_el_eq, streamoff_array, streamoff_array); |
|
90 NDCMP_OP_DECL (mx_el_ne, streamoff_array, streamoff_array); |
|
91 |
|
92 BIN_OP_DECL (streamoff_array, operator +, streamoff_array, streamoff_array); |
|
93 BIN_OP_DECL (streamoff_array, operator -, streamoff_array, streamoff_array); |
|
94 |
|
95 BIN_OP_DECL (streamoff_array, operator +, streamoff_array, std::streamoff); |
|
96 BIN_OP_DECL (streamoff_array, operator -, streamoff_array, std::streamoff); |
|
97 |
|
98 BIN_OP_DECL (streamoff_array, operator +, std::streamoff, streamoff_array); |
|
99 BIN_OP_DECL (streamoff_array, operator -, std::streamoff, streamoff_array); |
|
100 |
|
101 #endif |
|
102 |
|
103 /* |
|
104 ;;; Local Variables: *** |
|
105 ;;; mode: C++ *** |
|
106 ;;; End: *** |
|
107 */ |