Skip to content

Get list of indices with non-default attribute values #2317

@odow

Description

@odow

@bernalde hit me up at INFORMS with this problem:

  • Given MOI.VariablePrimalStart appears in MOI.ListOfVariableAttributesSet, how do I tell which variables have a non-default start?

Some possible solutions:

  1. You don't. Iterate over every variable
  2. Add new attributes:
    • MOI.ListOfVariablesWithAttributeSet{A<:MOI.AbstractVariableAttribute}
    • MOI.ListOfConstraintsWithAttributeSet{F,S,A<:MOI.AbstractConstraintAttribute}

We could potentially implement 2. with the default that falls back to MOI.get(model, MOI.ListOfVariableIndices()). This would let solvers opt-in to more efficient implementations. But it might also confuse users if they start using MOI.ListOfVariablesWithAttributeSet and find that it is a super-set of indices, rather than the exact set.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions