//===- GeneratingFunction.h - Generating Functions over Q^d -----*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Definition of the GeneratingFunction class for Barvinok's algorithm, // which represents a function over Q^n, parameterized by d parameters. // //===----------------------------------------------------------------------===// #ifndef MLIR_ANALYSIS_PRESBURGER_GENERATINGFUNCTION_H #define MLIR_ANALYSIS_PRESBURGER_GENERATINGFUNCTION_H #include "mlir/Analysis/Presburger/Fraction.h" #include "mlir/Analysis/Presburger/Matrix.h" namespace mlir { namespace presburger { namespace detail { // A parametric point is a vector, each of whose elements // is an affine function of n parameters. Each column // in the matrix represents the affine function and // has n+1 elements. ParamPoint; // A point is simply a vector. Point; // A class to describe the type of generating function // used to enumerate the integer points in a polytope. // Consists of a set of terms, where the ith term has // * a sign, ±1, stored in `signs[i]` // * a numerator, of the form x^{n}, // where n, stored in `numerators[i]`, // is a parametric point. // * a denominator, of the form (1 - x^{d1})...(1 - x^{dn}), // where each dj, stored in `denominators[i][j]`, // is a vector. // // Represents functions f_p : Q^n -> Q of the form // // f_p(x) = \sum_i s_i * (x^n_i(p)) / (\prod_j (1 - x^d_{ij}) // // where s_i is ±1, // n_i \in Q^d -> Q^n is an n-vector of affine functions on d parameters, and // g_{ij} \in Q^n are vectors. class GeneratingFunction { … }; } // namespace detail } // namespace presburger } // namespace mlir #endif // MLIR_ANALYSIS_PRESBURGER_GENERATINGFUNCTION_H