26#if ! defined (octave_lo_utils_h)
27#define octave_lo_utils_h 1
29#include "octave-config.h"
44 template <
typename F,
typename T,
bool zero>
50 for (i = 0; i <
len - 3; i += 4)
54 if (fcn (m[i]) != zero
55 || fcn (m[i+1]) != zero
56 || fcn (m[i+2]) != zero
57 || fcn (m[i+3]) != zero)
64 if (fcn (m[i]) != zero)
75 return x == T (0) ||
x == T (1);
120#if defined (OCTAVE_HAVE_LONG_LONG_INT)
130 unsigned long int *r);
132#if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT)
135 unsigned long long int *r);
140#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS)
141template <
typename F,
typename T,
bool zero>
142OCTAVE_DEPRECATED (7,
"use 'octave::any_all_test' instead")
146 return octave::any_all_test<F, T, zero> (fcn, m,
len);
149OCTAVE_DEPRECATED (7,
"use 'octave::is_int_or_inf_or_nan' instead")
156OCTAVE_DEPRECATED (7,
"use 'octave::is_one_or_zero' instead")
158xis_one_or_zero (const T&
x)
164OCTAVE_DEPRECATED (7,
"use 'octave::is_zero' instead")
171OCTAVE_DEPRECATED (7,
"use 'octave::' instead")
172inline
bool xtoo_large_for_float (
double x)
177OCTAVE_DEPRECATED (7,
"use 'octave::' instead")
178inline
bool xtoo_large_for_float (const
Complex&
x)
183OCTAVE_DEPRECATED (7,
"use 'octave::' instead")
189OCTAVE_DEPRECATED (7,
"use 'octave::' instead")
190inline
bool xtoo_large_for_float (
float x)
195OCTAVE_DEPRECATED (7,
"use 'octave::strsave' instead")
196inline
char *
strsave (const
char *s)
201OCTAVE_DEPRECATED (7,
"use 'octave::fgets' instead")
202inline
std::
string octave_fgets (
std::FILE *
f)
207OCTAVE_DEPRECATED (7,
"use 'octave::fgetl' instead")
208inline
std::
string octave_fgetl (
std::FILE *
f)
213OCTAVE_DEPRECATED (7,
"use 'octave::fgets' instead")
214inline
std::
string octave_fgets (
std::FILE *
f,
bool& eof)
219OCTAVE_DEPRECATED (7,
"use 'octave::fgetl' instead")
220inline
std::
string octave_fgetl (
std::FILE *
f,
bool& eof)
225OCTAVE_DEPRECATED (7,
"use 'octave::read_value<T>' instead")
229 return octave::read_value<double> (is);
232OCTAVE_DEPRECATED (7,
"use 'octave::read_value<T>' instead")
236 return octave::read_value<Complex> (is);
239OCTAVE_DEPRECATED (7,
"use 'octave::read_value<T>' instead")
243 return octave::read_value<float> (is);
246OCTAVE_DEPRECATED (7,
"use 'octave::read_value<T>' instead")
250 return octave::read_value<FloatComplex> (is);
253OCTAVE_DEPRECATED (7,
"use 'octave::write_value<T>' instead")
255octave_write_double (
std::
ostream& os,
double value)
257 octave::write_value<double> (os, value);
260OCTAVE_DEPRECATED (7,
"use 'octave::write_value<T>' instead")
264 octave::write_value<Complex> (os, value);
267OCTAVE_DEPRECATED (7,
"use 'octave::write_value<T>' instead")
269octave_write_float (
std::
ostream& os,
float value)
271 octave::write_value<float> (os, value);
274OCTAVE_DEPRECATED (7,
"use 'octave::write_value<T>' instead")
278 octave::write_value<FloatComplex> (os, value);
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
static char * strsave(const char *s)
void F(const TSRC *v, TRES *r, octave_idx_type m, octave_idx_type n)
bool int_multiply_overflow(int a, int b, int *r)
std::string fgets(FILE *f)
bool is_int_or_inf_or_nan(double x)
char * strsave(const char *s)
std::string fgetl(FILE *f)
bool any_all_test(F fcn, const T *m, octave_idx_type len)
OCTAVE_API bool xis_int_or_inf_or_nan(double x)
T read_value(std::istream &is)
bool is_one_or_zero(const T &x)
void write_value(std::ostream &os, const T &value)
bool too_large_for_float(double x)
std::complex< double > Complex
std::complex< float > FloatComplex