26 #if ! defined (octave_ov_base_mat_h)
27 #define octave_ov_base_mat_h 1
29 #include "octave-config.h"
47 template <
typename MT>
58 typ (t.is_known () ? new
MatrixType (t) : nullptr), idx_cache ()
60 if (matrix.ndims () == 0)
67 idx_cache (
m.idx_cache ? new
idx_vector (*
m.idx_cache) : nullptr)
72 size_t byte_size (
void)
const {
return matrix.byte_size (); }
86 const std::list<octave_value_list>& idx);
89 const std::list<octave_value_list>& idx,
int)
90 {
return subsref (
type, idx); }
93 const std::list<octave_value_list>& idx,
97 bool resize_ok =
false);
116 int ndims (
void)
const {
return matrix.ndims (); }
121 {
return MT (matrix.reshape (new_dims)); }
124 {
return MT (matrix.permute (vec, inv)); }
144 {
return octave_value (matrix.sort (sidx, dim, mode)); }
147 {
return matrix.issorted (mode); }
153 {
return matrix.is_sorted_rows (mode); }
165 bool print_as_scalar (
void)
const;
167 void print (std::ostream& os,
bool pr_as_read_syntax =
false);
169 void print_info (std::ostream& os,
const std::string& prefix)
const;
171 void short_disp (std::ostream& os)
const;
180 clear_cached_info ();
202 idx_cache = (idx ?
new idx_vector (idx) :
nullptr);
208 delete typ; typ =
nullptr;
209 delete idx_cache; idx_cache =
nullptr;
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
Sort by rows returns only indices.
Vector representing the dimensions (size) of an Array.
MatrixType matrix_type(void) const
octave_base_matrix(const MT &m, const MatrixType &t=MatrixType())
void maybe_economize(void)
octave_value sort(Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
bool isnumeric(void) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int)
octave_value permute(const Array< int > &vec, bool inv=false) const
octave_idx_type numel(void) const
octave_base_matrix(const octave_base_matrix &m)
octave_value diag(octave_idx_type k=0) const
octave_value diag(octave_idx_type m, octave_idx_type n) const
bool is_constant(void) const
bool is_matrix_type(void) const
const MT & matrix_ref(void) const
size_t byte_size(void) const
sortmode issorted(sortmode mode=UNSORTED) const
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
octave_value full_value(void) const
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
octave_value any(int dim=0) const
octave_value squeeze(void) const
octave_idx_type nnz(void) const
idx_vector set_idx_cache(const idx_vector &idx) const
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
octave_value all(int dim=0) const
~octave_base_matrix(void)
octave_value reshape(const dim_vector &new_dims) const
bool is_defined(void) const
void clear_cached_info(void) const
dim_vector dims(void) const
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
virtual void assign(const std::string &, const octave_value &)
virtual octave_value resize(const dim_vector &, bool fill=false) const
octave_value any(int dim=0) const
octave_value all(int dim=0) const
F77_RET_T const F77_DBLE * x
bool is_true(const std::string &s)
static float_display_format get_edit_display_format(const octave_value &val)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))