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 (
void)
const {
return m_matrix.byte_size (); }
90 subsref (
const std::string& type,
const std::list<octave_value_list>& idx);
93 const std::list<octave_value_list>& idx,
int)
94 {
return subsref (type, idx); }
97 subsasgn (
const std::string& type,
const std::list<octave_value_list>& idx,
121 int ndims (
void)
const {
return m_matrix.ndims (); }
126 {
return MT (m_matrix.reshape (new_dims)); }
129 {
return MT (m_matrix.permute (vec, inv)); }
149 {
return octave_value (m_matrix.sort (sidx, dim, mode)); }
152 {
return m_matrix.issorted (mode); }
158 {
return m_matrix.is_sorted_rows (mode); }
168 OCTINTERP_API
bool is_true (
void)
const;
170 OCTINTERP_API
bool print_as_scalar (
void)
const;
172 OCTINTERP_API
void print (std::ostream& os,
bool pr_as_read_syntax =
false);
175 print_info (std::ostream& os,
const std::string& prefix)
const;
177 OCTINTERP_API
void short_disp (std::ostream& os)
const;
181 OCTINTERP_API std::string
187 clear_cached_info ();
219 delete m_typ; m_typ =
nullptr;
220 delete m_idx_cache; m_idx_cache =
nullptr;
OCTARRAY_API 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
const void * mex_get_data(void) const
octave_idx_type numel(void) const
std::size_t byte_size(void) const
octave::idx_vector set_idx_cache(const octave::idx_vector &idx) const
octave_base_matrix(const octave_base_matrix &m)
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
bool is_constant(void) const
bool is_matrix_type(void) const
const MT & matrix_ref(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
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
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()) ? '\'' :'"'))
static float_display_format get_edit_display_format(const octave_value &val)