My Project
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
mlir::IntInfty Class Reference

#include <SDBM.h>

Public Member Functions

 IntInfty (int64_t v)
 
IntInftyoperator= (int64_t v)
 
int64_t getValue () const
 
 operator int64_t () const
 
bool isFinite ()
 

Static Public Member Functions

static IntInfty infinity ()
 

Static Public Attributes

static constexpr int64_t infty = std::numeric_limits<int64_t>::max()
 

Detailed Description

A utility class for SDBM to represent an integer with potentially infinite positive value. This uses the largest value of int64_t to represent infinity and redefines the arithmetic operators so that the infinity "saturates": inf + x = inf, inf - x = inf. If a sum of two finite values reaches the largest value of int64_t, the behavior of IntInfty is undefined (in practice, it asserts), similarly to regular signed integer overflow.

Constructor & Destructor Documentation

◆ IntInfty()

mlir::IntInfty::IntInfty ( int64_t  v)
inline

Member Function Documentation

◆ getValue()

int64_t mlir::IntInfty::getValue ( ) const
inline

◆ infinity()

static IntInfty mlir::IntInfty::infinity ( )
inlinestatic

◆ isFinite()

bool mlir::IntInfty::isFinite ( )
inline

◆ operator int64_t()

mlir::IntInfty::operator int64_t ( ) const
inlineexplicit

◆ operator=()

IntInfty& mlir::IntInfty::operator= ( int64_t  v)
inline

Member Data Documentation

◆ infty

constexpr int64_t mlir::IntInfty::infty = std::numeric_limits<int64_t>::max()
static

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