24 #if defined (HAVE_CONFIG_H) 60 for (
int i = 0;
i < nd;
i++)
69 rep[-1] = (j > 2 ? j : 2);
75 std::ostringstream buf;
107 int n_dims =
ndims ();
109 for (
int i = 0;
i < n_dims;
i++)
115 throw std::bad_alloc ();
128 if (new_dims.
ndims () == 2 &&
xelem(0) == 1 && new_dims.
elem(1) == 1)
129 return new_dims.
as_row ();
147 int orig_nd =
ndims ();
148 int ndb = dvb.
ndims ();
149 int new_nd = (dim < ndb ? ndb : dim + 1);
150 if (new_nd > orig_nd)
159 for (
int i = 0;
i < ndb;
i++)
161 if (
i != dim &&
rep[
i] != dvb(
i))
168 for (
int i = ndb;
i < new_nd;
i++)
170 if (
i != dim &&
rep[
i] != 1)
178 rep[dim] += (dim < ndb ? dvb(dim) : 1);
182 if (ndb == 2 && dvb(0) == 0 && dvb(1) == 0)
184 else if (orig_nd == 2 &&
rep[0] == 0 &&
rep[1] == 0)
214 bool e2dv =
rep[0] +
rep[1] == 1;
215 bool e2dvb = dvb(0) + dvb(1) == 1;
235 int n_dims =
ndims ();
244 std::fill_n (
retval.
rep + n_dims, n - n_dims, 1);
259 for (
int i = n;
i < n_dims;
i++)
std::string str(char sep='x') const
octave_idx_type safe_numel(void) const
The following function will throw a std::bad_alloc () exception if the requested size is larger than ...
dim_vector as_row(void) const
void resize(int n, int fill_value=0)
octave_idx_type & xelem(int i)
octave_idx_type & elem(int i)
octave_base_value * rep
The real representation.
bool concat(const dim_vector &dvb, int dim)
This corresponds to cat().
void chop_all_singletons(void)
static octave_idx_type * nil_rep(void)
static const octave_idx_type idx_max
Array< octave_idx_type > as_array(void) const
static dim_vector alloc(int n)
dim_vector redim(int n) const
Force certain dimensionality, preserving numel ().
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).
dim_vector squeeze(void) const
static octave_idx_type dim_max(void)
octave_idx_type ndims(void) const
Number of dimensions.
Vector representing the dimensions (size) of an Array.
void chop_trailing_singletons(void)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string