26 #if defined (HAVE_CONFIG_H)
60 T rmax = q / (2 - ct);
63 t1 = (ct / q) * (t1 < 0 ? -t1 : t1);
64 t1 = (rmax < t1 ? rmax : t1);
65 t1 = (ct > t1 ? ct : t1);
68 if (
x <= 0 || (t1 -
x) < rmax)
76 xteq (T u, T v, T ct = 3 * std::numeric_limits<T>::epsilon ())
81 return std::abs (u - v) < ((tu > tv ? tu : tv) * ct);
93 && ((inc > 0 && limit > 0)
94 || (inc < 0 && limit < 0)))
97 || (limit > base && inc < 0)
98 || (limit < base && inc > 0))
104 T ct = 3 * std::numeric_limits<T>::epsilon ();
106 T tmp =
xtfloor ((limit - base + inc) / inc, ct);
122 if (!
xteq (base + (n_elt - 1) * inc, limit))
124 if (
xteq (base + (n_elt - 2) * inc, limit))
126 else if (
xteq (base + n_elt * inc, limit))
137 template <
typename T>
159 template <
typename T>
170 retval = base + (nel - 1) * inc;
182 if ((inc > T (0) && retval >= limit) || (inc < T (0) && retval <= limit))
196 template <
typename T>
198 xinit (T base, T limit, T inc,
bool reverse, T& final_val,
215 || (limit < base && inc > 0)
216 || (limit > base && inc < 0))
225 if ((limit <= base && base + inc < limit)
226 || (limit >= base && base + inc > limit))
236 T dnel = (limit - base) / inc;
263 template <
typename T>
284 final_val = base - (nel - 1) * inc;
289 || (limit > base && inc < octave_int<T> (0))
295 final_val = base + (nel - 1) * inc;
299 template <
typename T>
324 xinit (m_base, m_limit, m_increment, m_reverse, m_final, m_numel);
331 xinit (m_base, m_limit, m_increment, m_reverse, m_final, m_numel);
350 template <
typename T>
361 if ((base > 0 && limit > 0) || (base < 0 && limit < 0))
371 if (base == 0 || final_val == 0)
388 return xnnz (m_base, m_limit, m_increment, m_final, m_numel);
395 return xnnz (m_base, m_limit, m_increment, m_final, m_numel);
398 OCTAVE_END_NAMESPACE(
octave)
octave_idx_type xnnz(T base, T limit, T inc, T final_val, octave_idx_type nel)
bool xteq(T u, T v, T ct=3 *std::numeric_limits< T >::epsilon())
bool xis_storable(T base, T limit, octave_idx_type nel)
void xinit(T base, T limit, T inc, bool reverse, T &final_val, octave_idx_type &nel)
octave_idx_type xnumel_internal(T base, T limit, T inc)
T xfinal_value(T base, T limit, T inc, octave_idx_type nel)
bool xall_elements_are_ints(T base, T inc, T final_val, octave_idx_type nel)
charNDArray max(char d, const charNDArray &m)
octave_idx_type nnz() const
bool all_elements_are_ints() const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
octave_idx_type nint_big(double x)
std::complex< T > floor(const std::complex< T > &x)
F77_RET_T const F77_DBLE * x