GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave_int< T > Class Template Reference

#include "oct-inttypes.h"

Inheritance diagram for octave_int< T >:
Collaboration diagram for octave_int< T >:

Public Types

typedef T val_type
 

Public Member Functions

 octave_int (bool b)
 
 octave_int (const octave_int< T > &)=default
 
template<typename U >
 octave_int (const octave_int< U > &i)
 
template<typename U >
 octave_int (const U &i)
 
 octave_int (double d)
 
 octave_int (float d)
 
 octave_int (T i)
 
 octave_int (void)
 
 ~octave_int (void)=default
 
octave_int< T > abs () const
 
bool bool_value (void) const
 
char char_value (void) const
 
template<class S >
convert_real (const S &value)
 
double double_value (void) const
 
float float_value (void) const
 
const unsigned char * iptr (void) const
 
 operator T (void) const
 
bool operator! (void) const
 
octave_int< T > operator% (const octave_int< T > &y) const
 
octave_int< T > & operator%= (const octave_int< T > &y)
 
octave_int< T > operator* (const octave_int< T > &y) const
 
octave_int< T > & operator*= (const octave_int< T > &y)
 
octave_int< T > operator+ () const
 
octave_int< T > operator+ (const octave_int< T > &y) const
 
octave_int< T > & operator+= (const octave_int< T > &y)
 
octave_int< T > operator- () const
 
octave_int< T > operator- (const octave_int< T > &y) const
 
octave_int< T > & operator-= (const octave_int< T > &y)
 
octave_int< T > operator/ (const octave_int< T > &y) const
 
octave_int< T > & operator/= (const octave_int< T > &y)
 
octave_int< T > operator<< (const int &y) const
 
octave_int< T > & operator<<= (const int &y)
 
octave_intoperator= (const octave_int< T > &)=default
 
octave_int< T > operator>> (const int &y) const
 
octave_int< T > & operator>>= (const int &y)
 
octave_int< T > operator~ (void) const
 
octave_int< T > signum () const
 
OCTAVE_API const char * type_name (void)
 
OCTAVE_API const char * type_name (void)
 
OCTAVE_API const char * type_name (void)
 
OCTAVE_API const char * type_name (void)
 
OCTAVE_API const char * type_name (void)
 
OCTAVE_API const char * type_name (void)
 
OCTAVE_API const char * type_name (void)
 
OCTAVE_API const char * type_name (void)
 
value (void) const
 

Static Public Member Functions

static int byte_size (void)
 
template<typename S >
static OCTAVE_APIconvert_real (const S &value)
 
static octave_int< T > max (void)
 
static T max_val (void)
 
static octave_int< T > min (void)
 
static T min_val (void)
 
static int nbits (void)
 
template<typename S >
static T truncate_int (const S &value)
 
static const OCTAVE_API char * type_name ()
 

Static Public Attributes

static const octave_int s_one
 
static const octave_int s_zero
 

Static Private Member Functions

template<typename S >
static S compute_threshold (S val, T orig_val)
 

Private Attributes

m_ival
 

Detailed Description

template<typename T>
class octave_int< T >

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

Member Typedef Documentation

◆ val_type

template<typename T >
typedef T octave_int< T >::val_type

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

Constructor & Destructor Documentation

◆ octave_int() [1/8]

template<typename T >
octave_int< T >::octave_int ( void  )
inline

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

◆ octave_int() [2/8]

template<typename T >
octave_int< T >::octave_int ( i)
inline

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

◆ octave_int() [3/8]

template<typename T >
octave_int< T >::octave_int ( double  d)
inline

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

◆ octave_int() [4/8]

template<typename T >
octave_int< T >::octave_int ( float  d)
inline

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

◆ octave_int() [5/8]

template<typename T >
octave_int< T >::octave_int ( bool  b)
inline

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

◆ octave_int() [6/8]

template<typename T >
template<typename U >
octave_int< T >::octave_int ( const U &  i)
inline

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

◆ octave_int() [7/8]

template<typename T >
template<typename U >
octave_int< T >::octave_int ( const octave_int< U > &  i)
inline

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

◆ octave_int() [8/8]

template<typename T >
octave_int< T >::octave_int ( const octave_int< T > &  )
default

◆ ~octave_int()

template<typename T >
octave_int< T >::~octave_int ( void  )
default

Member Function Documentation

◆ abs()

template<typename T >
octave_int<T> octave_int< T >::abs ( void  ) const
inline

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

Referenced by extended_gcd(), and simple_gcd().

◆ bool_value()

template<typename T >
bool octave_int< T >::bool_value ( void  ) const
inline

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

Referenced by operator-().

◆ byte_size()

template<typename T >
static int octave_int< T >::byte_size ( void  )
inlinestatic

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

◆ char_value()

template<typename T >
char octave_int< T >::char_value ( void  ) const
inline

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

◆ compute_threshold()

template<typename T >
template<typename S >
static S octave_int_base< T >::compute_threshold ( val,
orig_val 
)
inlinestaticprivateinherited

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

References round().

◆ convert_real() [1/2]

template<typename T >
template<class S >
T octave_int_base< T >::convert_real ( const S &  value)
inherited

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

References isnan(), and round().

◆ convert_real() [2/2]

template<typename T >
template<typename S >
static OCTAVE_API T octave_int_base< T >::convert_real ( const S &  value)
staticinherited

◆ double_value()

template<typename T >
double octave_int< T >::double_value ( void  ) const
inline

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

