26 #if defined (HAVE_CONFIG_H)
46 const std::list<octave_value_list>& idx)
60 error (
"%s cannot be indexed with %c", nm.c_str (), type[0]);
83 idx0 = idx(0).index_vector ();
85 idx1 = idx(1).index_vector ();
87 catch (octave::index_exception& ie)
90 ie.set_pos_if_unset (2, k+1);
107 if (idx0.is_colon ()) left =
false;
108 if (idx1.is_colon ()) right =
false;
128 if (nidx == 2 && ! resize_ok && idx0.is_scalar () && idx1.is_scalar ())
205 #define FORWARD_MATRIX_VALUE(TYPE, PREFIX) \
207 octave_perm_matrix::PREFIX ## _value (bool frc_str_conv) const \
209 return to_dense ().PREFIX ## _value (frc_str_conv); \
327 std::ostringstream buf;
336 os <<
"# orient: c\n";
355 error (
"load: failed to extract size & orientation");
357 bool colp = orient ==
'c';
361 error (
"load: failed to load permutation matrix constant");
379 os.write (
reinterpret_cast<char *
> (&sz), 4);
380 os.write (
reinterpret_cast<char *
> (&colp), 1);
382 os.write (
reinterpret_cast<const char *
> (col_perm.
data ()),
394 if (! (is.read (
reinterpret_cast<char *
> (&sz), 4)
395 && is.read (
reinterpret_cast<char *
> (&colp), 1)))
400 if (! is.read (
reinterpret_cast<char *
> (
m.fortran_vec ()),
m.byte_size ()))
405 int nel =
m.numel ();
406 for (
int i = 0; i < nel; i++)
430 bool pr_as_read_syntax)
const
462 return to_dense ().
write (os, block_size, output_type, skip, flt_fmt);
467 const std::string& prefix)
const
482 "permutation matrix",
"double");
524 std::ostringstream buf;
527 std::string tmp = buf.str ();
528 std::size_t pos = tmp.find_first_not_of (
' ');
529 if (pos != std::string::npos)
530 os << tmp.substr (pos);
531 else if (! tmp.empty ())
534 if (++elts >= max_elts)
541 if (i < nr - 1 && elts < max_elts)
void swap_bytes< 2 >(void *ptr)
void swap_bytes< 8 >(void *ptr)
void swap_bytes< 4 >(void *ptr)
std::size_t byte_size() const
Size of the specified dimension.
const T * data() const
Size of the specified dimension.
octave_idx_type numel() const
Number of elements in the array.
octave_idx_type elem(octave_idx_type i, octave_idx_type j) const
octave_idx_type numel() const
octave_idx_type rows() const
void print_info(std::ostream &os, const std::string &prefix) const
octave_idx_type checkelem(octave_idx_type i, octave_idx_type j) const
octave_idx_type cols() const
const Array< octave_idx_type > & col_perm_vec() const
octave_idx_type columns() 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.
octave_idx_type rows() const
octave_idx_type columns() const
virtual octave_idx_type numel() const
int current_print_indent_level() const
void newline(std::ostream &os) const
octave::refcount< octave_idx_type > m_count
friend class octave_value
static int static_type_id()
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
uint16NDArray uint16_array_value() const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
octave_value as_int16() const
std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
type_conv_info numeric_conversion_function() const
uint64NDArray uint64_array_value() const
std::string type_name() const
SparseMatrix sparse_matrix_value(bool=false) const
octave_base_value * try_narrowing_conversion()
void print(std::ostream &os, bool pr_as_read_syntax=false)
octave_value as_int64() const
void print_info(std::ostream &os, const std::string &prefix) const
bool save_binary(std::ostream &os, bool save_as_floats)
double double_value(bool=false) const
float_display_format get_edit_display_format() const
int8NDArray int8_array_value() const
octave_value as_int8() const
FloatNDArray float_array_value(bool=false) const
bool print_as_scalar() const
int32NDArray int32_array_value() const
int64NDArray int64_array_value() const
SparseBoolMatrix sparse_bool_matrix_value(bool=false) const
uint8NDArray uint8_array_value() const
virtual octave_value to_dense() const
bool load_ascii(std::istream &is)
octave_value as_double() const
octave_value as_uint8() const
float float_value(bool=false) const
FloatComplex float_complex_value(bool=false) const
Complex complex_value(bool=false) const
octave_value fast_elem_extract(octave_idx_type n) const
int16NDArray int16_array_value() const
uint32NDArray uint32_array_value() const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
int write(octave::stream &os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const
octave::idx_vector index_vector(bool require_integers=false) const
bool save_ascii(std::ostream &os)
octave_value as_uint32() const
Matrix matrix_value(bool=false) const
octave_value as_uint64() const
octave_value as_single() const
octave_value as_uint16() const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
octave_value m_dense_cache
mxArray * as_mxArray(bool interleaved) const
void short_disp(std::ostream &os) const
octave_value as_int32() const
octave_idx_type length() const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, std::size_t skip=1)
int write(octave::stream &os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const
mxArray * as_mxArray(bool interleaved=false) const
void() error(const char *fmt,...)
#define panic_impossible()
void warn_array_as_logical(const dim_vector &dv)
void err_invalid_conversion(const std::string &from, const std::string &to)
void warn_implicit_conversion(const char *id, const char *from, const char *to)
octave::idx_vector idx_vector
float lo_ieee_float_nan_value()
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
std::complex< double > Complex
std::complex< float > FloatComplex
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
#define FORWARD_MATRIX_VALUE(TYPE, PREFIX)
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)