24 #if defined (HAVE_CONFIG_H) 43 {
return c ==
'i' ||
c ==
'j'; }
59 if (std::toupper (
c) ==
'I')
65 if (std::tolower (c1) ==
'n' && std::tolower (c2) ==
'f')
71 is.setstate (std::ios::failbit);
86 if (c1 ==
'a' && c2 ==
'N')
92 is.setstate (std::ios::failbit);
101 static std::istringstream&
104 have_sign =
imag =
false;
115 bool negative =
false;
118 if (
c ==
'+' ||
c ==
'-')
144 num = (negative ? -1.0 : 1.0);
149 if (std::tolower (
c) !=
'n')
214 is.setstate (std::ios::failbit);
244 #if defined (HAVE_CXX_COMPLEX_SETTERS) 249 #elif defined (HAVE_CXX_COMPLEX_REFERENCE_ACCESSORS) 271 str.erase (std::remove (
str.begin (),
str.end(),
','),
str.end ());
272 std::istringstream
is (
str);
297 DEFUN (str2double, args, ,
344 if (args.length () != 1)
349 if (args(0).is_string ())
351 if (args(0).rows () == 0 || args(0).columns () == 0)
353 else if (args(0).rows () == 1 && args(0).ndims () == 2)
362 else if (args(0).iscell ())
364 const Cell cell = args(0).cell_value ();
370 if (cell(
i).is_string ())
static Complex str2double1(const std::string &str_arg)
std::string string_value(bool force=false) const
OCTINTERP_API void print_usage(void)
identity matrix If supplied two scalar respectively For allows like xample val
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
static bool is_imag_unit(int c)
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
static std::istringstream & extract_num(std::istringstream &is, double &num, bool &imag, bool &have_sign)
static double single_num(std::istringstream &is)
Array< U > map(F fcn) const
Apply function fcn to each element of the Array<T>.
static void set_component(Complex &c, double num, bool imag)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number). NaN is the result of operations which do not produce a well defined 0 result. Common operations which produce a NaN are arithmetic with infinity ex($\infty - \infty$)
ColumnVector imag(const ComplexColumnVector &a)
std::complex< double > Complex
octave_idx_type numel(void) const
Number of elements in the array.
write the output to stdout if nargout is
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