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>
61 m_typ (t.is_known () ? new
MatrixType (t) : nullptr), m_idx_cache ()
63 if (m_matrix.ndims () == 0)
76 std::size_t
byte_size ()
const {
return m_matrix.byte_size (); }
90 subsref (
const std::string& type,
const std::list<octave_value_list>& idx);
96 const std::list<octave_value_list>& idx,
int)
97 {
return subsref (type, idx); }
100 subsasgn (
const std::string& type,
const std::list<octave_value_list>& idx,
124 int ndims ()
const {
return m_matrix.ndims (); }
129 {
return MT (m_matrix.reshape (new_dims)); }
132 {
return MT (m_matrix.permute (vec, inv)); }
152 {
return octave_value (m_matrix.sort (sidx, dim, mode)); }
155 {
return m_matrix.issorted (mode); }
161 {
return m_matrix.is_sorted_rows (mode); }
173 OCTINTERP_API
bool is_true ()
const;
175 OCTINTERP_API
bool print_as_scalar ()
const;
177 OCTINTERP_API
void print (std::ostream& os,
bool pr_as_read_syntax =
false);
180 print_info (std::ostream& os,
const std::string& prefix)
const;
182 OCTINTERP_API
void short_disp (std::ostream& os)
const;
186 OCTINTERP_API std::string
192 clear_cached_info ();
224 delete m_typ; m_typ =
nullptr;
225 delete m_idx_cache; m_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.
octave_base_matrix(const MT &m, const MatrixType &t=MatrixType())
octave_value sort(Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
bool is_matrix_type() 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
std::size_t byte_size() const
octave::idx_vector set_idx_cache(const octave::idx_vector &idx) const
octave_base_matrix(const octave_base_matrix &m)
bool is_full_num_matrix() const
octave::idx_vector * m_idx_cache
octave_value diag(octave_idx_type k=0) const
octave_value diag(octave_idx_type m, octave_idx_type n) const
octave_value full_value() const
octave_idx_type numel() const
sortmode issorted(sortmode mode=UNSORTED) const
const void * mex_get_data() const
octave_idx_type nnz() const
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
octave_value any(int dim=0) const
octave_value squeeze() const
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
octave_value all(int dim=0) const
MatrixType matrix_type() const
const MT & matrix_ref() const
void clear_cached_info() const
octave_value reshape(const dim_vector &new_dims) 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
octave::idx_vector idx_vector
F77_RET_T const F77_DBLE * x
bool is_true(const std::string &s)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))