GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
lo-utils.cc File Reference
#include <cstdlib>
#include <cstring>
#include <complex>
#include <limits>
#include <string>
#include "quit.h"
#include "lo-error.h"
#include "lo-ieee.h"
#include "lo-mappers.h"
#include "lo-utils.h"
#include "putenv-wrapper.h"
Include dependency graph for lo-utils.cc:

Go to the source code of this file.

Functions

std::string octave_fgetl (FILE *f)
 
std::string octave_fgetl (FILE *f, bool &eof)
 
std::string octave_fgets (FILE *f)
 
std::string octave_fgets (FILE *f, bool &eof)
 
void octave_putenv (const std::string &name, const std::string &value)
 
template<typename T >
std::complex< T > octave_read_cx_fp_value (std::istream &is)
 
template<typename T >
double octave_read_fp_value (std::istream &is)
 
template<>
OCTAVE_API double octave_read_value (std::istream &is)
 
template<>
OCTAVE_API Complex octave_read_value (std::istream &is)
 
template<>
OCTAVE_API float octave_read_value (std::istream &is)
 
template<>
OCTAVE_API FloatComplex octave_read_value (std::istream &is)
 
void octave_write_complex (std::ostream &os, const Complex &c)
 
void octave_write_double (std::ostream &os, double d)
 
void octave_write_float (std::ostream &os, float d)
 
void octave_write_float_complex (std::ostream &os, const FloatComplex &c)
 
template<typename T >
read_inf_nan_na (std::istream &is, char c0)
 
char * strsave (const char *s)
 
bool xis_int_or_inf_or_nan (double x)
 
bool xis_int_or_inf_or_nan (float x)
 
bool xis_one_or_zero (double x)
 
bool xis_one_or_zero (float x)
 
bool xis_zero (double x)
 
bool xis_zero (float x)
 
bool xtoo_large_for_float (double x)
 
bool xtoo_large_for_float (const Complex &x)
 

Function Documentation

◆ octave_fgetl() [1/2]

std::string octave_fgetl ( FILE *  f)

Definition at line 184 of file lo-utils.cc.

References f.

Referenced by octave::default_command_editor::do_readline().

◆ octave_fgetl() [2/2]

std::string octave_fgetl ( FILE *  f,
bool eof 
)

Definition at line 191 of file lo-utils.cc.

References f, octave_fgets(), retval, and string.

◆ octave_fgets() [1/2]

std::string octave_fgets ( FILE *  f)

Definition at line 111 of file lo-utils.cc.

References f.

Referenced by octave_fgetl().

◆ octave_fgets() [2/2]

std::string octave_fgets ( FILE *  f,
bool eof 
)

Definition at line 118 of file lo-utils.cc.

References f, retval, string, strlen(), and tmp.

◆ octave_putenv()

void octave_putenv ( const std::string name,
const std::string value 
)

Definition at line 92 of file lo-utils.cc.

References current_liboctave_error_handler, name, octave_putenv_wrapper(), and value.

Referenced by octave::sys::env::putenv().

◆ octave_read_cx_fp_value()

template<typename T >
std::complex<T> octave_read_cx_fp_value ( std::istream &  is)

Definition at line 333 of file lo-utils.cc.

References is.

◆ octave_read_fp_value()

template<typename T >
double octave_read_fp_value ( std::istream &  is)

Definition at line 258 of file lo-utils.cc.

References is, max(), and val.

◆ octave_read_value() [1/4]

template<>
OCTAVE_API double octave_read_value ( std::istream &  is)

Definition at line 374 of file lo-utils.cc.

◆ octave_read_value() [2/4]

template<>
OCTAVE_API Complex octave_read_value ( std::istream &  is)

Definition at line 379 of file lo-utils.cc.

References is.

◆ octave_read_value() [3/4]

template<>
OCTAVE_API float octave_read_value ( std::istream &  is)

Definition at line 384 of file lo-utils.cc.

References is.

◆ octave_read_value() [4/4]

template<>
OCTAVE_API FloatComplex octave_read_value ( std::istream &  is)

Definition at line 389 of file lo-utils.cc.

References is.

◆ octave_write_complex()

void octave_write_complex ( std::ostream &  os,
const Complex c 
)

Definition at line 408 of file lo-utils.cc.

References c, imag(), octave_write_double(), os, and real().

Referenced by operator<<(), and octave_complex::save_ascii().

◆ octave_write_double()

void octave_write_double ( std::ostream &  os,
double  d 
)

◆ octave_write_float()

void octave_write_float ( std::ostream &  os,
float  d 
)

◆ octave_write_float_complex()

void octave_write_float_complex ( std::ostream &  os,
const FloatComplex c 
)

Definition at line 431 of file lo-utils.cc.

References c, imag(), octave_write_float(), os, and real().

Referenced by octave_float_complex::save_ascii().

◆ read_inf_nan_na()

template<typename T >
T read_inf_nan_na ( std::istream &  is,
char  c0 
)

Definition at line 205 of file lo-utils.cc.

References is, NA(), and val.

◆ strsave()

char* strsave ( const char *  s)

Definition at line 75 of file lo-utils.cc.

References s, strlen(), and tmp.

◆ xis_int_or_inf_or_nan() [1/2]

◆ xis_int_or_inf_or_nan() [2/2]

bool xis_int_or_inf_or_nan ( float  x)

Definition at line 63 of file lo-utils.cc.

References octave::math::isnan(), x, and octave::math::x_nint().

◆ xis_one_or_zero() [1/2]

bool xis_one_or_zero ( double  x)

Definition at line 45 of file lo-utils.cc.

References x.

Referenced by FloatNDArray::any_element_not_one_or_zero(), and NDArray::any_element_not_one_or_zero().

◆ xis_one_or_zero() [2/2]

bool xis_one_or_zero ( float  x)

Definition at line 66 of file lo-utils.cc.

References x.

◆ xis_zero() [1/2]

bool xis_zero ( double  x)

Definition at line 48 of file lo-utils.cc.

References x.

Referenced by FloatNDArray::all_elements_are_zero(), and NDArray::all_elements_are_zero().

◆ xis_zero() [2/2]

bool xis_zero ( float  x)

Definition at line 69 of file lo-utils.cc.

References x.

◆ xtoo_large_for_float() [1/2]

◆ xtoo_large_for_float() [2/2]

bool xtoo_large_for_float ( const Complex x)

Definition at line 57 of file lo-utils.cc.

References x, and xtoo_large_for_float().