annotate liboctave/so-array.h @ 5210:996a08a3eb06 ss-2-9-0

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