MLIR
18.0.0git
|
A class to represent fractions. More...
#include "mlir/Analysis/Presburger/Fraction.h"
Public Member Functions | |
Fraction ()=default | |
Default constructor initializes the represented rational number to zero. More... | |
Fraction (const MPInt &oNum, const MPInt &oDen=MPInt(1)) | |
Construct a Fraction from a numerator and denominator. More... | |
Fraction (const MPInt &num, int64_t den) | |
Overloads for passing literals. More... | |
Fraction (int64_t num, const MPInt &den=MPInt(1)) | |
Fraction (int64_t num, int64_t den) | |
MPInt | getAsInteger () const |
llvm::raw_ostream & | print (llvm::raw_ostream &os) const |
Public Attributes | |
MPInt | num {0} |
The numerator and denominator, respectively. More... | |
MPInt | den {1} |
A class to represent fractions.
The sign of the fraction is represented in the sign of the numerator; the denominator is always positive.
Note that overflows may occur if the numerator or denominator are not representable by 64-bit integers.
Definition at line 28 of file Fraction.h.
|
default |
Default constructor initializes the represented rational number to zero.
Construct a Fraction from a numerator and denominator.
Definition at line 33 of file Fraction.h.
|
inline |
Overloads for passing literals.
Definition at line 41 of file Fraction.h.
Definition at line 42 of file Fraction.h.
|
inline |
Definition at line 44 of file Fraction.h.
|
inline |
Definition at line 48 of file Fraction.h.
Referenced by mlir::presburger::IntMatrix::determinant(), and mlir::presburger::LexSimplex::findIntegerLexMin().
|
inline |
Definition at line 53 of file Fraction.h.
Referenced by mlir::presburger::operator<<().
MPInt mlir::presburger::Fraction::den {1} |
Definition at line 59 of file Fraction.h.
Referenced by mlir::presburger::ceil(), mlir::presburger::compare(), mlir::presburger::floor(), Fraction(), getAsInteger(), mlir::presburger::operator*(), mlir::presburger::operator+(), mlir::presburger::operator-(), mlir::presburger::operator/(), print(), and mlir::presburger::reduce().
MPInt mlir::presburger::Fraction::num {0} |
The numerator and denominator, respectively.
The denominator is always positive.
Definition at line 59 of file Fraction.h.
Referenced by mlir::presburger::ceil(), mlir::presburger::compare(), mlir::presburger::floor(), Fraction(), getAsInteger(), mlir::presburger::operator*(), mlir::presburger::operator+(), mlir::presburger::operator-(), mlir::presburger::operator/(), print(), and mlir::presburger::reduce().