Mercurial > hg > octave-lyh
comparison liboctave/Array.cc @ 4898:8fd9495f5054
[project @ 2004-06-04 13:29:33 by jwe]
author | jwe |
---|---|
date | Fri, 04 Jun 2004 13:29:34 +0000 |
parents | bbddd4339cf2 |
children | c638c144d4da |
comparison
equal
deleted
inserted
replaced
4897:89eee52fd4c7 | 4898:8fd9495f5054 |
---|---|
2942 else | 2942 else |
2943 { | 2943 { |
2944 // We didn't start out with all zero dimensions, so if | 2944 // We didn't start out with all zero dimensions, so if |
2945 // index is a colon, it refers to the current LHS | 2945 // index is a colon, it refers to the current LHS |
2946 // dimension. Otherwise, it is OK to enlarge to a | 2946 // dimension. Otherwise, it is OK to enlarge to a |
2947 // dimension given by the largest index (but that index | 2947 // dimension given by the largest index, but if that |
2948 // needs to be a number, not a colon). | 2948 // index is a colon the new dimension is singleton. |
2949 | 2949 |
2950 if (i < lhs_dims_len | 2950 if (i < lhs_dims_len |
2951 && (idx(i).is_colon () || idx(i).max () < lhs_dims(i))) | 2951 && (idx(i).is_colon () || idx(i).max () < lhs_dims(i))) |
2952 new_dims(i) = lhs_dims(i); | 2952 new_dims(i) = lhs_dims(i); |
2953 else if (! idx(i).is_colon ()) | 2953 else if (! idx(i).is_colon ()) |
2954 new_dims(i) = idx(i).max () + 1; | 2954 new_dims(i) = idx(i).max () + 1; |
2955 else | 2955 else |
2956 { | 2956 new_dims(i) = 1; |
2957 // XXX FIXME XXX -- can we provide a more | |
2958 // informative message here? | |
2959 | |
2960 (*current_liboctave_error_handler) | |
2961 ("invalid array index for assignment"); | |
2962 | |
2963 retval = 0; | |
2964 | |
2965 break; | |
2966 } | |
2967 } | 2957 } |
2968 } | 2958 } |
2969 | 2959 |
2970 if (retval != 0) | 2960 if (retval != 0) |
2971 { | 2961 { |