85 error (
"sparse indexing needs 1 or 2 indices");
94 const std::list<octave_value_list>& idx)
101 retval = do_index_op (idx.front ());
107 std::string nm = type_name ();
108 error (
"%s cannot be indexed with %c", nm.c_str (), type[0]);
122 const std::list<octave_value_list>& idx,
131 if (type.length () == 1)
132 retval = numeric_assign (type, idx, rhs);
135 std::string nm = type_name ();
136 error (
"in indexed assignment of %s, last lhs index must be ()",
149 retval = tmp.
subsasgn (type, idx, rhs);
153 std::string nm = type_name ();
154 error (
"%s cannot be indexed with %c", nm.c_str (), type[0]);
180 matrix.assign (i, rhs);
194 matrix.assign (i, j, rhs);
201 error (
"sparse indexing needs 1 or 2 indices");
206 typ.invalidate_type ();
222 matrix.delete_elements (i);
236 matrix.delete_elements (i, j);
243 error (
"sparse indexing needs 1 or 2 indices");
247 typ.invalidate_type ();
268 if (nz == nel && nel > 0)
293 print_raw (os, pr_as_read_syntax);
300 const std::string& prefix)
const
302 matrix.print_info (os, prefix);
308 bool pr_as_read_syntax)
const
320 os <<
"Compressed Column Sparse (rows = " << nr
330 double dnel = dnr * dnc;
334 double pct = (nz / dnel * 100);
356 os <<
" [" << std::setprecision (prec) << pct <<
"%]";
379 os <<
" (" << matrix.ridx (i)+1 <<
", " << j+1 <<
") -> ";
394 matrix.maybe_compress ();
396 os <<
"# nnz: " << nnz () <<
"\n";
397 os <<
"# rows: " << dv (0) <<
"\n";
398 os <<
"# columns: " << dv (1) <<
"\n";
424 error (
"load: failed to load matrix constant");
432 error (
"load: failed to extract number of rows and columns");
457 if (umap == umap_xtolower || umap == umap_xtoupper)
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
octave_idx_type length(void) const
bool load_ascii(std::istream &is)
void error(const char *fmt,...)
octave_value map(octave_base_value::unary_mapper_t umap) const
bool print_as_scalar(void) const
bool all_ones(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)
void assign(const octave_value_list &idx, const T &rhs)
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
SparseBoolMatrix all(int dim=-1) const
octave_value map(octave_base_value::unary_mapper_t umap) const
SparseBoolMatrix sparse_bool_matrix_value(bool warn=false) const
#define panic_impossible()
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
void print(std::ostream &os, bool pr_as_read_syntax=false)
void print_info(std::ostream &os, const std::string &prefix) const
bool any_zero(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
bool save_ascii(std::ostream &os)
void delete_elements(const octave_value_list &idx)
octave_value fast_elem_extract(octave_idx_type n) const
octave_value resize(const dim_vector &dv, bool=false) const
void octave_print_internal(std::ostream &, char, bool)
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
builtin_type_t builtin_type(void) const
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, size_t skip=1)
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())