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