MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::polynomial::IntPolynomial Class Reference

A single-variable polynomial with integer coefficients. More...

#include "mlir/Dialect/Polynomial/IR/Polynomial.h"

+ Inheritance diagram for mlir::polynomial::IntPolynomial:

Public Member Functions

 IntPolynomial (ArrayRef< IntMonomial > terms)
 
- Public Member Functions inherited from mlir::polynomial::PolynomialBase< IntPolynomial, IntMonomial >
 PolynomialBase ()=delete
 
 PolynomialBase (ArrayRef< IntMonomial > terms)
 
 operator bool () const
 
bool operator== (const PolynomialBase &other) const
 
bool operator!= (const PolynomialBase &other) const
 
void print (raw_ostream &os, ::llvm::StringRef separator, ::llvm::StringRef exponentiation) const
 
void print (raw_ostream &os) const
 
IntPolynomial add (const IntPolynomial &other)
 
void dump () const
 
std::string toIdentifier () const
 
unsigned getDegree () const
 
ArrayRef< IntMonomialgetTerms () const
 

Static Public Member Functions

static FailureOr< IntPolynomialfromMonomials (ArrayRef< IntMonomial > monomials)
 
static IntPolynomial fromCoefficients (ArrayRef< int64_t > coeffs)
 Returns a polynomial with coefficients given by coeffs. More...
 

Detailed Description

A single-variable polynomial with integer coefficients.

Eg: x^1024 + x + 1

Definition at line 228 of file Polynomial.h.

Constructor & Destructor Documentation

◆ IntPolynomial()

mlir::polynomial::IntPolynomial::IntPolynomial ( ArrayRef< IntMonomial terms)
inlineexplicit

Definition at line 230 of file Polynomial.h.

Member Function Documentation

◆ fromCoefficients()

IntPolynomial mlir::polynomial::IntPolynomial::fromCoefficients ( ArrayRef< int64_t >  coeffs)
static

Returns a polynomial with coefficients given by coeffs.

The value coeffs[i] is converted to a monomial with exponent i.

Definition at line 59 of file Polynomial.cpp.

◆ fromMonomials()

FailureOr< IntPolynomial > mlir::polynomial::IntPolynomial::fromMonomials ( ArrayRef< IntMonomial monomials)
static

Definition at line 35 of file Polynomial.cpp.


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