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