24 #if !defined (octave_dim_vector_h)
25 #define octave_dim_vector_h 1
88 for (
int i = 0; i < l; i++)
112 for (j = 0; j < l; j++)
124 assert (count () == 0);
128 void make_unique (
void)
164 #define ASSIGN_REP(i) rep[i] = d ## i;
165 #define DIM_VECTOR_CTOR(N) \
166 dim_vector (OCT_MAKE_DECL_LIST (octave_idx_type, d, N)) \
169 OCT_ITERATE_MACRO (ASSIGN_REP, N) \
181 #undef DIM_VECTOR_CTOR
185 #ifdef BOUNDS_CHECKING
186 assert (i >= 0 && i < ndims ());
194 #ifdef BOUNDS_CHECKING
195 assert (i >= 0 && i < ndims ());
200 void chop_trailing_singletons (
void)
203 if (l > 2 && rep[l-1] == 1)
208 while (l > 2 && rep[l-1] == 1);
213 void chop_all_singletons (
void);
267 int length (
void)
const {
return ndims (); }
273 void resize (
int n,
int fill_value = 0)
288 std::string str (
char sep =
'x')
const;
290 bool all_zero (
void)
const
294 for (
int i = 0; i <
length (); i++)
306 bool empty_2d (
void)
const
312 bool zero_by_zero (
void)
const
317 bool any_zero (
void)
const
321 for (
int i = 0; i <
length (); i++)
350 for (
int i = n; i < n_dims; i++)
366 bool any_neg (
void)
const
371 for (i = 0; i < n_dims; i++)
415 int first_non_singleton (
int def = 0)
const
417 for (
int i = 0; i <
length (); i++)
431 for (
int i =
length () - 1; i >= 0; i--)
432 k = k * rep[i] + idx[i];
442 for (
int i = nidx - 1; i >= 0; i--)
443 k = k * rep[i] + idx[i];
455 for (i = start; i <
length (); i++)
457 if (++(*idx) == rep[i])
473 for (
int i = 0; i < nd; i++)
474 retval.
rep[i] = k *= rep[i];
486 for (
int i = 1; i <
length (); i++)
487 k += rep[i-1] * idx[i];
512 for (
int i = 0; i < a_len; i++)