Skip to content

Support "nonscalar" variables (like complex numbers, intervals, sequences of intervals)? #1253

@dourouc05

Description

@dourouc05

For now, MOI only supports scalar variables, i.e. real numbers (or subsets thereof). Complex numbers can be implemented as a pair of real numbers, as in https://github.com/jump-dev/ComplexOptInterface.jl. For constraint programming, I would need to represent intervals (i.e. a pair of integer values: the beginning and the end of the interval) and sequences of intervals (defined based on a series of intervals), but also graphs. This kind of needs spans several engines:

How could this kind of variables fit into MOI? (Or an extension to MOI.) Typical functions cannot be applied on this kind of object: two intervals cannot really be summed up, or be greater than some constant, for instance.

Maybe renaming SingleVariable as SingleScalarVariable/SingleRealVariable (and so on for the other related objects)? This would leave space for something like SingleIntervalVariable, SingleSequenceVariable (and vectors), etc., but also SingleComplexVariable.

In a way, it could also solve some problems with supports_constraint: many CP constraints only make sense for integer variables (e.g., an array index), others are generalisable but are not always implemented as such (like counting values equal to something). With a SingleIntegerVariable, supports_constraint could directly check for the type of variables.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions