GNU Octave  3.8.0
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-base.cc File Reference
#include <iostream>
#include <limits>
#include "lo-ieee.h"
#include "lo-mappers.h"
#include "defun.h"
#include "gripes.h"
#include "mxarray.h"
#include "oct-map.h"
#include "oct-obj.h"
#include "oct-lvalue.h"
#include "oct-stream.h"
#include "ops.h"
#include "ov-base.h"
#include "ov-cell.h"
#include "ov-ch-mat.h"
#include "ov-complex.h"
#include "ov-cx-mat.h"
#include "ov-range.h"
#include "ov-re-mat.h"
#include "ov-scalar.h"
#include "ov-str-mat.h"
#include "ov-fcn-handle.h"
#include "parse.h"
#include "pr-output.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for ov-base.cc:

Go to the source code of this file.

Macros

#define INT_CONV_METHOD(T, F)

Functions

builtin_type_t btyp_mixed_numeric (builtin_type_t x, builtin_type_t y)
 CONVDECLX (matrix_conv)
 CONVDECLX (complex_matrix_conv)
 CONVDECLX (string_conv)
 CONVDECLX (cell_conv)
 DEFUN (sparse_auto_mutate, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} sparse_auto_mutate ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} sparse_auto_mutate (@var{new_val})\n\ @deftypefnx {Built-in Function} {} sparse_auto_mutate (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave will\n\ automatically mutate sparse matrices to full matrices to save memory.\n\ For example:\n\ \n\ @example\n\ @group\n\ s = speye (3);\n\ sparse_auto_mutate (false);\n\ s(:, 1) = 1;\n\ typeinfo (s)\n\ @result{} sparse matrix\n\ sparse_auto_mutate (true);\n\ s(1, :) = 1;\n\ typeinfo (s)\n\ @result{} matrix\n\ @end group\n\ @end example\n\ \n\ When called from inside a function with the @qcode{\"local\"} option, the\n\ variable is changed locally for the function and any subroutines it calls. \n\ The original variable value is restored when exiting the function.\n\ @end deftypefn")
string_vector get_builtin_classes (void)
static void gripe_assign_conversion_failed (const std::string &tn1, const std::string &tn2)
static void gripe_indexed_assignment (const std::string &tn1, const std::string &tn2)
static void gripe_no_conversion (const std::string &on, const std::string &tn1, const std::string &tn2)
void install_base_type_conversions (void)

Variables

std::string btyp_class_name [btyp_num_types]
bool Vsparse_auto_mutate = false

Macro Definition Documentation

#define INT_CONV_METHOD (   T,
  F 
)
Value:
octave_base_value::F ## _value (bool require_int, bool frc_str_conv) const \
{ \
T retval = 0; \
\
double d = double_value (frc_str_conv); \
{ \
if (require_int && D_NINT (d) != d) \
error_with_cfn ("conversion of %g to " #T " value failed", d); \
else if (d < std::numeric_limits<T>::min ()) \
else if (d > std::numeric_limits<T>::max ()) \
else \
retval = static_cast<T> (::fix (d)); \
} \
gripe_wrong_type_arg ("octave_base_value::" #F "_value ()", \
type_name ()); \
\
return retval; \
}

Definition at line 453 of file ov-base.cc.

Function Documentation

builtin_type_t btyp_mixed_numeric ( builtin_type_t  x,
builtin_type_t  y 
)
CONVDECLX ( matrix_conv  )

Definition at line 1519 of file ov-base.cc.

CONVDECLX ( complex_matrix_conv  )

Definition at line 1524 of file ov-base.cc.

CONVDECLX ( string_conv  )

Definition at line 1529 of file ov-base.cc.

CONVDECLX ( cell_conv  )

Definition at line 1534 of file ov-base.cc.

DEFUN ( sparse_auto_mutate  ,
args  ,
nargout   
)

Definition at line 1559 of file ov-base.cc.

References SET_INTERNAL_VARIABLE.

string_vector get_builtin_classes ( void  )
static void gripe_assign_conversion_failed ( const std::string &  tn1,
const std::string &  tn2 
)
static

Definition at line 1296 of file ov-base.cc.

References error().

Referenced by octave_base_value::numeric_assign().

static void gripe_indexed_assignment ( const std::string &  tn1,
const std::string &  tn2 
)
static

Definition at line 1289 of file ov-base.cc.

References error().

Referenced by octave_base_value::numeric_assign().

static void gripe_no_conversion ( const std::string &  on,
const std::string &  tn1,
const std::string &  tn2 
)
static

Definition at line 1304 of file ov-base.cc.

References error().

Referenced by octave_base_value::numeric_assign().

void install_base_type_conversions ( void  )

Definition at line 1540 of file ov-base.cc.

References INSTALL_ASSIGNCONV, and INSTALL_WIDENOP.

Referenced by install_ops().

Variable Documentation

std::string btyp_class_name[btyp_num_types]
Initial value:
{
"double", "single", "double", "single",
"int8", "int16", "int32", "int64",
"uint8", "uint16", "uint32", "uint64",
"logical", "char",
"struct", "cell", "function_handle"
}

Definition at line 81 of file ov-base.cc.

Referenced by get_builtin_classes(), get_dispatch_type(), and make_fcn_handle().

bool Vsparse_auto_mutate = false