24 #if defined (HAVE_CONFIG_H)
49 {
return x == 0 || x == 1; }
70 {
return x == 0 || x == 1; }
84 char *
tmp =
new char [len+1];
85 tmp = strcpy (tmp, s);
97 int new_len = name.length () + value.length () + 2;
102 char *new_item =
static_cast<char*
> (
std::malloc (new_len));
104 sprintf (new_item,
"%s=%s", name.c_str (), value.c_str ());
127 int grow_size = 1024;
128 int max_size = grow_size;
130 char *buf =
static_cast<char *
> (
std::malloc (max_size));
136 if (std::fgets (bufptr, grow_size, f))
140 if (len == grow_size - 1)
142 int tmp = bufptr - buf + grow_size - 1;
144 max_size += grow_size;
145 buf =
static_cast<char *
> (std::realloc (buf, max_size));
148 if (*(bufptr-1) ==
'\n')
154 else if (bufptr[len-1] !=
'\n')
156 bufptr[len++] =
'\n';
177 while (retval.empty ());
199 size_t len = retval.length ();
201 if (retval[len-1] ==
'\n')
202 retval.resize (len-1);
209 template <
typename T>
220 if (c1 ==
'n' || c1 ==
'N')
223 if (c2 ==
'f' || c2 ==
'F')
224 val = std::numeric_limits<T>::infinity ();
226 is.setstate (std::ios::failbit);
229 is.setstate (std::ios::failbit);
236 if (c1 ==
'a' || c1 ==
'A')
239 if (c2 ==
'n' || c2 ==
'N')
240 val = std::numeric_limits<T>::quiet_NaN ();
244 if (c2 != std::istream::traits_type::eof ())
249 is.setstate (std::ios::failbit);
262 template <
typename T>
270 std::ios::streampos pos = is.tellg ();
289 if (c2 ==
'i' || c2 ==
'I' || c2 ==
'n' || c2 ==
'N')
290 val = read_inf_nan_na<T> (
is, c2);
297 if (neg && ! is.fail ())
304 val = read_inf_nan_na<T> (
is, c1);
313 std::ios::iostate status = is.rdstate ();
314 if (status & std::ios::failbit)
318 is.setstate (status);
324 template <
typename T>
331 std::complex<T> cx = 0.0;
340 re = octave_read_value<T> (
is);
345 im = octave_read_value<T> (
is);
349 cx = std::complex<T> (re, im);
351 is.setstate (std::ios::failbit);
356 is.setstate (std::ios::failbit);
361 cx = octave_read_value<double> (
is);
369 return octave_read_fp_value<double> (
is);
374 return octave_read_cx_fp_value<double> (
is);
379 return octave_read_fp_value<float> (
is);
384 return octave_read_cx_fp_value<float> (
is);
395 os << (d < 0 ?
"-Inf" :
"Inf");
418 os << (d < 0 ?
"-Inf" :
"Inf");
void octave_write_double(std::ostream &os, double d)
std::complex< T > octave_read_cx_fp_value(std::istream &is)
void octave_putenv(const std::string &name, const std::string &value)
std::string octave_fgets(FILE *f)
identity matrix If supplied two scalar respectively For allows like xample val
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
void octave_write_complex(std::ostream &os, const Complex &c)
int octave_putenv_wrapper(char *str)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
OCTAVE_API double octave_read_value(std::istream &is)
char * strsave(const char *s)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the special constant used to designate missing values Note that NA always compares not equal to NA(NA!=NA).To find NA values
T read_inf_nan_na(std::istream &is, char c0)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
T::size_type strlen(const typename T::value_type *str)
double octave_read_fp_value(std::istream &is)
charNDArray max(char d, const charNDArray &m)
void octave_write_float(std::ostream &os, float d)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol zero divided by nd tex zero divided by nd ifnottex and any operation involving another NaN value(5+NaN).Note that NaN always compares not equal to NaN(NaN!
bool xtoo_large_for_float(double x)
ColumnVector imag(const ComplexColumnVector &a)
std::complex< float > FloatComplex
std::complex< double > Complex
void octave_write_float_complex(std::ostream &os, const FloatComplex &c)
ColumnVector real(const ComplexColumnVector &a)
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
bool xis_one_or_zero(double x)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
bool xis_int_or_inf_or_nan(double x)
std::string octave_fgetl(FILE *f)