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
op-class.cc File Reference
#include "oct-time.h"
#include "errwarn.h"
#include "load-path.h"
#include "ovl.h"
#include "ov.h"
#include "ov-class.h"
#include "ov-typeinfo.h"
#include "ops.h"
#include "symtab.h"
#include "parse.h"
Include dependency graph for op-class.cc:

Go to the source code of this file.

Macros

#define DEF_CLASS_BINOP(name)
 
#define DEF_CLASS_UNOP(name)
 
#define INSTALL_CLASS_BINOP(op, f)
 
#define INSTALL_CLASS_UNOP(op, f)
 

Functions

void install_class_ops (void)
 
static octave_value oct_binop_and (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_eq (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_ge (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_gt (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_ldivide (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_le (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_lt (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_minus (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_mldivide (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_mpower (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_mrdivide (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_mtimes (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_ne (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_or (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_plus (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_power (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_rdivide (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_binop_times (const octave_value &a1, const octave_value &a2)
 
static octave_value oct_unop_ctranspose (const octave_value &a)
 
static octave_value oct_unop_not (const octave_value &a)
 
static octave_value oct_unop_transpose (const octave_value &a)
 
static octave_value oct_unop_uminus (const octave_value &a)
 
static octave_value oct_unop_uplus (const octave_value &a)
 

Macro Definition Documentation

#define DEF_CLASS_BINOP (   name)
Value:
static octave_value \
oct_binop_ ## name (const octave_value& a1, const octave_value& a2) \
{ \
\
std::string dispatch_type \
= a1.is_object () ? a1.class_name () : a2.class_name (); \
\
octave_value meth = symbol_table::find_method (#name, dispatch_type); \
if (meth.is_undefined ()) \
error ("%s method not defined for %s class", #name, \
dispatch_type.c_str ()); \
\
octave_value_list args; \
args(1) = a2; \
args(0) = a1; \
\
octave_value_list tmp = feval (meth.function_value (), args, 1); \
if (tmp.length () > 0) \
retval = tmp(0); \
\
return retval; \
}
static octave_value find_method(const std::string &name, const std::string &dispatch_type)
Definition: symtab.h:1495
void error(const char *fmt,...)
Definition: error.cc:570
const octave_base_value & a2
JNIEnv void * args
Definition: ov-java.cc:67
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name
Definition: input.cc:871
if(nargin< 2) print_usage()
Definition: cellfun.cc:405
double tmp
Definition: data.cc:6300
octave_value retval
Definition: data.cc:6294
feval(ar{f}, 1) esult
Definition: oct-parse.cc:8829
virtual std::string class_name(void) const
Definition: ov-base.h:857
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
Definition: utils.cc:854
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))

Definition at line 75 of file op-class.cc.

#define DEF_CLASS_UNOP (   name)
Value:
static octave_value \
oct_unop_ ## name (const octave_value& a) \
{ \
\
std::string class_name = a.class_name (); \
\
if (meth.is_undefined ()) \
error ("%s method not defined for %s class", #name, \
class_name.c_str ()); \
\
octave_value_list args; \
args(0) = a; \
\
octave_value_list tmp = feval (meth.function_value (), args, 1); \
if (tmp.length () > 0) \
retval = tmp(0); \
\
return retval; \
}
static octave_value find_method(const std::string &name, const std::string &dispatch_type)
Definition: symtab.h:1495
void error(const char *fmt,...)
Definition: error.cc:570
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
Definition: cellfun.cc:398
JNIEnv void * args
Definition: ov-java.cc:67
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name
Definition: input.cc:871
if(nargin< 2) print_usage()
Definition: cellfun.cc:405
double tmp
Definition: data.cc:6300
octave_value retval
Definition: data.cc:6294
feval(ar{f}, 1) esult
Definition: oct-parse.cc:8829
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
Definition: utils.cc:854
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))

Definition at line 41 of file op-class.cc.

#define INSTALL_CLASS_BINOP (   op,
  f 
)
Value:
(octave_value::op, oct_binop_ ## f)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
static bool register_binary_class_op(octave_value::binary_op, binary_class_op_fcn)
Definition: ov-typeinfo.cc:95

Definition at line 126 of file op-class.cc.

Referenced by install_class_ops().

#define INSTALL_CLASS_UNOP (   op,
  f 
)
Value:
(octave_value::op, oct_unop_ ## f)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
static bool register_unary_class_op(octave_value::unary_op, unary_class_op_fcn)
Definition: ov-typeinfo.cc:69

Definition at line 122 of file op-class.cc.

Referenced by install_class_ops().

Function Documentation

void install_class_ops ( void  )
static octave_value oct_binop_and ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 119 of file op-class.cc.

static octave_value oct_binop_eq ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 111 of file op-class.cc.

static octave_value oct_binop_ge ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 112 of file op-class.cc.

static octave_value oct_binop_gt ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 113 of file op-class.cc.

static octave_value oct_binop_ldivide ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 118 of file op-class.cc.

static octave_value oct_binop_le ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 110 of file op-class.cc.

static octave_value oct_binop_lt ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 109 of file op-class.cc.

static octave_value oct_binop_minus ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 104 of file op-class.cc.

static octave_value oct_binop_mldivide ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 108 of file op-class.cc.

static octave_value oct_binop_mpower ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 107 of file op-class.cc.

static octave_value oct_binop_mrdivide ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 106 of file op-class.cc.

static octave_value oct_binop_mtimes ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 105 of file op-class.cc.

static octave_value oct_binop_ne ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 114 of file op-class.cc.

static octave_value oct_binop_or ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 120 of file op-class.cc.

static octave_value oct_binop_plus ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 103 of file op-class.cc.

static octave_value oct_binop_power ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 117 of file op-class.cc.

static octave_value oct_binop_rdivide ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 116 of file op-class.cc.

static octave_value oct_binop_times ( const octave_value a1,
const octave_value a2 
)
static

Definition at line 115 of file op-class.cc.

static octave_value oct_unop_ctranspose ( const octave_value a)
static

Definition at line 71 of file op-class.cc.

static octave_value oct_unop_not ( const octave_value a)
static

Definition at line 67 of file op-class.cc.

static octave_value oct_unop_transpose ( const octave_value a)
static

Definition at line 70 of file op-class.cc.

static octave_value oct_unop_uminus ( const octave_value a)
static

Definition at line 69 of file op-class.cc.

static octave_value oct_unop_uplus ( const octave_value a)
static

Definition at line 68 of file op-class.cc.