Defines | Functions | Variables

ov-base.cc File Reference

#include <climits>
#include <iostream>
#include "lo-ieee.h"
#include "lo-mappers.h"
#include "defun.h"
#include "gripes.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.

Defines

#define INT_CONV_METHOD(T, F, MIN_LIMIT, MAX_LIMIT)

Functions

builtin_type_t btyp_mixed_numeric (builtin_type_t x, builtin_type_t y)
 CONVDECLX (complex_matrix_conv)
 CONVDECLX (string_conv)
 CONVDECLX (cell_conv)
 CONVDECLX (matrix_conv)
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_base_value,"<unknown type>","unknown")
 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 \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ 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

Define Documentation

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

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


Function Documentation

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

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

CONVDECLX ( string_conv   ) 

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

CONVDECLX ( cell_conv   ) 

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

CONVDECLX ( matrix_conv   ) 

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

DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA ( octave_base_value  ,
"<unknown type>"  ,
"unknown"   
)
DEFUN ( sparse_auto_mutate  ,
args  ,
nargout   
)

Definition at line 1529 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 1271 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 1264 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 1279 of file ov-base.cc.

References error().

Referenced by octave_base_value::numeric_assign().

void install_base_type_conversions ( void   ) 

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

References INSTALL_ASSIGNCONV, and INSTALL_WIDENOP.


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().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines