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
Typedefs | Functions | Variables
str2double.cc File Reference
#include <string>
#include <cctype>
#include <sstream>
#include <algorithm>
#include "lo-ieee.h"
#include "Cell.h"
#include "ov.h"
#include "defun.h"
#include "errwarn.h"
#include "utils.h"
Include dependency graph for str2double.cc:

Go to the source code of this file.

Typedefs

using args.length ) = 1) print_usage(
 

Functions

static std::istringstream & extract_num (std::istringstream &is, double &num, bool &imag, bool &have_sign)
 
OCTAVE_EXPORT octave_value_list Fstr2double (const octave_value_list &args, int) a and/or b are of the form ospell
 
 if (args(0).is_string())
 
else if (args(0).is_cell())
 
static bool is_imag_unit (int c)
 
static void set_component (Complex &c, double num, bool imag)
 
static double single_num (std::istringstream &is)
 
static Complex str2double1 (const std::string &str_arg)
 

Variables

where the brackets indicate
optional arguments and and
character or cell array For
character arrays the
conversion is repeated for
every and a double or complex
array is returned Empty rows
in 
ar {s} are deleted and not returned in the numeric array. For cell arrays each character string element is processed and a double or complex array of the same dimensions as ar{s} is returned. For unconvertible scalar or character string input ode{str2double} returns a NaN Similarly
 
where the brackets indicate
optional arguments and 
code {'d'} indicates zero or more digits. The special input values ode{Inf}
 
where the brackets indicate
optional arguments and and
character 
matrix
 
where the brackets indicate
optional arguments and 
ode {NaN}
 
octave_value retval = Matrix (1, 1, octave::numeric_limits<double>::NaN ())
 
where the brackets indicate
optional arguments and and
character or cell array For
character arrays the
conversion is repeated for
every 
row
 

Typedef Documentation

using args.length = 1) print_usage (

Definition at line 345 of file str2double.cc.

Function Documentation

static std::istringstream& extract_num ( std::istringstream &  is,
double num,
bool imag,
bool have_sign 
)
static

Definition at line 102 of file str2double.cc.

References c, is, is_imag_unit(), and single_num().

Referenced by str2double1().

OCTAVE_EXPORT octave_value_list Fstr2double ( const octave_value_list args,
int   
)

Definition at line 342 of file str2double.cc.

Referenced by install_str2double_fcns().

if ( args(0).is_string()  )

Definition at line 349 of file str2double.cc.

References Array< T >::map(), NaN(), and str2double1().

else if ( args(0).is_cell()  )
static bool is_imag_unit ( int  c)
inlinestatic

Definition at line 42 of file str2double.cc.

Referenced by extract_num().

static void set_component ( Complex c,
double  num,
bool  imag 
)
inlinestatic

Definition at line 242 of file str2double.cc.

Referenced by str2double1().

static double single_num ( std::istringstream &  is)
static

Definition at line 46 of file str2double.cc.

References c, Inf, NaN(), and octave_NA.

Referenced by extract_num().

static Complex str2double1 ( const std::string str_arg)
static

Definition at line 263 of file str2double.cc.

References extract_num(), is, NaN(), s2, set_component(), str, string, and val.

Referenced by if().

Variable Documentation

where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every and a double or complex array is returned Empty rows in ar {s} are deleted and not returned in the numeric array. For cell arrays each character string element is processed and a double or complex array of the same dimensions as ar{s} is returned. For unconvertible scalar or character string input ode{str2double} returns a NaN Similarly

Definition at line 342 of file str2double.cc.

where the brackets indicate optional arguments and code {'d'} indicates zero or more digits. The special input values ode{Inf}

Definition at line 342 of file str2double.cc.

where the brackets indicate optional arguments and and character matrix

Definition at line 342 of file str2double.cc.

where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every and a double or complex array is returned Empty rows in for character array input ode {NaN}

Definition at line 342 of file str2double.cc.

return retval = Matrix (1, 1, octave::numeric_limits<double>::NaN ())

Definition at line 347 of file str2double.cc.

where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row