41 template <
typename MT>
44 const std::list<octave_value_list>& idx)
51 retval = do_index_op (idx.front ());
58 error (
"%s cannot be indexed with %c", nm.c_str (), type[0]);
69 template <
typename MT>
72 const std::list<octave_value_list>& idx,
81 if (type.length () == 1)
82 retval = numeric_assign (type, idx, rhs);
91 error (
"invalid assignment expression");
95 retval = tmp.
subsasgn (type, idx, rhs);
100 error (
"in indexed assignment of %s, last lhs index must be ()",
112 error (
"%s cannot be indexed with %c", nm.c_str (), type[0]);
117 retval = tmp.
subsasgn (type, idx, rhs);
128 template <
typename MT>
138 const MT& cmatrix =
matrix;
160 retval = cmatrix.checkelem (i(0));
162 retval = MT (
matrix.index (i, resize_ok));
175 retval = cmatrix.checkelem (i(0), j(0));
177 retval = MT (
matrix.index (i, j, resize_ok));
184 bool scalar_opt = n_idx == nd && ! resize_ok;
187 for (k = 0; k < n_idx; k++)
189 idx_vec(k) = idx(k).index_vector ();
191 scalar_opt = (scalar_opt && idx_vec(k).is_scalar ());
197 retval = MT (
matrix.index (idx_vec, resize_ok));
212 template <
typename MT>
247 matrix.assign (i, j, rhs);
255 for (k = 0; k < n_idx; k++)
256 idx_vec(k) = idx(k).index_vector ();
258 matrix.assign (idx_vec, rhs);
269 clear_cached_info ();
272 template <
typename MT>
281 template <
typename MT>
284 typename MT::element_type rhs)
330 matrix.assign (i, j, mrhs);
337 bool scalar_opt = n_idx == nd;
340 for (k = 0; k < n_idx; k++)
342 idx_vec(k) = idx(k).index_vector ();
344 scalar_opt = (scalar_opt && idx_vec(k).is_scalar ()
345 && idx_vec(k)(0) <
dv(k));
356 j += idx_vec(
i)(0) * n;
362 matrix.assign (idx_vec, mrhs);
373 clear_cached_info ();
376 template <
typename MT>
387 matrix.delete_elements (ra_idx);
390 clear_cached_info ();
393 template <
typename MT>
399 retval.resize (dv, 0);
406 template <
typename MT>
412 int nel = dv.
numel ();
418 if (t1.any_element_is_nan ())
432 template <
typename MT>
441 template <
typename MT>
445 print_raw (os, pr_as_read_syntax);
449 template <
typename MT>
454 matrix.print_info (os, prefix);
457 template <
typename MT>
463 else if (
matrix.ndims () == 2)
480 std::ostringstream buf;
483 size_t pos = tmp.find_first_not_of (
" ");
484 if (pos != std::string::npos)
485 os << tmp.substr (pos);
486 else if (! tmp.empty ())
489 if (++elts >= max_elts)
496 if (
i < nr - 1 && elts < max_elts)
509 template <
typename MT>
519 template <
typename MT>
527 typedef typename MT::element_type ET;
533 void *here =
reinterpret_cast<void *
> (&
matrix(n));
boolNDArray all(int dim=-1) const
void short_disp(std::ostream &os) const
bool fast_elem_insert(octave_idx_type n, const octave_value &x)
const octave_base_value const Array< octave_idx_type > & ra_idx
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
void assign(const octave_value_list &idx, const MT &rhs)
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
void set_pos_if_unset(octave_idx_type nd_arg, octave_idx_type dim_arg)
octave_idx_type length(void) const
void delete_elements(const octave_value_list &idx)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the then the first element defines the pivoting tolerance for the unsymmetric the values defined such that for full matrix
void err_invalid_index(const std::string &idx, octave_idx_type nd, octave_idx_type dim, const std::string &)
void error(const char *fmt,...)
std::string idx(void) const
bool all_ones(void) const
virtual bool fast_elem_insert_self(void *where, builtin_type_t btyp) const
void err_nan_to_logical_conversion(void)
MatrixType matrix_type(void) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
void print(std::ostream &os, bool pr_as_read_syntax=false)
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
octave_value resize(const dim_vector &dv, bool fill=false) const
#define panic_impossible()
Array< octave_idx_type > conv_to_int_array(const Array< idx_vector > &a)
bool any_zero(void) const
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
N Dimensional Array with copy-on-write semantics.
=val(i)}if ode{val(i)}occurs in table i
const octave_base_value & get_rep(void) const
void octave_print_internal(std::ostream &, char, bool)
bool is_scalar(void) const
bool print_as_scalar(void) const
octave_value fast_elem_extract(octave_idx_type n) const
void warn_array_as_logical(const dim_vector &dv)
Vector representing the dimensions (size) of an Array.
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
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, size_t skip=1)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
static octave_value empty_conv(const std::string &type, const octave_value &rhs=octave_value())
void print_info(std::ostream &os, const std::string &prefix) const