Classes | Defines | Typedefs | Functions

oct-inttypes.h File Reference

#include <climits>
#include <cstdlib>
#include <limits>
#include <iosfwd>
#include "lo-traits.h"
#include "lo-math.h"
#include "lo-mappers.h"
Include dependency graph for oct-inttypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  octave_int< T >
class  octave_int_arith< T >
class  octave_int_arith_base< T, is_signed >
class  octave_int_arith_base< T, false >
class  octave_int_arith_base< T, true >
class  octave_int_base< T >
class  octave_int_cmp_op
class  octave_int_cmp_op::prom< T1, T2 >
struct  query_integer_type< qsize, qsigned >
class  octave_int_cmp_op::uiop< xop, size >

Defines

#define DEFINE_LONG_DOUBLE_CMP_OP(T1, T2)
#define OCTAVE_INT_BIN_OP(OP, NAME, ARGT)
#define OCTAVE_INT_BITCMP_OP(OP)
#define OCTAVE_INT_CMP_OP(OP, NAME)
#define OCTAVE_INT_DOUBLE_BIN_OP(OP)
#define OCTAVE_INT_DOUBLE_BIN_OP0(OP)
#define OCTAVE_INT_DOUBLE_CMP_OP(OP, NAME)
#define OCTAVE_INT_FLOAT_BIN_OP(OP)
#define OCTAVE_INT_FLOAT_CMP_OP(OP)
#define OCTAVE_INT_UN_OP(OPNAME, NAME)
#define REGISTER_INT_TYPE(TYPE)
#define REGISTER_OCTAVE_CMP_OP(NM, OP)
#define REGISTER_OCTAVE_CONST_OP(NM, value)

Typedefs

typedef octave_int< int16_t > octave_int16
typedef octave_int< int32_t > octave_int32
typedef octave_int< int64_t > octave_int64
typedef octave_int< int8_t > octave_int8
typedef octave_int< uint16_t > octave_uint16
typedef octave_int< uint32_t > octave_uint32
typedef octave_int< uint64_t > octave_uint64
typedef octave_int< uint8_t > octave_uint8

Functions

template<class T >
octave_int< T > bitshift (const octave_int< T > &a, int n, const octave_int< T > &mask=std::numeric_limits< T >::max())
template<class T >
octave_int< T > mod (const octave_int< T > &x, const octave_int< T > &y)
template<class T >
octave_int_abs (T x)
template<class T >
std::ostream & operator<< (std::ostream &os, const octave_int< T > &ival)
template<class T >
std::istream & operator>> (std::istream &is, octave_int< T > &ival)
template<class T >
OCTAVE_API octave_int< T > pow (const float &a, const octave_int< T > &b)
template<class T >
OCTAVE_API octave_int< T > pow (const octave_int< T > &a, const float &b)
template<class T >
OCTAVE_API octave_int< T > pow (const octave_int< T > &, const octave_int< T > &)
template<class T >
OCTAVE_API octave_int< T > pow (const double &a, const octave_int< T > &b)
template<class T >
OCTAVE_API octave_int< T > pow (const octave_int< T > &a, const double &b)
template<class T >
OCTAVE_API octave_int< T > powf (const float &a, const octave_int< T > &b)
template<class T >
OCTAVE_API octave_int< T > powf (const octave_int< T > &a, const float &b)
 REGISTER_INT_TYPE (uint32_t)
 REGISTER_INT_TYPE (int64_t)
 REGISTER_INT_TYPE (uint16_t)
 REGISTER_INT_TYPE (uint64_t)
 REGISTER_INT_TYPE (int8_t)
 REGISTER_INT_TYPE (uint8_t)
 REGISTER_INT_TYPE (int16_t)
 REGISTER_INT_TYPE (int32_t)
template<class T >
octave_int< T > rem (const octave_int< T > &x, const octave_int< T > &y)
template<class T >
bool xisnan (const octave_int< T > &)
template<class T >
octave_int< T > xmax (const octave_int< T > &x, const octave_int< T > &y)
template<class T >
octave_int< T > xmin (const octave_int< T > &x, const octave_int< T > &y)

Define Documentation

#define DEFINE_LONG_DOUBLE_CMP_OP (   T1,
  T2 
)
Value:
template <class xop> static OCTAVE_API bool \
  emulate_mop (T1, T2); \
  template <class xop> \
  static bool \
  mop (T1 x, T2 y) \
    { \
      return emulate_mop<xop> (x, y); \
    }

Definition at line 194 of file oct-inttypes.h.

