96 error (
"sparse indexing needs 1 or 2 indices");
109 template <
typename T>
112 const std::list<octave_value_list>& idx)
119 retval = do_index_op (idx.front ());
125 std::string nm = type_name ();
126 error (
"%s cannot be indexed with %c", nm.c_str (),
type[0]);
137 template <
typename T>
140 const std::list<octave_value_list>& idx,
149 if (
type.length () != 1)
151 std::string nm = type_name ();
152 error (
"in indexed assignment of %s, last lhs index must be ()",
165 std::string nm = type_name ();
166 error (
"%s cannot be indexed with %c", nm.c_str (),
type[0]);
182 template <
typename T>
203 matrix.assign (i, rhs);
215 matrix.assign (i, j, rhs);
221 error (
"sparse indexing needs 1 or 2 indices");
232 typ.invalidate_type ();
235 template <
typename MT>
255 matrix.delete_elements (i);
267 matrix.delete_elements (i, j);
273 error (
"sparse indexing needs 1 or 2 indices");
284 typ.invalidate_type ();
287 template <
typename T>
296 template <
typename T>
309 if (t1.any_element_is_nan ())
326 template <
typename T>
335 template <
typename T>
339 print_raw (os, pr_as_read_syntax);
343 template <
typename T>
346 const std::string& prefix)
const
348 matrix.print_info (os, prefix);
351 template <
typename T>
354 bool pr_as_read_syntax)
const
366 os <<
"Compressed Column Sparse (rows = " << nr
376 double dnel = dnr * dnc;
380 double pct = (nz / dnel * 100);
402 os <<
" [" << std::setprecision (prec) << pct <<
"%]";
425 os <<
" (" << matrix.ridx (i)+1 <<
", " << j+1 <<
") -> ";
433 template <
typename MT>
441 template <
typename MT>
447 std::ostringstream buf;
452 template <
typename T>
459 matrix.maybe_compress ();
461 os <<
"# nnz: " << nnz () <<
"\n";
462 os <<
"# rows: " << dv(0) <<
"\n";
463 os <<
"# columns: " << dv(1) <<
"\n";
470 template <
typename T>
481 error (
"load: failed to extract number of rows and columns");
488 error (
"load: failed to load matrix constant");
495 template <
typename T>
508 template <
typename T>
512 if (umap == umap_xtolower || umap == umap_xtoupper)
542 switch (
retval.builtin_type ())
Array< U > map(F fcn) const
Apply function fcn to each element of the Array<T>.
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
SparseBoolMatrix all(int dim=-1) const
Vector representing the dimensions (size) of an Array.
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
bool all_ones(void) const
bool any_zero(void) const
void set_pos_if_unset(octave_idx_type nd_arg, octave_idx_type dim_arg)
bool print_as_scalar(void) const
float_display_format get_edit_display_format(void) const
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
void print(std::ostream &os, bool pr_as_read_syntax=false)
bool load_ascii(std::istream &is)
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
virtual void assign(const std::string &, const octave_value &)
bool save_ascii(std::ostream &os)
octave_value fast_elem_extract(octave_idx_type n) const
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
void delete_elements(const octave_value_list &idx)
octave_value map(octave_base_value::unary_mapper_t umap) const
octave_value resize(const dim_vector &dv, bool=false) const
void print_info(std::ostream &os, const std::string &prefix) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
octave_idx_type length(void) const
static octave_value empty_conv(const std::string &type, const octave_value &rhs=octave_value())
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
void error(const char *fmt,...)
#define panic_impossible()
void warn_array_as_logical(const dim_vector &dv)
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
void err_nan_to_logical_conversion(void)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value::octave_value(const Array< char > &chm, char type) return retval
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)