28 #if defined (HAVE_CONFIG_H)
72 for (
int i = 0; i < nd; i++)
81 rep[-1] = (j > 2 ? j : 2);
87 std::ostringstream buf;
89 for (
int i = 0; i <
ndims (); i++)
97 std::string
retval = buf.str ();
107 for (
int i = 0; i <
ndims (); i++)
119 int n_dims =
ndims ();
121 for (
int i = 0; i < n_dims; i++)
127 throw std::bad_alloc ();
140 if (new_dims.
ndims () == 2 &&
xelem(0) == 1 && new_dims.
elem(1) == 1)
141 return new_dims.
as_row ();
159 int orig_nd =
ndims ();
160 int ndb = dvb.
ndims ();
161 int new_nd = (dim < ndb ? ndb : dim + 1);
162 if (new_nd > orig_nd)
171 for (
int i = 0; i < ndb; i++)
173 if (i != dim &&
rep[i] != dvb(i))
180 for (
int i = ndb; i < new_nd; i++)
182 if (i != dim &&
rep[i] != 1)
190 rep[dim] += (dim < ndb ? dvb(dim) : 1);
194 if (ndb == 2 && dvb(0) == 0 && dvb(1) == 0)
196 else if (orig_nd == 2 &&
rep[0] == 0 &&
rep[1] == 0)
226 bool e2dv =
rep[0] +
rep[1] == 1;
227 bool e2dvb = dvb(0) + dvb(1) == 1;
247 int n_dims =
ndims ();
256 std::fill_n (
retval.
rep + n_dims,
n - n_dims, 1);
271 for (
int i =
n; i < n_dims; i++)
charNDArray max(char d, const charNDArray &m)
Array< T >::ArrayRep * rep
Vector representing the dimensions (size) of an Array.
Array< octave_idx_type > as_array(void) const
bool concat(const dim_vector &dvb, int dim)
This corresponds to cat().
void chop_all_singletons(void)
std::string str(char sep='x') const
void resize(int n, int fill_value=0)
static dim_vector alloc(int n)
static octave_idx_type * nil_rep(void)
static octave_idx_type dim_max(void)
bool hvcat(const dim_vector &dvb, int dim)
This corresponds to [,] (horzcat, dim = 0) and [;] (vertcat, dim = 1).
void chop_trailing_singletons(void)
octave_idx_type & xelem(int i)
octave_idx_type ndims(void) const
Number of dimensions.
dim_vector squeeze(void) const
dim_vector redim(int n) const
Force certain dimensionality, preserving numel ().
dim_vector as_row(void) const
octave_idx_type & elem(int i)
octave_idx_type safe_numel(void) const
The following function will throw a std::bad_alloc () exception if the requested size is larger than ...
static const octave_idx_type idx_max
octave_value::octave_value(const Array< char > &chm, char type) return retval