Referenced by op_dble_prod(), op_dble_sum(), pow(), and powf().

◆ float_value()

template<typename T >
float octave_int< T >::float_value ( void  ) const
inline

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

Referenced by pow(), and powf().

◆ iptr()

template<typename T >
const unsigned char* octave_int< T >::iptr ( void  ) const
inline

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

◆ max()

template<typename T >
static octave_int<T> octave_int< T >::max ( void  )
inlinestatic

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

References max().

Referenced by img_float2uint(), operator*(), operator+(), operator-(), and operator/().

◆ max_val()

template<typename T >
static T octave_int_base< T >::max_val ( void  )
inlinestaticinherited

◆ min()

template<typename T >
static octave_int<T> octave_int< T >::min ( void  )
inlinestatic

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

References min().

◆ min_val()

template<typename T >
static T octave_int_base< T >::min_val ( void  )
inlinestaticinherited

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

References min().

Referenced by octave_int_arith_base< T, true >::div(), and octave_int_base< T >::truncate_int().

◆ nbits()

template<typename T >
static int octave_int< T >::nbits ( void  )
inlinestatic

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

◆ operator T()

template<typename T >
octave_int< T >::operator T ( void  ) const
inline

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

◆ operator!()

template<typename T >
bool octave_int< T >::operator! ( void  ) const
inline

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

◆ operator%()

template<typename T >
octave_int<T> octave_int< T >::operator% ( const octave_int< T > &  y) const
inline

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

◆ operator%=()

template<typename T >
octave_int<T>& octave_int< T >::operator%= ( const octave_int< T > &  y)
inline

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

◆ operator*()

template<typename T >
octave_int<T> octave_int< T >::operator* ( const octave_int< T > &  y) const
inline

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

◆ operator*=()

template<typename T >
octave_int<T>& octave_int< T >::operator*= ( const octave_int< T > &  y)
inline

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

◆ operator+() [1/2]

template<typename T >
octave_int<T> octave_int< T >::operator+ ( ) const
inline

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

◆ operator+() [2/2]

template<typename T >
octave_int<T> octave_int< T >::operator+ ( const octave_int< T > &  y) const
inline

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

◆ operator+=()

template<typename T >
octave_int<T>& octave_int< T >::operator+= ( const octave_int< T > &  y)
inline

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

◆ operator-() [1/2]

template<typename T >
octave_int<T> octave_int< T >::operator- ( ) const
inline

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

◆ operator-() [2/2]

template<typename T >
octave_int<T> octave_int< T >::operator- ( const octave_int< T > &  y) const
inline

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

◆ operator-=()

template<typename T >
octave_int<T>& octave_int< T >::operator-= ( const octave_int< T > &  y)
inline

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

◆ operator/()

template<typename T >
octave_int<T> octave_int< T >::operator/ ( const octave_int< T > &  y) const
inline

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

◆ operator/=()

template<typename T >
octave_int<T>& octave_int< T >::operator/= ( const octave_int< T > &  y)
inline

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

◆ operator<<()

template<typename T >
octave_int<T> octave_int< T >::operator<< ( const int &  y) const
inline

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

◆ operator<<=()

template<typename T >
octave_int<T>& octave_int< T >::operator<<= ( const int &  y)
inline

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

◆ operator=()

template<typename T >
octave_int& octave_int< T >::operator= ( const octave_int< T > &  )
default

◆ operator>>()

template<typename T >
octave_int<T> octave_int< T >::operator>> ( const int &  y) const
inline

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

◆ operator>>=()

template<typename T >
octave_int<T>& octave_int< T >::operator>>= ( const int &  y)
inline

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

◆ operator~()

template<typename T >
octave_int<T> octave_int< T >::operator~ ( void  ) const
inline

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

◆ signum()

template<typename T >
octave_int<T> octave_int< T >::signum ( void  ) const
inline

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

Referenced by extended_gcd().

◆ truncate_int()

template<typename T >
template<typename S >
static T octave_int_base< T >::truncate_int ( const S &  value)
inlinestaticinherited

◆ type_name() [1/9]

template<typename T >
static const OCTAVE_API char* octave_int< T >::type_name ( )
static

◆ type_name() [2/9]

OCTAVE_API const char * octave_int< int8_t >::type_name ( void  )

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

◆ type_name() [3/9]

OCTAVE_API const char * octave_int< int16_t >::type_name ( void  )

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

◆ type_name() [4/9]

OCTAVE_API const char * octave_int< int32_t >::type_name ( void  )

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

◆ type_name() [5/9]

OCTAVE_API const char * octave_int< int64_t >::type_name ( void  )

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

◆ type_name() [6/9]

OCTAVE_API const char * octave_int< uint8_t >::type_name ( void  )

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

◆ type_name() [7/9]

OCTAVE_API const char * octave_int< uint16_t >::type_name ( void  )

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

◆ type_name() [8/9]

OCTAVE_API const char * octave_int< uint32_t >::type_name ( void  )

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

◆ type_name() [9/9]

OCTAVE_API const char * octave_int< uint64_t >::type_name ( void  )

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

◆ value()

template<typename T >
T octave_int< T >::value ( void  ) const
inline

Member Data Documentation

◆ m_ival

template<typename T >
T octave_int< T >::m_ival
private

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

◆ s_one

template<typename T >
const octave_int< T > octave_int< T >::s_one
static

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

◆ s_zero

template<typename T >
const octave_int< T > octave_int< T >::s_zero
static

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

Referenced by operator*().


The documentation for this class was generated from the following files: