GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions | Variables
ov.cc File Reference
#include "data-conv.h"
#include "quit.h"
#include "str-vec.h"
#include "ovl.h"
#include "oct-stream.h"
#include "ov.h"
#include "ov-base.h"
#include "ov-bool.h"
#include "ov-bool-mat.h"
#include "ov-cell.h"
#include "ov-scalar.h"
#include "ov-float.h"
#include "ov-re-mat.h"
#include "ov-flt-re-mat.h"
#include "ov-re-diag.h"
#include "ov-flt-re-diag.h"
#include "ov-perm.h"
#include "ov-bool-sparse.h"
#include "ov-cx-sparse.h"
#include "ov-re-sparse.h"
#include "ov-int8.h"
#include "ov-int16.h"
#include "ov-int32.h"
#include "ov-int64.h"
#include "ov-uint8.h"
#include "ov-uint16.h"
#include "ov-uint32.h"
#include "ov-uint64.h"
#include "ov-complex.h"
#include "ov-flt-complex.h"
#include "ov-cx-mat.h"
#include "ov-flt-cx-mat.h"
#include "ov-cx-diag.h"
#include "ov-flt-cx-diag.h"
#include "ov-ch-mat.h"
#include "ov-str-mat.h"
#include "ov-range.h"
#include "ov-struct.h"
#include "ov-class.h"
#include "ov-classdef.h"
#include "ov-oncleanup.h"
#include "ov-cs-list.h"
#include "ov-colon.h"
#include "ov-builtin.h"
#include "ov-dld-fcn.h"
#include "ov-usr-fcn.h"
#include "ov-fcn-handle.h"
#include "ov-fcn-inline.h"
#include "ov-typeinfo.h"
#include "ov-null-mat.h"
#include "ov-lazy-idx.h"
#include "ov-java.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "pager.h"
#include "parse.h"
#include "pr-output.h"
#include "symtab.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for ov.cc:

Go to the source code of this file.

Macros

#define XVALUE_EXTRACTOR(TYPE, NAME, FCN)
 

Functions

OCTAVE_EXPORT
octave_value_list uint64 nd
deftypefn *return 
args (0).as_int8()
 
template<typename T >
static Array< intconvert_to_int_array (const Array< octave_int< T > > &A)
 
template<typename T >
static Array< octave_idx_typeconvert_to_octave_idx_type_array (const Array< octave_int< T > > &A)
 
static void decode_subscripts (const char *name, const octave_value &arg, std::string &type_string, std::list< octave_value_list > &idx)
 
static octave_value decompose_binary_op (octave_value::compound_binary_op op, const octave_value &v1, const octave_value &v2)
 
octave_value do_binary_op (octave_value::binary_op op, const octave_value &v1, const octave_value &v2)
 
octave_value do_binary_op (octave_value::compound_binary_op op, const octave_value &v1, const octave_value &v2)
 
octave_value do_cat_op (const octave_value &v1, const octave_value &v2, const Array< octave_idx_type > &ra_idx)
 
octave_value do_colon_op (const octave_value &base, const octave_value &increment, const octave_value &limit, bool is_for_cmd_expr)
 
octave_value do_unary_op (octave_value::unary_op op, const octave_value &v)
 
static OCTAVE_NORETURN void err_binary_op (const std::string &on, const std::string &tn1, const std::string &tn2)
 
static OCTAVE_NORETURN void err_binary_op_conv (const std::string &on)
 
static OCTAVE_NORETURN void err_cat_op (const std::string &tn1, const std::string &tn2)
 
static OCTAVE_NORETURN void err_cat_op_conv (void)
 
static OCTAVE_NORETURN void err_unary_op (const std::string &on, const std::string &tn)
 
static OCTAVE_NORETURN void err_unary_op_conv (const std::string &on)
 
static OCTAVE_NORETURN void err_unary_op_conversion_failed (const std::string &op, const std::string &tn)
 
OCTAVE_EXPORT octave_value_list Fdouble (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fint16 (const octave_value_list &args, int) uint8
 
OCTAVE_EXPORT octave_value_list Fint32 (const octave_value_list &args, int) uint8
 
OCTAVE_EXPORT octave_value_list Fint64 (const octave_value_list &args, int) uint8
 
OCTAVE_EXPORT octave_value_list Fint8 (const octave_value_list &args, int) int16
 
OCTAVE_EXPORT octave_value_list Fsingle (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fsizeof (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fsubsref (const octave_value_list &args, int nargout) code
 
OCTAVE_EXPORT octave_value_list Fuint16 (const octave_value_list &args, int) uint8
 
OCTAVE_EXPORT octave_value_list Fuint32 (const octave_value_list &args, int) uint8
 
OCTAVE_EXPORT octave_value_list Fuint64 (const octave_value_list &args, int) uint8
 
OCTAVE_EXPORT octave_value_list Fuint8 (const octave_value_list &args, int) int16
 
void install_types (void)
 
static dim_vector make_vector_dims (const dim_vector &dv, bool force_vector_conversion, const std::string &my_type, const std::string &wanted_type)
 
idx subsasgn (val, idx, 0) esult
 
idx subsref (val, idx) esult
 

Variables

nd group nd example oindent
Note that this is the same as
writing return 
ar
 
and code {"."}. The amp{subs} field may be either code{":"} or a cell array of index values. The following example shows how to extract the first two columns of a matrix xample roup val = magic (3) esult{} val = [ 8 1 6 3 5 7 4 9 2 ] idx.type = "()"
 
OCTAVE_EXPORT octave_value_list int16
 
OCTAVE_EXPORT octave_value_list int32
 
OCTAVE_EXPORT octave_value_list int64
 
nd group nd example oindent
Note that this is the same as
writing 
ode {val(:, 1:2)}. If ar{idx} is an empty structure array with fields amp{type} and amp{subs}
 
idx subs = ":"
 
idx type = "()"
 
OCTAVE_EXPORT octave_value_list uint16
 
OCTAVE_EXPORT octave_value_list uint32
 
static bool Vdisable_diagonal_matrix = false
 
static bool Vdisable_permutation_matrix = false
 
static bool Vdisable_range = false
 

Macro Definition Documentation

#define XVALUE_EXTRACTOR (   TYPE,
  NAME,
  FCN 
)
Value:
octave_value::NAME (const char *fmt, ...) const \
{ \
TYPE retval; \
\
{ \
retval = FCN (); \
} \
catch (octave::execution_exception& e) \
{ \
if (fmt) \
{ \
va_list args; \
va_start (args, fmt); \
verror (e, fmt, args); \
va_end (args); \
} \
\
throw e; \
} \
\
return retval; \
}
catch(const octave::index_exception &e)
Definition: sub2ind.cc:269
Definition: oct-parse.h:129
static void verror(const char *name, const char *fmt, va_list args)
Definition: lo-error.c:53
try
Definition: sub2ind.cc:266
i e
Definition: data.cc:2724
Definition: oct-parse.h:94
if(nargin< 2) print_usage()
Definition: cellfun.cc:405
octave_value retval
Definition: data.cc:6294
OCTAVE_EXPORT octave_value_list uint64 nd deftypefn *return args(0).as_int8()

Definition at line 2017 of file ov.cc.

Function Documentation

OCTAVE_EXPORT octave_value_list uint64 nd deftypefn* return args ( )
template<typename T >
static Array<int> convert_to_int_array ( const Array< octave_int< T > > &  A)
static

Definition at line 1810 of file ov.cc.

References A, and retval.

Referenced by octave_value::int_vector_value().

template<typename T >
static Array<octave_idx_type> convert_to_octave_idx_type_array ( const Array< octave_int< T > > &  A)
static

Definition at line 1879 of file ov.cc.

References A, and retval.

Referenced by octave_value::octave_idx_type_vector_value().

static void decode_subscripts ( const char *  name,
const octave_value arg,
std::string type_string,
std::list< octave_value_list > &  idx 
)
static
static octave_value decompose_binary_op ( octave_value::compound_binary_op  op,
const octave_value v1,
const octave_value v2 
)
static
octave_value do_binary_op ( octave_value::binary_op  op,
const octave_value v1,
const octave_value v2 
)
octave_value do_binary_op ( octave_value::compound_binary_op  op,
const octave_value v1,
const octave_value v2 
)
octave_value do_cat_op ( const octave_value v1,
const octave_value v2,
const Array< octave_idx_type > &  ra_idx 
)
octave_value do_colon_op ( const octave_value base,
const octave_value increment,
const octave_value limit,
bool  is_for_cmd_expr 
)
octave_value do_unary_op ( octave_value::unary_op  op,
const octave_value v 
)
static OCTAVE_NORETURN void err_binary_op ( const std::string on,
const std::string tn1,
const std::string tn2 
)
static

Definition at line 2200 of file ov.cc.

References error().

Referenced by do_binary_op().

static OCTAVE_NORETURN void err_binary_op_conv ( const std::string on)
static

Definition at line 2208 of file ov.cc.

References error().

Referenced by do_binary_op().

static OCTAVE_NORETURN void err_cat_op ( const std::string tn1,
const std::string tn2 
)
static

Definition at line 2443 of file ov.cc.

References error().

Referenced by do_cat_op().

static OCTAVE_NORETURN void err_cat_op_conv ( void  )
static

Definition at line 2450 of file ov.cc.

References error().

Referenced by do_cat_op().

static OCTAVE_NORETURN void err_unary_op ( const std::string on,
const std::string tn 
)
static

Definition at line 2632 of file ov.cc.

References error().

Referenced by octave_value::do_non_const_unary_op(), and do_unary_op().

static OCTAVE_NORETURN void err_unary_op_conv ( const std::string on)
static

Definition at line 2639 of file ov.cc.

References error().

Referenced by do_unary_op().

static OCTAVE_NORETURN void err_unary_op_conversion_failed ( const std::string op,
const std::string tn 
)
static

Definition at line 2696 of file ov.cc.

References error().

Referenced by octave_value::do_non_const_unary_op().

OCTAVE_EXPORT octave_value_list Fdouble ( const octave_value_list args,
int   
)

Definition at line 1173 of file ov.cc.

References args(), ovl(), and print_usage().

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fint16 ( const octave_value_list args,
int   
)

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fint32 ( const octave_value_list args,
int   
)

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fint64 ( const octave_value_list args,
int   
)

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fint8 ( const octave_value_list args,
int   
)

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fsingle ( const octave_value_list args,
int   
)

Definition at line 1217 of file ov.cc.

References args(), ovl(), and print_usage().

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fsizeof ( const octave_value_list args,
int   
)

Definition at line 2973 of file ov.cc.

References args(), ovl(), and print_usage().

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fsubsref ( const octave_value_list args,
int  nargout 
)

Definition at line 3080 of file ov.cc.

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fuint16 ( const octave_value_list args,
int   
)

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fuint32 ( const octave_value_list args,
int   
)

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fuint64 ( const octave_value_list args,
int   
)

Referenced by install_ov_fcns().

OCTAVE_EXPORT octave_value_list Fuint8 ( const octave_value_list args,
int   
)

Referenced by install_ov_fcns().

void install_types ( void  )

Definition at line 2909 of file ov.cc.

References octave_null_matrix::register_type(), octave_magic_colon::register_type(), octave_null_str::register_type(), octave_cs_list::register_type(), octave_oncleanup::register_type(), octave_fcn_inline::register_type(), octave_float_complex_diag_matrix::register_type(), octave_complex_diag_matrix::register_type(), octave_dld_function::register_type(), octave_null_sq_str::register_type(), octave_float_diag_matrix::register_type(), octave_diag_matrix::register_type(), octave_builtin::register_type(), octave_sparse_bool_matrix::register_type(), octave_sparse_complex_matrix::register_type(), octave_sparse_matrix::register_type(), octave_struct::register_type(), octave_fcn_handle::register_type(), octave_java::register_type(), octave_char_matrix_str::register_type(), octave_float_complex_matrix::register_type(), octave_complex_matrix::register_type(), octave_cell::register_type(), octave_float_complex::register_type(), octave_complex::register_type(), octave_class::register_type(), octave_float_matrix::register_type(), octave_bool_matrix::register_type(), octave_perm_matrix::register_type(), octave_matrix::register_type(), octave_lazy_index::register_type(), octave_char_matrix_sq_str::register_type(), octave_bool::register_type(), octave_scalar::register_type(), octave_float_scalar::register_type(), octave_scalar_struct::register_type(), octave_range::register_type(), octave_user_function::register_type(), and octave_base_value::register_type().

static dim_vector make_vector_dims ( const dim_vector dv,
bool  force_vector_conversion,
const std::string my_type,
const std::string wanted_type 
)
static
idx subsasgn ( val  ,
idx  ,
 
)

Definition at line 3129 of file ov.cc.

idx subsref ( val  ,
idx   
)

Variable Documentation

nd group nd example oindent Note that this is the same as writing return ar

Definition at line 3080 of file ov.cc.

and code {"."}. The amp{subs} field may be either code{":"} or a cell array of index values. The following example shows how to extract the first two columns of a matrix xample roup val = magic (3) esult{} val = [ 8 1 6 3 5 7 4 9 2 ] idx.type = "()"

Definition at line 3080 of file ov.cc.

OCTAVE_EXPORT octave_value_list int16
OCTAVE_EXPORT octave_value_list int32
OCTAVE_EXPORT octave_value_list int64
nd group nd example Note that this is the same as writing ode {val(:, 1:2)}. If ar{idx} is an empty structure array with fields amp{type} and amp{subs}

Definition at line 3080 of file ov.cc.

idx subs = ":"

Definition at line 3080 of file ov.cc.

Referenced by decode_subscripts().

idx type = "()"

Definition at line 3129 of file ov.cc.

Referenced by symbol_table::fcn_info::fcn_info_rep::add_dispatch(), scanf_format_list::add_elt_to_list(), printf_format_list::add_elt_to_list(), load_path::check_file_type(), octave_lvalue::clear_index(), marker::construct(), convert_to_string(), jit_typeinfo::create_identity(), jit_convert::create_variable(), decode_subscripts(), base_graphics_object::defaults(), octave_classdef_meta::do_multi_index_op(), octave_base_stream::do_numeric_printf_conv(), err_wrong_type_arg(), err_wrong_type_arg_for_binary_op(), err_wrong_type_arg_for_unary_op(), execute_ov(), Gaudioread(), jit_convert::get_variable(), Gqr(), gripe_wrong_type_arg(), gripe_wrong_type_arg_for_binary_op(), gripe_wrong_type_arg_for_unary_op(), file_editor::handle_edit_mfile_request(), octave_lvalue::index_type(), base_graphics_object::isa(), jit_store_argument::jit_store_argument(), jit_info::match(), octave_lvalue::operator=(), scanf_format_elt::operator=(), printf_format_elt::operator=(), octave::textscan_format_elt::operator=(), parser::parse_info_map(), jit_argument::print(), printf_format_list::printf_format_list(), octave::textscan_format_list::process_conversion(), read_images(), read_mat5_binary_element(), read_mat_binary_data(), KeyboardTranslatorReader::readNext(), replace_links(), jit_convert::resolve(), tree_matrix::rvalue1(), scanf_format_list::scanf_format_list(), tree_expression::set_postfix_index(), Filter::HotSpot::setType(), octave_builtin::stash_jit(), subsref(), octave::textscan_format_list::textscan_format_list(), tree_index_expression::type_tags(), octave_base_value::warn_load(), octave_base_value::warn_save(), warn_wrong_type_arg(), write_doubles(), write_floats(), and write_mat5_tag().

OCTAVE_EXPORT octave_value_list uint16
OCTAVE_EXPORT octave_value_list uint32
bool Vdisable_diagonal_matrix = false
static

Definition at line 97 of file ov.cc.

bool Vdisable_permutation_matrix = false
static

Definition at line 101 of file ov.cc.

bool Vdisable_range = false
static

Definition at line 105 of file ov.cc.