3665
|
1 // Template array classes |
|
2 /* |
|
3 |
|
4 Copyright (C) 2000 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
20 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
21 02110-1301, USA. |
3665
|
22 |
|
23 */ |
|
24 |
|
25 #include "Array-flags.h" |
4505
|
26 #include "Range.h" |
3665
|
27 #include "idx-vector.h" |
|
28 #include "lo-error.h" |
|
29 |
4513
|
30 #if 0 |
3665
|
31 |
|
32 template <class T> |
|
33 ArrayN<T> |
|
34 ArrayN<T>::value (void) |
|
35 { |
|
36 ArrayN<T> retval; |
|
37 |
|
38 int n_idx = index_count (); |
|
39 |
|
40 if (n_idx > 1) |
|
41 { |
4273
|
42 Array<idx_vector> ra_idx (n_idx); |
3665
|
43 |
|
44 idx_vector *tmp = get_idx (); |
|
45 |
|
46 for (int i = 0; i < n_idx; i++) |
4273
|
47 ra_idx(i) = tmp[i]; |
3665
|
48 |
4273
|
49 return index (ra_idx); |
3665
|
50 } |
|
51 else if (n_idx == 1) |
|
52 { |
|
53 idx_vector *tmp = get_idx (); |
|
54 |
4273
|
55 idx_vector ra_idx = tmp[0]; |
3665
|
56 |
4273
|
57 return index (ra_idx); |
3665
|
58 } |
|
59 else |
|
60 (*current_liboctave_error_handler) |
|
61 ("invalid number of indices for array expression"); |
|
62 |
|
63 clear_index (); |
|
64 |
|
65 return retval; |
|
66 } |
|
67 |
|
68 #endif |
4493
|
69 |
3665
|
70 /* |
|
71 ;;; Local Variables: *** |
|
72 ;;; mode: C++ *** |
|
73 ;;; End: *** |
|
74 */ |