23 #if defined (HAVE_CONFIG_H) 43 const std::list<octave_value_list>& idx)
57 error (
"%s cannot be indexed with %c",
nm.c_str (),
type[0]);
80 idx0 = idx(0).index_vector ();
82 idx1 = idx(1).index_vector ();
87 e.set_pos_if_unset (2,
k+1);
202 #define FORWARD_MATRIX_VALUE(TYPE, PREFIX) \ 204 octave_perm_matrix::PREFIX ## _value (bool frc_str_conv) const \ 206 return to_dense ().PREFIX ## _value (frc_str_conv); \ 324 std::ostringstream buf;
333 os <<
"# orient: c\n";
352 error (
"load: failed to extract size & orientation");
354 bool colp = orient ==
'c';
358 error (
"load: failed to load permutation matrix constant");
376 os.
write (reinterpret_cast<char *> (&
sz), 4);
377 os.
write (reinterpret_cast<char *> (&colp), 1);
379 os.
write (reinterpret_cast<const char *> (col_perm.
data ()),
391 if (! (
is.read (reinterpret_cast<char *> (&
sz), 4)
392 &&
is.read (reinterpret_cast<char *> (&colp), 1)))
402 int nel = m.
numel ();
403 for (
int i = 0;
i < nel;
i++)
427 bool pr_as_read_syntax)
const 479 "permutation matrix",
"double");
521 std::ostringstream buf;
525 size_t pos =
tmp.find_first_not_of (
' ');
526 if (pos != std::string::npos)
527 os <<
tmp.substr (pos);
528 else if (!
tmp.empty ())
531 if (++elts >= max_elts)
538 if (
i < nr - 1 && elts < max_elts)
octave_idx_type write(const octave_value &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, mach_info::float_format flt_fmt)
octave_value as_uint32(void) const
SparseMatrix sparse_matrix_value(bool=false) const
octave_value as_uint64(void) const
octave_value as_int64(void) const
octave_value as_int32(void) const
uint8NDArray uint8_array_value(void) const
octave_idx_type numel(void) const
characters Given a string matrix
octave_idx_type rows(void) const
const T * data(void) const
uint32NDArray uint32_array_value(void) const
int64NDArray int64_array_value(void) const
mxArray * as_mxArray(void) const
int current_print_indent_level(void) const
octave_value as_single(void) const
uint64NDArray uint64_array_value(void) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
void print_info(std::ostream &os, const std::string &prefix) const
void newline(std::ostream &os) const
Complex complex_value(bool=false) const
const T * fortran_vec(void) const
void swap_bytes< 8 >(void *ptr)
void error(const char *fmt,...)
void swap_bytes< 2 >(void *ptr)
void print_info(std::ostream &os, const std::string &prefix) const
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
bool print_as_scalar(void) const
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
octave::mach_info::float_format flt_fmt
bool is_defined(void) const
virtual octave_value to_dense(void) const
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
in this the arguments are accumulated from left to right
octave_base_value * try_narrowing_conversion(void)
bool save_binary(std::ostream &os, bool &save_as_floats)
octave_value as_uint8(void) const
int32NDArray int32_array_value(void) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
bool any_zero(void) const
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
bool is_permutation(octave_idx_type n) const
idx_vector index_vector(bool require_integers=false) const
then the function must return scalars which will be concatenated into the return array(s). If code
Matrix matrix_value(bool=false) const
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)
std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
void swap_bytes< 4 >(void *ptr)
static octave_base_value * default_numeric_conversion_function(const octave_base_value &a)
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
bool is_colon(void) const
octave_idx_type rows(void) const
dim_vector dims(void) const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
static int static_type_id(void)
float_display_format get_edit_display_format(void) const
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_value as_double(void) const
type_conv_info numeric_conversion_function(void) const
void short_disp(std::ostream &os) const
#define panic_impossible()
virtual octave_idx_type numel(void) const
double double_value(bool=false) const
SparseBoolMatrix sparse_bool_matrix_value(bool=false) const
void print(std::ostream &os, bool pr_as_read_syntax=false)
float lo_ieee_float_nan_value(void)
int8NDArray int8_array_value(void) const
const Array< octave_idx_type > & col_perm_vec(void) const
FloatNDArray float_array_value(bool=false) const
friend class octave_value
bool load_ascii(std::istream &is)
octave_idx_type elem(octave_idx_type i, octave_idx_type j) const
octave_idx_type columns(void) const
octave_idx_type checkelem(octave_idx_type i, octave_idx_type j) const
bool all_ones(void) const
void err_invalid_conversion(const std::string &from, const std::string &to)
bool save_ascii(std::ostream &os)
int16NDArray int16_array_value(void) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
std::string type_name(void) const
void warn_implicit_conversion(const char *id, const char *from, const char *to)
float float_value(bool=false) const
octave_idx_type length(void) const
octave_value fast_elem_extract(octave_idx_type n) const
octave_value as_uint16(void) const
octave::refcount< octave_idx_type > count
void warn_array_as_logical(const dim_vector &dv)
octave_idx_type columns(void) const
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
std::complex< float > FloatComplex
mxArray * as_mxArray(void) const
std::complex< double > Complex
octave_idx_type cols(void) const
octave_value as_int16(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
octave_idx_type numel(void) const
Number of elements in the array.
write the output to stdout if nargout is
#define FORWARD_MATRIX_VALUE(TYPE, PREFIX)
octave_value convert_to_str_internal(bool pad, bool force, char type) const
Vector representing the dimensions (size) of an Array.
bool is_scalar(void) const
octave_value as_int8(void) const
size_t byte_size(void) const
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, size_t skip=1)
FloatComplex float_complex_value(bool=false) const
uint16NDArray uint16_array_value(void) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)