50 for (
int i = 0; i < l; i++)
59 ndims () = j > 2 ? j : 2;
65 std::ostringstream buf;
67 for (
int i = 0; i <
length (); i++)
71 if (i < length () - 1)
75 std::string retval = buf.str ();
85 for (
int i = 0; i <
length (); i++)
99 for (
int i = 0; i < n_dims; i++)
105 throw std::bad_alloc ();
116 bool dims_changed = 1;
120 for (
int i = 0; i <
length (); i++)
125 new_dims(k++) =
elem (i);
179 int orig_nd =
ndims ();
180 int ndb = dvb.
ndims ();
181 int new_nd = dim < ndb ? ndb : dim + 1;
182 if (new_nd > orig_nd)
191 for (
int i = 0; i < ndb; i++)
193 if (i != dim &&
rep[i] != dvb(i))
200 for (
int i = ndb; i < new_nd; i++)
202 if (i != dim &&
rep[i] != 1)
210 rep[dim] += (dim < ndb ? dvb(dim) : 1);
215 if (ndb == 2 && dvb(0) == 0 && dvb(1) == 0)
217 else if (orig_nd == 2 &&
rep[0] == 0 &&
rep[1] == 0)
247 bool e2dv =
rep[0] +
rep[1] == 1;
248 bool e2dvb = dvb(0) + dvb(1) == 1;
276 for (
int i = 0; i < n_dims; i++)
279 for (
int i = n_dims; i < n; i++)
292 for (
int i = 0; i < n-1; i++)
296 for (
int i = n; i < n_dims; i++)
std::string str(char sep= 'x') const
void resize(int n, int fill_value=0)
octave_idx_type & elem(int i)
dim_vector squeeze(void) const
bool concat(const dim_vector &dvb, int dim)
This corresponds to cat().
octave_idx_type safe_numel(void) const
octave_idx_type & ndims(void) const
void chop_all_singletons(void)
static const octave_idx_type idx_max
dim_vector redim(int n) const
static dim_vector alloc(int n)
charNDArray max(char d, const charNDArray &m)
bool hvcat(const dim_vector &dvb, int dim)
This corresponds to [,] (horzcat, dim = 0) and [;] (vertcat, dim = 1).
static bool match(const std::string &filename_arg, const std::string &path_elt_arg)
static octave_idx_type dim_max(void)
void chop_trailing_singletons(void)