Halide 22.0.0 Halide compiler and libraries

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Halide::Internal::ModulusRemainder Struct Reference

The result of modulus_remainder analysis. More...

`#include <ModulusRemainder.h>`

## Public Member Functions
| ModulusRemainder ()=default
| ModulusRemainder (int64_t m, int64_t r)
bool | operator== (const ModulusRemainder &other) const

## Static Public Member Functions
static ModulusRemainder | unify (const ModulusRemainder &a, const ModulusRemainder &b)
static ModulusRemainder | intersect (const ModulusRemainder &a, const ModulusRemainder &b)

## Public Attributes
int64_t | modulus = 1
int64_t | remainder = 0

## Detailed Description

The result of modulus_remainder analysis.

These represent strided subsets of the integers. A ModulusRemainder object m represents all integers x such that there exists y such that x == m.modulus * y + m.remainder. Note that under this definition a set containing a single integer (a constant) is represented using a modulus of zero. These sets can be combined with several mathematical operators in the obvious way. E.g. m1 + m2 contains (at least) all integers x1 + x2 such that x1 belongs to m1 and x2 belongs to m2. These combinations are conservative. If some internal math would overflow, it defaults to all of the integers (modulus == 1, remainder == 0).

Definition at line 33 of file ModulusRemainder.h.

## Constructor & Destructor Documentation

## ◆ ModulusRemainder() [1/2]

Halide::Internal::ModulusRemainder::ModulusRemainder | ( |  | ) |
| default

## ◆ ModulusRemainder() [2/2]

Halide::Internal::ModulusRemainder::ModulusRemainder | ( | int64_t | m,
|  | int64_t | r
| ) |  |
| inline

Definition at line 35 of file ModulusRemainder.h.

## Member Function Documentation

## ◆ unify()

static ModulusRemainder Halide::Internal::ModulusRemainder::unify | ( | const ModulusRemainder & | a,
|  | const ModulusRemainder & | b
| ) |  |
| static

## ◆ intersect()

static ModulusRemainder Halide::Internal::ModulusRemainder::intersect | ( | const ModulusRemainder & | a,
|  | const ModulusRemainder & | b
| ) |  |
| static

Referenced by Halide::Internal::Simplify::ExprInfo::intersect().

## ◆ operator==()

bool Halide::Internal::ModulusRemainder::operator== | ( | const ModulusRemainder & | other | ) | const
| inline

Definition at line 49 of file ModulusRemainder.h.

References modulus, and remainder.

## Member Data Documentation

## ◆ modulus

int64_t Halide::Internal::ModulusRemainder::modulus = 1

Definition at line 39 of file ModulusRemainder.h.

Referenced by Halide::Internal::Simplify::ExprInfo::cast_to(), operator==(), and Halide::Internal::Simplify::ExprInfo::trim_bounds_using_alignment().

## ◆ remainder

int64_t Halide::Internal::ModulusRemainder::remainder = 0

Definition at line 39 of file ModulusRemainder.h.

Referenced by Halide::Internal::Simplify::ExprInfo::cast_to(), operator==(), and Halide::Internal::Simplify::ExprInfo::trim_bounds_using_alignment().

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

- src/ModulusRemainder.h