GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
oct-inttypes.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2017 John W. Eaton
4 Copyright (C) 2008-2009 Jaroslav Hajek
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if ! defined (octave_oct_inttypes_h)
25 #define octave_oct_inttypes_h 1
26 
27 #include "octave-config.h"
28 
29 #include <cstdlib>
30 
31 #include <iosfwd>
32 #include <limits>
33 
34 #include "lo-math.h"
35 #include "lo-mappers.h"
36 #include "lo-traits.h"
37 
38 template <typename T> class octave_int;
39 
44 
49 
50 #if defined (OCTAVE_INT_USE_LONG_DOUBLE)
51 
52 namespace octave
53 {
54  namespace math
55  {
56  inline long double round (long double x) { return roundl (x); }
57 
58  inline long double isnan (long double x) { return isnan (static_cast<double> (x)); }
59  }
60 }
61 
62 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
63 
64 OCTAVE_DEPRECATED ("use 'octave::math::round' instead")
65 inline long double xround (long double x) { return octave::math::round (x); }
66 
67 OCTAVE_DEPRECATED ("use 'octave::math::isnan' instead")
68 inline bool xisnan (long double x) { return octave::math::isnan (x); }
69 
70 #endif
71 
72 #endif
73 
74 // FIXME: we define this by our own because some compilers, such as
75 // MSVC, do not provide std::abs (int64_t) and std::abs (uint64_t). In
76 // the future, it should go away in favor of std::abs.
77 template <typename T>
78 inline T octave_int_abs (T x) { return x >= 0 ? x : -x; }
79 
80 // Query for an integer type of certain sizeof, and signedness.
81 template <int qsize, bool qsigned>
83 {
84 public:
85  static const bool registered = false;
86  typedef void type; // Void shall result in a compile-time error if we
87  // attempt to use it in computations.
88 };
89 
90 #define REGISTER_INT_TYPE(TYPE) \
91  template <> \
92  class query_integer_type<sizeof (TYPE), std::numeric_limits<TYPE>::is_signed> \
93  { \
94  public: \
95  static const bool registered = true; \
96  typedef TYPE type; \
97  }
98 
99 // No two registered integers can share sizeof and signedness.
103 REGISTER_INT_TYPE (uint16_t);
105 REGISTER_INT_TYPE (uint32_t);
107 REGISTER_INT_TYPE (uint64_t);
108 
109 // Rationale: Comparators have a single static method, rel(), that returns the
110 // result of the binary relation. They also have two static boolean fields:
111 // ltval, gtval determine the value of x OP y if x < y, x > y, respectively.
112 #define REGISTER_OCTAVE_CMP_OP(NM,OP) \
113  class NM \
114  { \
115  public: \
116  static const bool ltval = (0 OP 1); \
117  static const bool gtval = (1 OP 0); \
118  template <typename T> \
119  static bool op (T x, T y) { return x OP y; } \
120  }
121 
122 // We also provide two special relations: ct, yielding always true, and cf,
123 // yielding always false.
124 #define REGISTER_OCTAVE_CONST_OP(NM,value) \
125  class NM \
126  { \
127  public: \
128  static const bool ltval = value; \
129  static const bool gtval = value; \
130  template <typename T> \
131  static bool op (T, T) { return value; } \
132  }
133 
134 // Handles non-homogeneous integer comparisons. Avoids doing useless tests.
136 {
137  // This determines a suitable promotion type for T1 when meeting T2 in a
138  // binary relation. If promotion to int or T2 is safe, it is used.
139  // Otherwise, the signedness of T1 is preserved and it is widened if T2 is
140  // wider.
141  // Notice that if this is applied to both types, they must end up with equal
142  // size.
143  template <typename T1, typename T2>
144  class prom
145  {
146  // Promote to int?
147  static const bool pint = (sizeof (T1) < sizeof (int)
148  && sizeof (T2) < sizeof (int));
149  static const bool t1sig = std::numeric_limits<T1>::is_signed;
150  static const bool t2sig = std::numeric_limits<T2>::is_signed;
151  static const bool psig =
152  (pint || (sizeof (T2) > sizeof (T1) && t2sig) || t1sig);
153  static const int psize =
154  (pint ? sizeof (int) : (sizeof (T2) > sizeof (T1)
155  ? sizeof (T2) : sizeof (T1)));
156  public:
158  };
159 
160  // Implements comparisons between two types of equal size but
161  // possibly different signedness.
162  template <typename xop, int size>
163  class uiop
164  {
167  public:
168  static bool op (utype x, utype y)
169  { return xop::op (x, y); }
170  static bool op (stype x, stype y)
171  { return xop::op (x, y); }
172  static bool op (stype x, utype y)
173  { return (x < 0) ? xop::ltval : xop::op (static_cast<utype> (x), y); }
174  static bool op (utype x, stype y)
175  { return (y < 0) ? xop::gtval : xop::op (x, static_cast<utype> (y)); }
176  };
177 
178 public:
187 
188  // Universal comparison operation.
189  template <typename xop, typename T1, typename T2>
190  static bool
191  op (T1 x, T2 y)
192  {
193  typedef typename prom<T1, T2>::type PT1;
194  typedef typename prom<T2, T1>::type PT2;
195  return uiop<xop, sizeof (PT1)>::op (static_cast<PT1> (x),
196  static_cast<PT2> (y));
197  }
198 
199 public:
200 
201  // Mixed comparisons
202  template <typename xop, typename T>
203  static bool
204  mop (T x, double y)
205  { return xop::op (static_cast<double> (x), y); }
206 
207  template <typename xop, typename T>
208  static bool
209  mop (double x, T y)
210  { return xop::op (x, static_cast<double> (y)); }
211 
212 #if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
213 # define DECLARE_EXTERNAL_LONG_DOUBLE_CMP_OPS(T) \
214  template <typename xop> static OCTAVE_API bool \
215  external_mop (double, T); \
216  template <typename xop> static OCTAVE_API bool \
217  external_mop (T, double)
218 
219  DECLARE_EXTERNAL_LONG_DOUBLE_CMP_OPS (int64_t);
220  DECLARE_EXTERNAL_LONG_DOUBLE_CMP_OPS (uint64_t);
221 #endif
222 
223  // Typecasting to doubles won't work properly for 64-bit integers --
224  // they lose precision.
225  // If we have long doubles, use them...
226 #if defined (OCTAVE_INT_USE_LONG_DOUBLE)
227 # if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
228 # define DEFINE_LONG_DOUBLE_CMP_OP(T) \
229  template <typename xop> \
230  static bool \
231  mop (double x, T y) \
232  { \
233  return external_mop<xop> (x, y); \
234  } \
235  template <typename xop> \
236  static bool \
237  mop (T x, double y) \
238  { \
239  return external_mop<xop> (x, y); \
240  }
241 # else
242 # define DEFINE_LONG_DOUBLE_CMP_OP(T) \
243  template <typename xop> \
244  static bool \
245  mop (double x, T y) \
246  { \
247  return xop::op (static_cast<long double> (x), \
248  static_cast<long double> (y)); \
249  } \
250  template <typename xop> \
251  static bool \
252  mop (T x, double y) \
253  { \
254  return xop::op (static_cast<long double> (x), \
255  static_cast<long double> (y)); \
256  }
257 # endif
258 #else
259  // ... otherwise, use external handlers
260 
261  // FIXME: We could declare directly the mop methods as external,
262  // but we can't do this because bugs in gcc (<= 4.3) prevent
263  // explicit instantiations later in that case.
264 # define DEFINE_LONG_DOUBLE_CMP_OP(T) \
265  template <typename xop> static OCTAVE_API bool \
266  emulate_mop (double, T); \
267  template <typename xop> \
268  static bool \
269  mop (double x, T y) \
270  { \
271  return emulate_mop<xop> (x, y); \
272  } \
273  template <typename xop> static OCTAVE_API bool \
274  emulate_mop (T, double); \
275  template <typename xop> \
276  static bool \
277  mop (T x, double y) \
278  { \
279  return emulate_mop<xop> (x, y); \
280  }
281 #endif
282 
285 
286 #undef DEFINE_LONG_DOUBLE_CMP_OP
287 };
288 
289 // Base integer class. No data, just conversion methods and exception flags.
290 template <typename T>
292 {
293 public:
294 
295  static T min_val () { return std::numeric_limits<T>:: min (); }
296  static T max_val () { return std::numeric_limits<T>:: max (); }
297 
298  // Convert integer value.
299  template <typename S>
300  static T
301  truncate_int (const S& value)
302  {
303  // An exhaustive test whether the max and/or min check can be omitted.
304  static const bool t_is_signed = std::numeric_limits<T>::is_signed;
305  static const bool s_is_signed = std::numeric_limits<S>::is_signed;
306  static const int t_size = sizeof (T);
307  static const int s_size = sizeof (S);
308 
309  static const bool omit_chk_min =
310  (! s_is_signed || (t_is_signed && t_size >= s_size));
311  static const bool omit_chk_max =
312  (t_size > s_size || (t_size == s_size
313  && (! t_is_signed || s_is_signed)));
314  // If the check can be omitted, substitute constant false relation.
315  typedef octave_int_cmp_op::cf cf;
316  typedef octave_int_cmp_op::lt lt;
317  typedef octave_int_cmp_op::gt gt;
318  typedef typename if_then_else<omit_chk_min, cf, lt>::result chk_min;
319  typedef typename if_then_else<omit_chk_max, cf, gt>::result chk_max;
320 
321  // Efficiency of the following depends on inlining and dead code
322  // elimination, but that should be a piece of cake for most compilers.
323  if (chk_min::op (value, static_cast<S> (min_val ())))
324  {
325  return min_val ();
326  }
327  else if (chk_max::op (value, static_cast<S> (max_val ())))
328  {
329  return max_val ();
330  }
331  else
332  return static_cast<T> (value);
333  }
334 
335 private:
336 
337  // Computes a real-valued threshold for a max/min check.
338  template <typename S>
339  static S
340  compute_threshold (S val, T orig_val)
341  {
342  val = octave::math::round (val); // Fool optimizations (maybe redundant)
343  // If val is even, but orig_val is odd, we're one unit off.
344  if (orig_val % 2 && val / 2 == octave::math::round (val / 2))
345  // FIXME: is this always correct?
346  val *= (static_cast<S> (1) - (std::numeric_limits<S>::epsilon () / 2));
347  return val;
348  }
349 
350 public:
351 
352  // Convert a real number (check NaN and non-int).
353  template <typename S>
354  static T
355  convert_real (const S& value);
356 };
357 
358 // Saturated (homogeneous) integer arithmetics. The signed and unsigned
359 // implementations are significantly different, so we implement another layer
360 // and completely specialize. Arithmetics inherits from octave_int_base so
361 // that it can use its exceptions and truncation functions.
362 
363 template <typename T, bool is_signed>
365 { };
366 
367 // Unsigned arithmetics. C++ standard requires it to be modular, so the
368 // overflows can be handled efficiently and reliably.
369 template <typename T>
371 {
372 public:
373 
374  static T
375  abs (T x) { return x; }
376 
377  static T
378  signum (T x) { return x ? static_cast<T> (1) : static_cast<T> (0); }
379 
380  // Shifts do not overflow.
381  static T
382  rshift (T x, int n) { return x >> n; }
383 
384  static T
385  lshift (T x, int n) { return x << n; }
386 
387  static T
388  minus (T)
389  {
390  return static_cast<T> (0);
391  }
392 
393  // the overflow behavior for unsigned integers is guaranteed by C/C++,
394  // so the following should always work.
395  static T
396  add (T x, T y)
397  {
398  T u = x + y;
399  if (u < x)
400  {
402  }
403  return u;
404  }
405 
406  static T
407  sub (T x, T y)
408  {
409  T u = x - y;
410  if (u > x)
411  {
412  u = 0;
413  }
414  return u;
415  }
416 
417  // Multiplication is done using promotion to wider integer type. If there is
418  // no suitable promotion type, this operation *MUST* be specialized.
419  static T mul (T x, T y) { return mul_internal (x, y); }
420 
421  static T
422  mul_internal (T x, T y)
423  {
424  // Promotion type for multiplication (if exists).
425  typedef typename query_integer_type<2*sizeof (T), false>::type mptype;
426  return octave_int_base<T>::truncate_int (static_cast<mptype> (x)
427  * static_cast<mptype> (y));
428  }
429 
430  // Division with rounding to nearest. Note that / and % are probably
431  // computed by a single instruction.
432  static T
433  div (T x, T y)
434  {
435  if (y != 0)
436  {
437  T z = x / y;
438  T w = x % y;
439  if (w >= y-w) z += 1;
440  return z;
441  }
442  else
443  {
444  return x ? octave_int_base<T>::max_val () : 0;
445  }
446  }
447 
448  // Remainder.
449  static T
450  rem (T x, T y)
451  {
452  return y != 0 ? x % y : 0;
453  }
454 
455  // Modulus. Note the weird y = 0 case for Matlab compatibility.
456  static T
457  mod (T x, T y)
458  {
459  return y != 0 ? x % y : x;
460  }
461 };
462 
463 #if defined (OCTAVE_INT_USE_LONG_DOUBLE)
464 
465 // Handle 64-bit multiply using long double
466 
467 #if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
468 
469 extern OCTAVE_API uint64_t
470 octave_external_uint64_uint64_mul (uint64_t, uint64_t);
471 
472 #endif
473 
474 template <>
475 inline uint64_t
477 {
478  uint64_t retval;
479 
480  long double p = static_cast<long double> (x) * static_cast<long double> (y);
481 
482  if (p > static_cast<long double> (octave_int_base<uint64_t>::max_val ()))
484  else
485  retval = static_cast<uint64_t> (p);
486 
487  return retval;
488 }
489 
490 template <>
491 inline uint64_t
492 octave_int_arith_base<uint64_t, false>::mul (uint64_t x, uint64_t y)
493 {
494 #if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
495  return octave_external_uint64_uint64_mul (x, y);
496 #else
497  return mul_internal (x, y);
498 #endif
499 }
500 
501 #else
502 
503 // Special handler for 64-bit integer multiply.
504 template <>
505 OCTAVE_API uint64_t
507 
508 #endif
509 
510 // Signed integer arithmetic.
511 //
512 // Rationale: If OCTAVE_HAVE_FAST_INT_OPS is defined, the following
513 // conditions should hold:
514 //
515 // 1. Signed numbers are represented by twos complement (see
516 // <http://en.wikipedia.org/wiki/Two%27s_complement>)
517 //
518 // 2. static_cast to unsigned int counterpart works like
519 // interpreting the signed bit pattern as unsigned (and is thus
520 // zero-cost).
521 //
522 // 3. Signed addition and subtraction yield the same bit results as
523 // unsigned. (We use casts to prevent optimization interference,
524 // so there is no need for things like -ftrapv).
525 //
526 // 4. Bit operations on signed integers work like on unsigned
527 // integers, except for the shifts. Shifts are arithmetic.
528 //
529 // The above conditions are satisfied by most modern platforms. If
530 // OCTAVE_HAVE_FAST_INT_OPS is defined, bit tricks and wraparound
531 // arithmetics are used to avoid conditional jumps as much as
532 // possible, thus being friendly to modern pipeline processor
533 // architectures. Otherwise, we fall back to a bullet-proof code that
534 // only uses assumptions guaranteed by the standard.
535 
536 template <typename T>
538 {
539  // The corresponding unsigned type.
541 public:
542 
543  // Returns 1 for negative number, 0 otherwise.
544  static T
545  __signbit (T x)
546  {
547 #if defined (OCTAVE_HAVE_FAST_INT_OPS)
548  return static_cast<UT> (x) >> std::numeric_limits<T>::digits;
549 #else
550  return (x < 0) ? 1 : 0;
551 #endif
552  }
553 
554  static T
555  abs (T x)
556  {
557 #if defined (OCTAVE_HAVE_FAST_INT_OPS)
558  // This is close to how GCC does std::abs, but we can't just use std::abs,
559  // because its behavior for INT_MIN is undefined and the compiler could
560  // discard the following test.
561  T m = x >> std::numeric_limits<T>::digits;
562  T y = (x ^ m) - m;
563  if (y < 0)
564  {
566  }
567  return y;
568 #else
569  // -INT_MAX is safe because C++ actually allows only three implementations
570  // of integers: sign & magnitude, ones complement and twos complement.
571  // The first test will, with modest optimizations, evaluate at compile
572  // time, and maybe eliminate the branch completely.
573  T y;
575  && x == octave_int_base<T>::min_val ())
576  {
578  }
579  else
580  y = (x < 0) ? -x : x;
581  return y;
582 #endif
583  }
584 
585  static T
586  signum (T x)
587  {
588  // With modest optimizations, this will compile without a jump.
589  return ((x > 0) ? 1 : 0) - __signbit (x);
590  }
591 
592  // FIXME: we do not have an authority what signed shifts should
593  // exactly do, so we define them the easy way. Note that Matlab does
594  // not define signed shifts.
595 
596  static T
597  rshift (T x, int n) { return x >> n; }
598 
599  static T
600  lshift (T x, int n) { return x << n; }
601 
602  // Minus has problems similar to abs.
603  static T
604  minus (T x)
605  {
606 #if defined (OCTAVE_HAVE_FAST_INT_OPS)
607  T y = -x;
608  if (y == octave_int_base<T>::min_val ())
609  {
610  --y;
611  }
612  return y;
613 #else
614  T y;
616  && x == octave_int_base<T>::min_val ())
617  {
619  }
620  else
621  y = -x;
622  return y;
623 #endif
624  }
625 
626  static T
627  add (T x, T y)
628  {
629 #if defined (OCTAVE_HAVE_FAST_INT_OPS)
630  // The typecasts do nothing, but they are here to prevent an optimizing
631  // compiler from interfering. Also, the signed operations on small types
632  // actually return int.
633  T u = static_cast<UT> (x) + static_cast<UT> (y);
634  T ux = u ^ x;
635  T uy = u ^ y;
636  if ((ux & uy) < 0)
637  {
638  u = octave_int_base<T>::max_val () + __signbit (~u);
639  }
640  return u;
641 #else
642  // We shall carefully avoid anything that may overflow.
643  T u;
644  if (y < 0)
645  {
646  if (x < octave_int_base<T>::min_val () - y)
647  {
649  }
650  else
651  u = x + y;
652  }
653  else
654  {
655  if (x > octave_int_base<T>::max_val () - y)
656  {
658  }
659  else
660  u = x + y;
661  }
662 
663  return u;
664 #endif
665  }
666 
667  // This is very similar to addition.
668  static T
669  sub (T x, T y)
670  {
671 #if defined (OCTAVE_HAVE_FAST_INT_OPS)
672  // The typecasts do nothing, but they are here to prevent an optimizing
673  // compiler from interfering. Also, the signed operations on small types
674  // actually return int.
675  T u = static_cast<UT> (x) - static_cast<UT> (y);
676  T ux = u ^ x;
677  T uy = u ^ ~y;
678  if ((ux & uy) < 0)
679  {
680  u = octave_int_base<T>::max_val () + __signbit (~u);
681  }
682  return u;
683 #else
684  // We shall carefully avoid anything that may overflow.
685  T u;
686  if (y < 0)
687  {
688  if (x > octave_int_base<T>::max_val () + y)
689  {
691  }
692  else
693  u = x - y;
694  }
695  else
696  {
697  if (x < octave_int_base<T>::min_val () + y)
698  {
700  }
701  else
702  u = x - y;
703  }
704 
705  return u;
706 #endif
707  }
708 
709  // Multiplication is done using promotion to wider integer type. If there is
710  // no suitable promotion type, this operation *MUST* be specialized.
711  static T mul (T x, T y) { return mul_internal (x, y); }
712 
713  static T
714  mul_internal (T x, T y)
715  {
716  // Promotion type for multiplication (if exists).
717  typedef typename query_integer_type<2*sizeof (T), true>::type mptype;
718  return octave_int_base<T>::truncate_int (static_cast<mptype> (x)
719  * static_cast<mptype> (y));
720  }
721 
722  // Division.
723  static T
724  div (T x, T y)
725  {
726  T z;
727  if (y == 0)
728  {
729  if (x < 0)
731  else if (x != 0)
733  else
734  z = 0;
735  }
736  else if (y < 0)
737  {
738  // This is a special case that overflows as well.
739  if (y == -1 && x == octave_int_base<T>::min_val ())
740  {
742  }
743  else
744  {
745  z = x / y;
746  // Can't overflow, but std::abs (x) can!
747  T w = -octave_int_abs (x % y);
748  if (w <= y - w)
749  z -= 1 - (__signbit (x) << 1);
750  }
751  }
752  else
753  {
754  z = x / y;
755  // FIXME: this is a workaround due to MSVC's absence of
756  // std::abs (int64_t). The call to octave_int_abs can't
757  // overflow, but std::abs (x) can!
758  T w = octave_int_abs (x % y);
759 
760  if (w >= y - w)
761  z += 1 - (__signbit (x) << 1);
762  }
763  return z;
764  }
765 
766  // Remainder.
767  static T
768  rem (T x, T y)
769  {
770  return y != 0 ? x % y : 0;
771  }
772 
773  // Modulus. Note the weird y = 0 case for Matlab compatibility.
774  static T
775  mod (T x, T y)
776  {
777  if (y != 0)
778  {
779  T r = x % y;
780  return ((r < 0) != (y < 0)) ? r + y : r;
781  }
782  else
783  return x;
784  }
785 };
786 
787 #if defined (OCTAVE_INT_USE_LONG_DOUBLE)
788 
789 // Handle 64-bit multiply using long double
790 
791 #if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
792 
793 extern OCTAVE_API int64_t
794 octave_external_int64_int64_mul (int64_t, int64_t);
795 
796 #endif
797 
798 template <>
799 inline int64_t
801 {
802  int64_t retval;
803 
804  long double p = static_cast<long double> (x) * static_cast<long double> (y);
805 
806  // NOTE: We could maybe do it with a single branch if
807  // OCTAVE_HAVE_FAST_INT_OPS, but it would require one more runtime
808  // conversion, so the question is whether it would really be faster.
809  if (p > static_cast<long double> (octave_int_base<int64_t>::max_val ()))
811  else if (p < static_cast<long double> (octave_int_base<int64_t>::min_val ()))
813  else
814  retval = static_cast<int64_t> (p);
815 
816  return retval;
817 }
818 
819 template <>
820 inline int64_t
821 octave_int_arith_base<int64_t, true>::mul (int64_t x, int64_t y)
822 {
823 #if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
824  return octave_external_int64_int64_mul (x, y);
825 #else
826  return mul_internal (x, y);
827 #endif
828 }
829 
830 #else
831 
832 // Special handler for 64-bit integer multiply.
833 template <>
834 OCTAVE_API int64_t
836 
837 #endif
838 
839 // This class simply selects the proper arithmetics.
840 template <typename T>
842 : public octave_int_arith_base<T, std::numeric_limits<T>::is_signed>
843 { };
844 
845 template <typename T>
846 class
848 {
849 public:
850  typedef T val_type;
851 
852  octave_int (void) : ival () { }
853 
854  octave_int (T i) : ival (i) { }
855 
856 #if defined (OCTAVE_HAVE_OVERLOAD_CHAR_INT8_TYPES)
857  // Always treat characters as unsigned.
858  octave_int (char c)
859  : ival (octave_int_base<T>::truncate_int (static_cast<unsigned char> (c)))
860  { }
861 #endif
862 
863  octave_int (double d) : ival (octave_int_base<T>::convert_real (d)) { }
864 
865  octave_int (float d) : ival (octave_int_base<T>::convert_real (d)) { }
866 
867 #if defined (OCTAVE_INT_USE_LONG_DOUBLE)
868  octave_int (long double d) : ival (octave_int_base<T>::convert_real (d)) { }
869 #endif
870 
871  octave_int (bool b) : ival (b) { }
872 
873  template <typename U>
874  octave_int (const U& i) : ival(octave_int_base<T>::truncate_int (i)) { }
875 
876  template <typename U>
878  : ival (octave_int_base<T>::truncate_int (i.value ())) { }
879 
880  octave_int (const octave_int<T>& i) : ival (i.ival) { }
881 
882  octave_int& operator = (const octave_int<T>& i)
883  {
884  ival = i.ival;
885  return *this;
886  }
887 
888  T value (void) const { return ival; }
889 
890  const unsigned char * iptr (void) const
891  { return reinterpret_cast<const unsigned char *> (& ival); }
892 
893  bool operator ! (void) const { return ! ival; }
894 
895  bool bool_value (void) const { return static_cast<bool> (value ()); }
896 
897  char char_value (void) const { return static_cast<char> (value ()); }
898 
899  double double_value (void) const { return static_cast<double> (value ()); }
900 
901  float float_value (void) const { return static_cast<float> (value ()); }
902 
903  operator T (void) const { return value (); }
904 
906  operator + () const
907  { return *this; }
908 
909  // unary operators & mappers
910 #define OCTAVE_INT_UN_OP(OPNAME,NAME) \
911  inline octave_int<T> \
912  OPNAME () const \
913  { \
914  return octave_int_arith<T>::NAME (ival); \
915  }
916 
917  OCTAVE_INT_UN_OP(operator -, minus)
920 
921 #undef OCTAVE_INT_UN_OP
922 
923 // Homogeneous binary integer operations.
924 #define OCTAVE_INT_BIN_OP(OP, NAME, ARGT) \
925  inline octave_int<T> \
926  operator OP (const ARGT& y) const \
927  { \
928  return octave_int_arith<T>::NAME (ival, y); \
929  } \
930  inline octave_int<T>& \
931  operator OP##= (const ARGT& y) \
932  { \
933  ival = octave_int_arith<T>::NAME (ival, y); \
934  return *this; \
935  }
936 
942  OCTAVE_INT_BIN_OP(<<, lshift, int)
943  OCTAVE_INT_BIN_OP(>>, rshift, int)
944 
945 #undef OCTAVE_INT_BIN_OP
946 
947  static octave_int<T> min (void) { return std::numeric_limits<T>::min (); }
948  static octave_int<T> max (void) { return std::numeric_limits<T>::max (); }
949 
950  static int nbits (void) { return std::numeric_limits<T>::digits; }
951 
952  static int byte_size (void) { return sizeof (T); }
953 
954  static const char *type_name ();
955 
956  // The following are provided for convenience.
957  static const octave_int zero, one;
958 
959  // Unsafe. This function exists to support the MEX interface.
960  // You should not use it anywhere else.
961  void *mex_get_data (void) const { return const_cast<T *> (&ival); }
962 
963 private:
964 
965  T ival;
966 };
967 
968 template <typename T>
969 inline octave_int<T>
970 rem (const octave_int<T>& x, const octave_int<T>& y)
971 {
972  return octave_int_arith<T>::rem (x.value (), y.value ());
973 }
974 
975 template <typename T>
976 inline octave_int<T>
977 mod (const octave_int<T>& x, const octave_int<T>& y)
978 {
979  return octave_int_arith<T>::mod (x.value (), y.value ());
980 }
981 
982 // No mixed integer binary operations!
983 
984 namespace octave
985 {
986  namespace math
987  {
988  template <typename T>
989  bool
991  {
992  return false;
993  }
994  }
995 }
996 
997 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
998 
999 template <typename T>
1000 OCTAVE_DEPRECATED ("use 'octave::math::isnan' instead")
1001 bool
1002 xisnan (const octave_int<T>& x)
1003 {
1004  return octave::math::isnan (x);
1005 }
1006 
1007 #endif
1008 
1009 // FIXME: can/should any of these be inline?
1010 
1011 template <typename T>
1012 extern OCTAVE_API octave_int<T>
1013 pow (const octave_int<T>&, const octave_int<T>&);
1014 
1015 template <typename T>
1016 extern OCTAVE_API octave_int<T>
1017 pow (const double& a, const octave_int<T>& b);
1018 
1019 template <typename T>
1020 extern OCTAVE_API octave_int<T>
1021 pow (const octave_int<T>& a, const double& b);
1022 
1023 template <typename T>
1024 extern OCTAVE_API octave_int<T>
1025 pow (const float& a, const octave_int<T>& b);
1026 
1027 template <typename T>
1028 extern OCTAVE_API octave_int<T>
1029 pow (const octave_int<T>& a, const float& b);
1030 
1031 // FIXME: Do we really need a differently named single-precision
1032 // function integer power function here instead of an overloaded
1033 // one?
1034 template <typename T>
1035 extern OCTAVE_API octave_int<T>
1036 powf (const float& a, const octave_int<T>& b);
1037 
1038 template <typename T>
1039 extern OCTAVE_API octave_int<T>
1040 powf (const octave_int<T>& a, const float& b);
1041 
1042 // Binary relations
1043 
1044 #define OCTAVE_INT_CMP_OP(OP, NAME) \
1045  template <typename T1, typename T2> \
1046  inline bool \
1047  operator OP (const octave_int<T1>& x, const octave_int<T2>& y) \
1048  { \
1049  return octave_int_cmp_op::op<octave_int_cmp_op::NAME, T1, T2> (x.value (), y.value ()); \
1050  }
1051 
1058 
1059 #undef OCTAVE_INT_CMP_OP
1060 
1061 template <typename T>
1062 inline std::ostream&
1063 operator << (std::ostream& os, const octave_int<T>& ival)
1064 {
1065  os << ival.value ();
1066  return os;
1067 }
1068 
1069 template <typename T>
1070 inline std::istream&
1071 operator >> (std::istream& is, octave_int<T>& ival)
1072 {
1073  T tmp = 0;
1074  is >> tmp;
1075  ival = tmp;
1076  return is;
1077 }
1078 
1079 // We need to specialise for char and unsigned char because
1080 // std::operator<< and std::operator>> are overloaded to input and
1081 // output the ASCII character values instead of a representation of
1082 // their numerical value (e.g., os << char(10) outputs a space instead
1083 // of outputting the characters '1' and '0')
1084 
1085 template <>
1086 inline std::ostream&
1087 operator << (std::ostream& os, const octave_int<int8_t>& ival)
1088 {
1089  os << static_cast<int> (ival.value ());
1090  return os;
1091 }
1092 
1093 template <>
1094 inline std::ostream&
1095 operator << (std::ostream& os, const octave_int<uint8_t>& ival)
1096 {
1097  os << static_cast<unsigned int> (ival.value ());
1098  return os;
1099 }
1100 
1101 template <>
1102 inline std::istream&
1103 operator >> (std::istream& is, octave_int<int8_t>& ival)
1104 {
1105  int tmp = 0;
1106  is >> tmp;
1107  ival = static_cast<int8_t> (tmp);
1108  return is;
1109 }
1110 
1111 template <>
1112 inline std::istream&
1113 operator >> (std::istream& is, octave_int<uint8_t>& ival)
1114 {
1115  unsigned int tmp = 0;
1116  is >> tmp;
1117  ival = static_cast<uint8_t> (tmp);
1118  return is;
1119 }
1120 
1121 // Bitwise operations
1122 
1123 #define OCTAVE_INT_BITCMP_OP(OP) \
1124  template <typename T> \
1125  octave_int<T> \
1126  operator OP (const octave_int<T>& x, const octave_int<T>& y) \
1127  { \
1128  return x.value () OP y.value (); \
1129  }
1130 
1134 
1135 #undef OCTAVE_INT_BITCMP_OP
1136 
1137 // General bit shift.
1138 template <typename T>
1140 bitshift (const octave_int<T>& a, int n,
1141  const octave_int<T>& mask = std::numeric_limits<T>::max ())
1142 {
1143  if (n > 0)
1144  return (a << n) & mask;
1145  else if (n < 0)
1146  return (a >> -n) & mask;
1147  else
1148  return a & mask;
1149 }
1150 
1151 #if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
1152 
1153 #define DECLARE_EXTERNAL_LONG_DOUBLE_OP(T, OP) \
1154  extern OCTAVE_API T \
1155  external_double_ ## T ## _ ## OP (double x, T y); \
1156  extern OCTAVE_API T \
1157  external_ ## T ## _double_ ## OP (T x, double y)
1158 
1159 #define DECLARE_EXTERNAL_LONG_DOUBLE_OPS(T) \
1160  DECLARE_EXTERNAL_LONG_DOUBLE_OP (T, add); \
1161  DECLARE_EXTERNAL_LONG_DOUBLE_OP (T, sub); \
1162  DECLARE_EXTERNAL_LONG_DOUBLE_OP (T, mul); \
1163  DECLARE_EXTERNAL_LONG_DOUBLE_OP (T, div)
1164 
1165 DECLARE_EXTERNAL_LONG_DOUBLE_OPS (octave_int64);
1166 DECLARE_EXTERNAL_LONG_DOUBLE_OPS (octave_uint64);
1167 
1168 #endif
1169 
1170 #define OCTAVE_INT_DOUBLE_BIN_OP0(OP) \
1171  template <typename T> \
1172  inline octave_int<T> \
1173  operator OP (const octave_int<T>& x, const double& y) \
1174  { \
1175  return octave_int<T> (static_cast<double> (x) OP y); \
1176  } \
1177  template <typename T> \
1178  inline octave_int<T> \
1179  operator OP (const double& x, const octave_int<T>& y) \
1180  { \
1181  return octave_int<T> (x OP static_cast<double> (y)); \
1182  }
1183 
1184 #if defined (OCTAVE_INT_USE_LONG_DOUBLE)
1185 // Handle mixed op using long double
1186 #if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
1187 # define OCTAVE_INT_DOUBLE_BIN_OP(OP, NAME) \
1188  OCTAVE_INT_DOUBLE_BIN_OP0(OP) \
1189  template <> \
1190  inline octave_int64 \
1191  operator OP (const double& x, const octave_int64& y) \
1192  { \
1193  return external_double_octave_int64_ ## NAME (x, y); \
1194  } \
1195  template <> \
1196  inline octave_uint64 \
1197  operator OP (const double& x, const octave_uint64& y) \
1198  { \
1199  return external_double_octave_uint64_ ## NAME (x, y); \
1200  } \
1201  template <> \
1202  inline octave_int64 \
1203  operator OP (const octave_int64& x, const double& y) \
1204  { \
1205  return external_octave_int64_double_ ## NAME (x, y); \
1206  } \
1207  template <> \
1208  inline octave_uint64 \
1209  operator OP (const octave_uint64& x, const double& y) \
1210  { \
1211  return external_octave_uint64_double_ ## NAME (x, y); \
1212  }
1213 #else
1214 # define OCTAVE_INT_DOUBLE_BIN_OP(OP, NAME) \
1215  OCTAVE_INT_DOUBLE_BIN_OP0(OP) \
1216  template <> \
1217  inline octave_int64 \
1218  operator OP (const double& x, const octave_int64& y) \
1219  { \
1220  return octave_int64 (x OP static_cast<long double> (y.value ())); \
1221  } \
1222  template <> \
1223  inline octave_uint64 \
1224  operator OP (const double& x, const octave_uint64& y) \
1225  { \
1226  return octave_uint64 (x OP static_cast<long double> (y.value ())); \
1227  } \
1228  template <> \
1229  inline octave_int64 \
1230  operator OP (const octave_int64& x, const double& y) \
1231  { \
1232  return octave_int64 (static_cast<long double> (x.value ()) OP y); \
1233  } \
1234  template <> \
1235  inline octave_uint64 \
1236  operator OP (const octave_uint64& x, const double& y) \
1237  { \
1238  return octave_uint64 (static_cast<long double> (x.value ()) OP y); \
1239  }
1240 #endif
1241 #else
1242 // external handlers
1243 #define OCTAVE_INT_DOUBLE_BIN_OP(OP, NAME) \
1244  OCTAVE_INT_DOUBLE_BIN_OP0(OP) \
1245  template <> \
1246  OCTAVE_API octave_int64 \
1247  operator OP (const double&, const octave_int64&); \
1248  template <> \
1249  OCTAVE_API octave_uint64 \
1250  operator OP (const double&, const octave_uint64&); \
1251  template <> \
1252  OCTAVE_API octave_int64 \
1253  operator OP (const octave_int64&, const double&); \
1254  template <> \
1255  OCTAVE_API octave_uint64 \
1256  operator OP (const octave_uint64&, const double&);
1257 
1258 #endif
1259 
1264 
1265 #undef OCTAVE_INT_DOUBLE_BIN_OP0
1266 #undef OCTAVE_INT_DOUBLE_BIN_OP
1267 #undef DECLARE_EXTERNAL_LONG_DOUBLE_OP
1268 #undef DECLARE_EXTERNAL_LONG_DOUBLE_OPS
1269 
1270 #define OCTAVE_INT_DOUBLE_CMP_OP(OP,NAME) \
1271  template <typename T> \
1272  inline bool \
1273  operator OP (const octave_int<T>& x, const double& y) \
1274  { \
1275  return octave_int_cmp_op::mop<octave_int_cmp_op::NAME> (x.value (), y); \
1276  } \
1277  template <typename T> \
1278  inline bool \
1279  operator OP (const double& x, const octave_int<T>& y) \
1280  { \
1281  return octave_int_cmp_op::mop<octave_int_cmp_op::NAME> (x, y.value ()); \
1282  }
1283 
1290 
1291 #undef OCTAVE_INT_DOUBLE_CMP_OP
1292 
1293 // Floats are handled by simply converting to doubles.
1294 
1295 #define OCTAVE_INT_FLOAT_BIN_OP(OP) \
1296  template <typename T> \
1297  inline octave_int<T> \
1298  operator OP (const octave_int<T>& x, float y) \
1299  { \
1300  return x OP static_cast<double> (y); \
1301  } \
1302  template <typename T> \
1303  inline octave_int<T> \
1304  operator OP (float x, const octave_int<T>& y) \
1305  { \
1306  return static_cast<double> (x) OP y; \
1307  }
1308 
1313 
1314 #undef OCTAVE_INT_FLOAT_BIN_OP
1315 
1316 #define OCTAVE_INT_FLOAT_CMP_OP(OP) \
1317  template <typename T> \
1318  inline bool \
1319  operator OP (const octave_int<T>& x, const float& y) \
1320  { \
1321  return x OP static_cast<double> (y); \
1322  } \
1323  template <typename T> \
1324  bool \
1325  operator OP (const float& x, const octave_int<T>& y) \
1326  { \
1327  return static_cast<double> (x) OP y; \
1328  }
1329 
1336 
1337 #undef OCTAVE_INT_FLOAT_CMP_OP
1338 
1339 template <typename T>
1341 xmax (const octave_int<T>& x, const octave_int<T>& y)
1342 {
1343  const T xv = x.value ();
1344  const T yv = y.value ();
1345  return octave_int<T> (xv >= yv ? xv : yv);
1346 }
1347 
1348 template <typename T>
1350 xmin (const octave_int<T>& x, const octave_int<T>& y)
1351 {
1352  const T xv = x.value ();
1353  const T yv = y.value ();
1354  return octave_int<T> (xv <= yv ? xv : yv);
1355 }
1356 
1357 #endif
octave_int< uint32_t > octave_uint32
Definition: oct-inttypes.h:47
static const bool t2sig
Definition: oct-inttypes.h:150
static const bool registered
Definition: oct-inttypes.h:85
#define OCTAVE_INT_CMP_OP(OP, NAME)
Octave interface to the compression and uncompression libraries.
Definition: aepbalance.cc:47
#define OCTAVE_INT_BITCMP_OP(OP)
#define OCTAVE_INT_BIN_OP(OP, NAME, ARGT)
Definition: oct-inttypes.h:924
OCTAVE_API octave_int< T > pow(const octave_int< T > &, const octave_int< T > &)
octave_int< T > xmax(const octave_int< T > &x, const octave_int< T > &y)
#define OCTAVE_INT_FLOAT_BIN_OP(OP)
static bool op(utype x, stype y)
Definition: oct-inttypes.h:174
query_integer_type< size, true >::type stype
Definition: oct-inttypes.h:166
static const int psize
Definition: oct-inttypes.h:153
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
static int nbits(void)
Definition: oct-inttypes.h:950
bool isnan(double x)
Definition: lo-mappers.cc:347
octave_int< T > mod(const octave_int< T > &x, const octave_int< T > &y)
Definition: oct-inttypes.h:977
T octave_int_abs(T x)
Definition: oct-inttypes.h:78
octave_int< int16_t > octave_int16
Definition: oct-inttypes.h:41
static T min_val()
Definition: oct-inttypes.h:295
std::istream & operator>>(std::istream &is, octave_int< T > &ival)
char char_value(void) const
Definition: oct-inttypes.h:897
u
Definition: lu.cc:138
static T max_val()
Definition: oct-inttypes.h:296
query_integer_type< sizeof(T), false >::type UT
Definition: oct-inttypes.h:540
float float_value(void) const
Definition: oct-inttypes.h:901
static const bool psig
Definition: oct-inttypes.h:151
query_integer_type< psize, psig >::type type
Definition: oct-inttypes.h:157
octave_int(const octave_int< U > &i)
Definition: oct-inttypes.h:877
#define REGISTER_OCTAVE_CMP_OP(NM, OP)
Definition: oct-inttypes.h:112
double round(double x)
Definition: lo-mappers.cc:333
static T truncate_int(const S &value)
Definition: oct-inttypes.h:301
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
double double_value(void) const
Definition: oct-inttypes.h:899
const unsigned char * iptr(void) const
Definition: oct-inttypes.h:890
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
octave_int< int32_t > octave_int32
Definition: oct-inttypes.h:42
query_integer_type< size, false >::type utype
Definition: oct-inttypes.h:165
octave_int< uint16_t > octave_uint16
Definition: oct-inttypes.h:46
void * mex_get_data(void) const
Definition: oct-inttypes.h:961
static T rshift(T x, int n)
Definition: oct-inttypes.h:597
static S compute_threshold(S val, T orig_val)
Definition: oct-inttypes.h:340
static bool op(T1 x, T2 y)
Definition: oct-inttypes.h:191
static bool op(stype x, stype y)
Definition: oct-inttypes.h:170
nd deftypefn *octave_map m
Definition: ov-struct.cc:2058
std::complex< double > w(std::complex< double > z, double relerr=0)
static octave_int< T > min(void)
Definition: oct-inttypes.h:947
double signum(double x)
Definition: lo-mappers.h:259
#define OCTAVE_INT_DOUBLE_CMP_OP(OP, NAME)
octave_int< int64_t > octave_int64
Definition: oct-inttypes.h:43
OCTAVE_API octave_int< T > powf(const float &a, const octave_int< T > &b)
double tmp
Definition: data.cc:6300
is false
Definition: cellfun.cc:398
octave_value retval
Definition: data.cc:6294
octave_int(T i)
Definition: oct-inttypes.h:854
static T lshift(T x, int n)
Definition: oct-inttypes.h:600
#define OCTAVE_INT_UN_OP(OPNAME, NAME)
Definition: oct-inttypes.h:910
#define OCTAVE_INT_DOUBLE_BIN_OP(OP, NAME)
octave_int< uint64_t > octave_uint64
Definition: oct-inttypes.h:48
octave_int(const octave_int< T > &i)
Definition: oct-inttypes.h:880
#define DEFINE_LONG_DOUBLE_CMP_OP(T)
Definition: oct-inttypes.h:264
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
Definition: lu.cc:138
octave_int(bool b)
Definition: oct-inttypes.h:871
static octave_int< T > max(void)
Definition: oct-inttypes.h:948
static const octave_int zero
Definition: oct-inttypes.h:957
octave_int< T > xmin(const octave_int< T > &x, const octave_int< T > &y)
static bool op(utype x, utype y)
Definition: oct-inttypes.h:168
static const bool t1sig
Definition: oct-inttypes.h:149
static bool mop(T x, double y)
Definition: oct-inttypes.h:204
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:228
octave_int(float d)
Definition: oct-inttypes.h:865
#define REGISTER_OCTAVE_CONST_OP(NM, value)
Definition: oct-inttypes.h:124
#define REGISTER_INT_TYPE(TYPE)
Definition: oct-inttypes.h:90
=val(i)}if ode{val(i)}occurs in table i
Definition: lookup.cc:239
octave_int(const U &i)
Definition: oct-inttypes.h:874
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
static bool op(stype x, utype y)
Definition: oct-inttypes.h:172
p
Definition: lu.cc:138
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!
octave_int< T > rem(const octave_int< T > &x, const octave_int< T > &y)
Definition: oct-inttypes.h:970
the element is set to zero In other the statement xample y
Definition: data.cc:5342
b
Definition: cellfun.cc:398
static T mul_internal(T x, T y)
Definition: oct-inttypes.h:714
octave_int< T > bitshift(const octave_int< T > &a, int n, const octave_int< T > &mask=std::numeric_limits< T >::max())
#define OCTAVE_INT_FLOAT_CMP_OP(OP)
bool bool_value(void) const
Definition: oct-inttypes.h:895
static int byte_size(void)
Definition: oct-inttypes.h:952
octave_value operator!(const octave_value &a)
Definition: ov.h:1484
static T convert_real(const S &value)
Definition: oct-inttypes.cc:56
T value(void) const
Definition: oct-inttypes.h:888
octave_int< T > operator+(const octave_int< T > &x, const double &y)
write the output to stdout if nargout is
Definition: load-save.cc:1576
octave_int< uint8_t > octave_uint8
Definition: oct-inttypes.h:45
static const bool pint
Definition: oct-inttypes.h:147
octave_int< int8_t > octave_int8
Definition: oct-inttypes.h:38
static bool mop(double x, T y)
Definition: oct-inttypes.h:209
uint64_t mul_internal(uint64_t x, uint64_t y)
octave_int(void)
Definition: oct-inttypes.h:852
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
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:205
octave_int(double d)
Definition: oct-inttypes.h:863