#define OCTAVE_INT_BIN_OP (   OP,
  NAME,
  ARGT 
)
Value:
inline octave_int<T> \
  operator OP (const ARGT& y) const \
  { return octave_int_arith<T>::NAME (ival, y); } \
  inline octave_int<T>& \
  operator OP##= (const ARGT& y) \
  { \
    ival = octave_int_arith<T>::NAME (ival, y); \
    return *this; \
  }

Definition at line 802 of file oct-inttypes.h.

#define OCTAVE_INT_BITCMP_OP (   OP  ) 
Value:
template <class T> \
  octave_int<T> \
  operator OP (const octave_int<T>& x, const octave_int<T>& y) \
  { return x.value () OP y.value (); }

Definition at line 932 of file oct-inttypes.h.

#define OCTAVE_INT_CMP_OP (   OP,
  NAME 
)
Value:
template<class T1, class T2> \
  inline bool \
  operator OP (const octave_int<T1>& x, const octave_int<T2>& y) \
  { return octave_int_cmp_op::op<octave_int_cmp_op::NAME, T1, T2> \
    (x.value (), y.value ()); }

Definition at line 896 of file oct-inttypes.h.

#define OCTAVE_INT_DOUBLE_BIN_OP (   OP  ) 
Value:
OCTAVE_INT_DOUBLE_BIN_OP0(OP) \
  template <> \
  OCTAVE_API octave_int64 \
  operator OP (const double&, const octave_int64&); \
  template <> \
  OCTAVE_API octave_uint64 \
  operator OP (const double&, const octave_uint64&); \
  template <> \
  OCTAVE_API octave_int64 \
  operator OP (const octave_int64&, const double&); \
  template <> \
  OCTAVE_API octave_uint64 \
  operator OP (const octave_uint64&, const double&);

Definition at line 1001 of file oct-inttypes.h.

#define OCTAVE_INT_DOUBLE_BIN_OP0 (   OP  ) 
Value:
template <class T> \
  inline octave_int<T> \
  operator OP (const octave_int<T>& x, const double& y) \
  { return octave_int<T> (static_cast<double> (x) OP y); } \
  template <class T> \
  inline octave_int<T> \
  operator OP (const double& x, const octave_int<T>& y) \
  { return octave_int<T> (x OP static_cast<double> (y)); } \

Definition at line 968 of file oct-inttypes.h.

#define OCTAVE_INT_DOUBLE_CMP_OP (   OP,
  NAME 
)
Value:
template <class T> \
  inline bool \
  operator OP (const octave_int<T>& x, const double& y) \
  { return octave_int_cmp_op::mop<octave_int_cmp_op::NAME> (x.value (), y); } \
  template <class T> \
  inline bool \
  operator OP (const double& x, const octave_int<T>& y) \
  { return octave_int_cmp_op::mop<octave_int_cmp_op::NAME> (x, y.value ()); }

Definition at line 1026 of file oct-inttypes.h.

#define OCTAVE_INT_FLOAT_BIN_OP (   OP  ) 
Value:
template <class T> \
  inline octave_int<T> \
  operator OP (const octave_int<T>& x, float y) \
  { return x OP static_cast<double> (y); } \
  template <class T> \
  inline octave_int<T> \
  operator OP (float x, const octave_int<T>& y) \
  { return static_cast<double> (x) OP y; }

Definition at line 1047 of file oct-inttypes.h.

#define OCTAVE_INT_FLOAT_CMP_OP (   OP  ) 
Value:
template <class T> \
  inline bool \
  operator OP (const octave_int<T>& x, const float& y) \
  { return x OP static_cast<double> (y); } \
  template <class T> \
  bool \
  operator OP (const float& x, const octave_int<T>& y) \
  { return static_cast<double> (x) OP y; }

Definition at line 1064 of file oct-inttypes.h.

#define OCTAVE_INT_UN_OP (   OPNAME,
  NAME 
)
Value:
inline octave_int<T> \
  OPNAME () const \
  { return octave_int_arith<T>::NAME (ival); }

Definition at line 790 of file oct-inttypes.h.

#define REGISTER_INT_TYPE (   TYPE  ) 
Value:
template <> \
class query_integer_type<sizeof (TYPE), std::numeric_limits<TYPE>::is_signed> \
{ \
public: \
  static const bool registered = true; \
  typedef TYPE type; \
}

Definition at line 58 of file oct-inttypes.h.

#define REGISTER_OCTAVE_CMP_OP (   NM,
  OP 
)
Value:
class NM \
    { \
    public: \
      static const bool ltval = (0 OP 1), gtval = (1 OP 0); \
      template <class T> \
      static bool op (T x, T y) { return x OP y; } \
    }

Definition at line 80 of file oct-inttypes.h.

#define REGISTER_OCTAVE_CONST_OP (   NM,
  value 
)
Value:
class NM \
    { \
    public: \
      static const bool ltval = value, gtval = value; \
      template <class T> \
      static bool op (T, T) { return value; } \
    }

Definition at line 91 of file oct-inttypes.h.


Typedef Documentation

typedef octave_int<int16_t> octave_int16

Definition at line 959 of file oct-inttypes.h.

typedef octave_int<int32_t> octave_int32

Definition at line 960 of file oct-inttypes.h.

typedef octave_int<int64_t> octave_int64

Definition at line 961 of file oct-inttypes.h.

typedef octave_int<int8_t> octave_int8

Definition at line 958 of file oct-inttypes.h.

typedef octave_int<uint16_t> octave_uint16

Definition at line 964 of file oct-inttypes.h.

typedef octave_int<uint32_t> octave_uint32

Definition at line 965 of file oct-inttypes.h.

typedef octave_int<uint64_t> octave_uint64

Definition at line 966 of file oct-inttypes.h.

typedef octave_int<uint8_t> octave_uint8

Definition at line 963 of file oct-inttypes.h.


Function Documentation

template<class T >
octave_int<T> bitshift ( const octave_int< T > &  a,
int  n,
const octave_int< T > &  mask = std::numeric_limits<T>::max () 
)

Definition at line 947 of file oct-inttypes.h.

template<class T >
octave_int<T> mod ( const octave_int< T > &  x,
const octave_int< T > &  y 
) [inline]

Definition at line 851 of file oct-inttypes.h.

References octave_int< T >::value().

Referenced by phrtsd().

template<class T >
T octave_int_abs ( x  )  [inline]
template<class T >
std::ostream& operator<< ( std::ostream &  os,
const octave_int< T > &  ival 
) [inline]

Definition at line 914 of file oct-inttypes.h.

template<class T >
std::istream& operator>> ( std::istream &  is,
octave_int< T > &  ival 
) [inline]

Definition at line 922 of file oct-inttypes.h.

template<class T >
OCTAVE_API octave_int<T> pow ( const float a,
const octave_int< T > &  b 
)

Definition at line 581 of file oct-inttypes.cc.

References octave_int< T >::float_value(), and pow().

template<class T >
OCTAVE_API octave_int<T> pow ( const octave_int< T > &  a,
const float b 
)

Definition at line 586 of file oct-inttypes.cc.

References octave_int< T >::double_value(), pow(), and xround().

template<class T >
OCTAVE_API octave_int<T> pow ( const octave_int< T > &  ,
const octave_int< T > &   
)
template<class T >
OCTAVE_API octave_int<T> pow ( const double a,
const octave_int< T > &  b 
)

Definition at line 567 of file oct-inttypes.cc.

References octave_int< T >::double_value(), and pow().

template<class T >
OCTAVE_API octave_int<T> pow ( const octave_int< T > &  a,
const double b 
)

Definition at line 572 of file oct-inttypes.cc.

References octave_int< T >::double_value(), pow(), and xround().

template<class T >
OCTAVE_API octave_int<T> powf ( const float a,
const octave_int< T > &  b 
)

Definition at line 598 of file oct-inttypes.cc.

References octave_int< T >::float_value(), and pow().

Referenced by DEFUN().

template<class T >
OCTAVE_API octave_int<T> powf ( const octave_int< T > &  a,
const float b 
)

Definition at line 603 of file oct-inttypes.cc.

References octave_int< T >::double_value(), pow(), and xround().

REGISTER_INT_TYPE ( uint32_t   ) 
REGISTER_INT_TYPE ( int64_t   ) 
REGISTER_INT_TYPE ( uint16_t   ) 
REGISTER_INT_TYPE ( uint64_t   ) 
REGISTER_INT_TYPE ( int8_t   ) 
REGISTER_INT_TYPE ( uint8_t   ) 
REGISTER_INT_TYPE ( int16_t   ) 
REGISTER_INT_TYPE ( int32_t   ) 
template<class T >
octave_int<T> rem ( const octave_int< T > &  x,
const octave_int< T > &  y 
) [inline]

Definition at line 846 of file oct-inttypes.h.

References octave_int< T >::value().

template<class T >
bool xisnan ( const octave_int< T > &   )  [inline]

Definition at line 858 of file oct-inttypes.h.

template<class T >
octave_int<T> xmax ( const octave_int< T > &  x,
const octave_int< T > &  y 
)

Definition at line 1085 of file oct-inttypes.h.

References octave_int< T >::value().

template<class T >
octave_int<T> xmin ( const octave_int< T > &  x,
const octave_int< T > &  y 
)

Definition at line 1093 of file oct-inttypes.h.

References octave_int< T >::value().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines