46 (*current_liboctave_error_handler)
47 (
"invalid range used as index");
53 (*current_liboctave_error_handler)
54 (
"internal error: idx_vector index out of range");
60 (*current_liboctave_error_handler)
61 (
"internal error: as_array not allowed for this index class");
72 (*current_liboctave_error_handler)
73 (
"internal error: invalid character converted to idx_vector; must be ':'");
93 (*current_liboctave_error_handler)
94 (
"internal error: idx_colon_rep::sort_idx");
111 : start(_start), len (_step ? std::
max ((_limit - _start) / _step, static_cast<
octave_idx_type> (0)) : -1), step (_step)
126 : start (0), len (r.
nelem ()), step (1)
156 if (i < 0 || i >= len)
162 return start + i*step;
180 if (step < 0 && len > 0)
184 idx.
xelem (i) = len - 1 - i;
200 os << start <<
':' << step <<
':' << start + len*step;
207 return Range (static_cast<double> (start+1),
208 static_cast<double> (step), len);
216 retval.
xelem (i) = start + i*step;
239 if (static_cast<double> (i) !=
x)
248 return convert_index (static_cast<double> (x), conv_error, ext);
324 :
data (0), len (nda.
numel ()), ext (0), aowner (0), orig_dims (nda.
dims ())
384 :
data (0), len (b ? 1 : 0), ext (0), aowner (0), orig_dims (len, len)
397 :
data (0), len (nnz), ext (0), aowner (0), orig_dims ()
426 :
data (0), len (bnda.
nnz ()), ext (0), aowner (0), orig_dims ()
445 d[k++] = j * nr + bnda.
ridx (i);
464 if (n < 0 || n >= len)
483 std::auto_ptr<idx_vector_rep> new_rep (
486 if (ext > len*
xlog2 (1.0 + len))
490 new_rep->
data = new_data;
492 std::copy (
data,
data + len, new_data);
495 lsort.
sort (new_data, len);
501 new_rep->
len = new_len;
519 new_rep->
len = new_len;
526 new_rep->
data = new_data;
540 new_rep->
data = new_data;
549 return new_rep.release ();
556 std::auto_ptr<idx_vector_rep> new_rep (
559 if (ext > len*
xlog2 (1.0 + len))
562 idx.
clear (orig_dims);
568 new_rep->
data = new_data;
569 std::copy (
data,
data + len, new_data);
573 lsort.
sort (new_data, idx_data, len);
583 idx.
clear (orig_dims);
587 new_rep->
data = new_data;
604 return new_rep.release ();
613 os <<
data[ii] <<
',' <<
' ';
616 os <<
data[len-1]; os <<
']';
650 :
data (0), len (b ? 1 : 0), ext (0), lsti (-1), lste (-1),
651 aowner (0), orig_dims (len, len)
655 bool *
d =
new bool [1];
664 :
data (0), len (nnz), ext (bnda.
numel ()), lsti (-1), lste (-1),
665 aowner (0), orig_dims ()
672 while (
ext > 0 && ! bnda(
ext-1))
699 while (!
data[++lste]) ;
706 if (
data[++lste]) --n;
714 if (n < 0 || n >= len)
729 os <<
data[ii] <<
',' <<
' ';
732 os <<
data[ext-1]; os <<
']';
761 retval.
xelem (j++) = i;
786 if (nnz <= bnda.
numel () / factor)
796 bool reduced =
false;
893 if ((l*t == n && tj == 1) || (t == 0 && tj == 0))
1068 for (i = start, j = start + len; i < j; i++) *data++ = i;
1069 else if (step == -1)
1070 for (i = start, j = start - len; i > j; i--) *data++ = i;
1072 for (i = 0, j = start; i < len; i++, j += step) *data++ = j;
1113 (*current_liboctave_error_handler)
1114 (
"internal error: out of range complement index requested");
1124 ndata[i] = ! data[i];
1142 bool retval =
false;
1171 assert (n ==
length (n));
1191 idx.
xelem (ri[i]) = i;
1217 ext = len > 0 ? idata[len - 1] + 1 : 0;
1285 if (! resize_ok &&
extent (z_len) > z_len)
1287 (*current_liboctave_error_handler)
1288 (
"invalid matrix index = %d",
extent (z_len));
1314 #define INSTANTIATE_SCALAR_VECTOR_REP_CONST(T) \
1315 template OCTAVE_API idx_vector::idx_scalar_rep::idx_scalar_rep (T); \
1316 template OCTAVE_API idx_vector::idx_vector_rep::idx_vector_rep (const Array<T>&);