26 #if ! defined (octave_ov_base_diag_h)
27 #define octave_ov_base_diag_h 1
29 #include "octave-config.h"
45 template <
typename DMT,
typename MT>
64 size_t byte_size (
void)
const {
return matrix.byte_size (); }
76 const std::list<octave_value_list>& idx);
79 const std::list<octave_value_list>& idx,
int)
80 {
return subsref (
type, idx); }
83 bool resize_ok =
false);
86 const std::list<octave_value_list>& idx,
94 {
return to_dense ().
reshape (new_dims); }
100 || (vec.
xelem (0) == 0 && vec.
xelem (1) == 1)))
103 return to_dense ().permute (vec, inv);
113 {
return matrix_type (); }
123 {
return to_dense ().
sort (dim, mode); }
126 {
return to_dense ().
sort (sidx, dim, mode); }
129 {
return to_dense ().issorted (mode); }
135 {
return to_dense ().is_sorted_rows (mode); }
149 double double_value (
bool =
false)
const;
151 float float_value (
bool =
false)
const;
154 {
return double_value (frc_str_conv); }
158 Matrix matrix_value (
bool =
false)
const;
160 FloatMatrix float_matrix_value (
bool =
false)
const;
162 Complex complex_value (
bool =
false)
const;
174 boolNDArray bool_array_value (
bool warn =
false)
const;
178 NDArray array_value (
bool =
false)
const;
210 octave_value convert_to_str_internal (
bool pad,
bool force,
char type)
const;
212 void print_raw (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
219 bool save_ascii (std::ostream& os);
221 bool load_ascii (std::istream& is);
227 mxArray * as_mxArray (
void)
const;
229 bool print_as_scalar (
void)
const;
231 void print (std::ostream& os,
bool pr_as_read_syntax =
false);
233 void print_info (std::ostream& os,
const std::string& prefix)
const;
235 void short_disp (std::ostream& os)
const;
246 typename DMT::element_type&)
const = 0;
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
Sort by rows returns only indices.
T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type numel(void) const
Number of elements in the array.
Vector representing the dimensions (size) of an Array.
MatrixType matrix_type(const MatrixType &) const
size_t byte_size(void) const
int32NDArray int32_array_value(void) const
octave_value full_value(void) const
octave_value all(int dim=0) const
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
octave_base_diag(const octave_base_diag &m)
octave_value reshape(const dim_vector &new_dims) const
~octave_base_diag(void)=default
bool is_constant(void) const
octave_value sort(Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
dim_vector dims(void) const
bool isnumeric(void) const
octave_value any(int dim=0) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int)
uint64NDArray uint64_array_value(void) const
bool is_defined(void) const
int64NDArray int64_array_value(void) const
octave_value permute(const Array< int > &vec, bool inv=false) const
MatrixType matrix_type(void) const
octave_idx_type nnz(void) const
double scalar_value(bool frc_str_conv=false) const
octave_value squeeze(void) const
int8NDArray int8_array_value(void) const
sortmode issorted(sortmode mode=UNSORTED) const
bool is_diag_matrix(void) const
octave_base_diag(const DMT &m)
int16NDArray int16_array_value(void) const
uint32NDArray uint32_array_value(void) const
virtual bool chk_valid_scalar(const octave_value &, typename DMT::element_type &) const =0
uint16NDArray uint16_array_value(void) const
uint8NDArray uint8_array_value(void) const
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
bool is_matrix_type(void) const
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
virtual octave_value diag(octave_idx_type k=0) const
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
octave_value any(int dim=0) const
octave_value reshape(const dim_vector &dv) const
octave_value all(int dim=0) const
bool is_true(const std::string &s)
static float_display_format get_edit_display_format(const octave_value &val)
std::complex< double > Complex
std::complex< float > FloatComplex