Skip to content

Add tests cases with infinite bounds #881

@mtanneau

Description

@mtanneau

Test that edge cases such as

  • MOI.LessThan(Inf)
  • MOI.GreaterThan(-Inf)
  • MOI.Interval(l, Inf), MOI.Interval(-Inf, u), MOI.Interval(-Inf, Inf)
    are properly handled.

A typical edge case:

m = XXX.Optimizer()
x = MOI.add_variable(m)

# Even though the line below will be interpreted as `x >= 0`,
# it should return an `MOI.ConstraintIndex{MOI.SingleVariable, MOI.Interval{Float64}}`
c = MOI.add_constraint(m, MOI.SingleVariable(x), MOI.Interval(0,0, Inf))
@test isa(c, MOI.ConstraintIndex{MOI.SingleVariable, MOI.Interval{Float64}})

# The constraint index should be valid
@test MOI.is_valid(m, c)

The goal of testing such edge cases would be to ensure that

  • The MOI wrapper handles infinite values (as per the docs)
  • Constraint indices are properly tracked

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions