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 |
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #include "Array-flags.h" |
4505
|
25 #include "Range.h" |
3665
|
26 #include "idx-vector.h" |
|
27 #include "lo-error.h" |
|
28 |
4513
|
29 #if 0 |
3665
|
30 |
|
31 template <class T> |
|
32 ArrayN<T> |
|
33 ArrayN<T>::value (void) |
|
34 { |
|
35 ArrayN<T> retval; |
|
36 |
|
37 int n_idx = index_count (); |
|
38 |
|
39 if (n_idx > 1) |
|
40 { |
4273
|
41 Array<idx_vector> ra_idx (n_idx); |
3665
|
42 |
|
43 idx_vector *tmp = get_idx (); |
|
44 |
|
45 for (int i = 0; i < n_idx; i++) |
4273
|
46 ra_idx(i) = tmp[i]; |
3665
|
47 |
4273
|
48 return index (ra_idx); |
3665
|
49 } |
|
50 else if (n_idx == 1) |
|
51 { |
|
52 idx_vector *tmp = get_idx (); |
|
53 |
4273
|
54 idx_vector ra_idx = tmp[0]; |
3665
|
55 |
4273
|
56 return index (ra_idx); |
3665
|
57 } |
|
58 else |
|
59 (*current_liboctave_error_handler) |
|
60 ("invalid number of indices for array expression"); |
|
61 |
|
62 clear_index (); |
|
63 |
|
64 return retval; |
|
65 } |
|
66 |
|
67 #endif |
4493
|
68 |
3665
|
69 /* |
|
70 ;;; Local Variables: *** |
|
71 ;;; mode: C++ *** |
|
72 ;;; End: *** |
|
73 */ |