96 error (
"sparse indexing needs 1 or 2 indices");
99 catch (octave::index_exception& ie)
102 ie.set_pos_if_unset (n_idx, k+1);
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 ()",
156 retval = numeric_assign (type, idx, rhs);
165 std::string nm = type_name ();
166 error (
"%s cannot be indexed with %c", nm.c_str (), type[0]);
171 retval = tmp.
subsasgn (type, idx, rhs);
182 template <
typename MT>
202 matrix.delete_elements (i);
214 matrix.delete_elements (i, j);
220 error (
"sparse indexing needs 1 or 2 indices");
223 catch (octave::index_exception& ie)
226 ie.set_pos_if_unset (
len, k+1);
231 typ.invalidate_type ();
234 template <
typename T>
243 template <
typename T>
256 if (t1.any_element_is_nan ())
273 template <
typename T>
282 template <
typename T>
286 print_raw (os, pr_as_read_syntax);
290 template <
typename T>
293 const std::string& prefix)
const
295 matrix.print_info (os, prefix);
298 template <
typename T>
301 bool pr_as_read_syntax)
const
303 octave::preserve_stream_state stream_state (os);
313 os <<
"Compressed Column Sparse (rows = " << nr
323 double dnel = dnr * dnc;
327 double pct = (nz / dnel * 100);
349 os <<
" [" << std::setprecision (prec) << pct <<
"%]";
372 os <<
" (" << matrix.ridx (i)+1 <<
", " << j+1 <<
") -> ";
380 template <
typename MT>
388 template <
typename MT>
394 std::ostringstream buf;
399 template <
typename T>
406 matrix.maybe_compress ();
408 os <<
"# nnz: " << nnz () <<
"\n";
409 os <<
"# rows: " << dv(0) <<
"\n";
410 os <<
"# columns: " << dv(1) <<
"\n";
417 template <
typename T>
428 error (
"load: failed to extract number of rows and columns");
435 error (
"load: failed to load matrix constant");
442 template <
typename T>
455 template <
typename T>
459 if (umap == umap_xtolower || umap == umap_xtoupper)
OCTAVE_API 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
OCTINTERP_API bool print_as_scalar(void) const
OCTINTERP_API float_display_format get_edit_display_format(void) const
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
OCTINTERP_API void print(std::ostream &os, bool pr_as_read_syntax=false)
OCTINTERP_API bool load_ascii(std::istream &is)
OCTINTERP_API void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
OCTINTERP_API bool save_ascii(std::ostream &os)
OCTINTERP_API octave_value fast_elem_extract(octave_idx_type n) const
OCTINTERP_API octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
OCTINTERP_API void delete_elements(const octave_value_list &idx)
OCTINTERP_API octave_value map(octave_base_value::unary_mapper_t umap) const
OCTINTERP_API bool is_true(void) const
OCTINTERP_API octave_value resize(const dim_vector &dv, bool=false) const
OCTINTERP_API void print_info(std::ostream &os, const std::string &prefix) const
OCTINTERP_API octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
OCTINTERP_API std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
octave_idx_type length(void) const
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
builtin_type_t builtin_type(void) const
static OCTINTERP_API octave_value empty_conv(const std::string &type, const octave_value &rhs=octave_value())
OCTINTERP_API octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, std::size_t skip=1)
octave_value map(octave_base_value::unary_mapper_t umap) const
SparseBoolMatrix sparse_bool_matrix_value(bool warn=false) const
OCTINTERP_API octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
void error(const char *fmt,...)
#define panic_impossible()
void warn_array_as_logical(const dim_vector &dv)
octave::idx_vector idx_vector
void err_nan_to_logical_conversion(void)
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)