Initializing help system before first use

SOS

  • java.lang.Object
    • com.dashoptimization.objects.SOS
  • All Implemented Interfaces:
    Index, java.lang.Comparable<SOS>

    public final class SOS
    extends java.lang.Object
    implements Index, java.lang.Comparable<SOS>
    A special ordered set constraint.
    Since:
    43.00
    • Nested Class Summary

      Modifier and Type Class Description
      static class  SOS.Definition
      A special ordered set constraint.
    • Method Summary

      Modifier and Type Method Description
      int compareTo​(SOS other)
      boolean equals​(java.lang.Object other)
      int getIndex()
      Get the index that this object has in the underlying model.
      int getIndexForProb​(XpressProblem xprob)
      Get the index stored in this object but raise an exception if the problem that created this object is not prob.
      java.lang.String getName()
      Get the name of this object.
      XpressProblem getProblem()
      Get the problem to which this element belongs.
      int hashCode()  
      SOS setName​(java.lang.String newName)
      Set the name of this SOS.
      static SOS.Definition sos​(SetType type, Variable[] items, double[] weights, java.lang.String name)
      Create a special ordered set constraint.
      static SOS.Definition sos1​(Variable[] items, double[] weights, java.lang.String name)
      Create a special ordered set constraint of type 1.
      static SOS.Definition sos2​(Variable[] items, double[] weights, java.lang.String name)
      Create a special ordered set constraint of type 2.
      void updateIndex​(int delta)
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getIndex

        public int getIndex()
        Get the index that this object has in the underlying model. Attention: this is a very advanced function. Use it only if you know exactly what you are doing.

        Used in these examples:

        • GlobalObjectiveParametrics
        • GlobalRHSParametrics
        Specified by:
        getIndex in interface  Index
        Returns:
        The index of this object in the underlying model.
        Since:
        43.00
      • updateIndex

        public void updateIndex​(int delta)
        Specified by:
        updateIndex in interface  Index
        Parameters:
        delta - The value to add to the index.
        Since:
        43.00
      • getIndexForProb

        public int getIndexForProb​(XpressProblem xprob)
        Get the index stored in this object but raise an exception if the problem that created this object is not prob.
        Specified by:
        getIndexForProb in interface  Index
        Parameters:
        xprob - The problem for which the index is queried. If this object does not belong to prob then an execption is raised.
        Returns:
        The low-level index for this object in prob.
        Since:
        43.00
      • getProblem

        public XpressProblem getProblem()
        Get the problem to which this element belongs.
        Specified by:
        getProblem in interface  Index
        Returns:
        The problem to which this element belongs. This will be null if the element was deleted.
        Since:
        43.00
      • equals

        public final boolean equals​(java.lang.Object other)
        Overrides:
        equals in class  java.lang.Object
        Parameters:
        other -
        Returns:
        Since:
        43.00
      • compareTo

        public final int compareTo​(SOS other)
        Specified by:
        compareTo in interface  java.lang.Comparable<SOS>
        Parameters:
        other -
        Returns:
        Since:
        43.00
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class  java.lang.Object
      • getName

        public java.lang.String getName()
        Get the name of this object. Queries the problem instance that owns this object and returns the name from that instance.
        Specified by:
        getName in interface  Index
        Returns:
        The name of this object.
        Since:
        43.00
      • setName

        public SOS setName​(java.lang.String newName)
        Set the name of this SOS. Sets the name of this SOS in the problem instance that owns the object.
        Parameters:
        newName - The name to be set.
        Returns:
        This set
        Since:
        43.00
      • sos

        public static SOS.Definition sos​(SetType type,
                                         Variable[] items,
                                         double[] weights,
                                         java.lang.String name)
        Create a special ordered set constraint.
        Parameters:
        type - Type of constraint.
        items - The elements in the constraint.
        weights - Weights for the items in the constraint. May be null.
        name - Name of constraint. May be null
        Returns:
        A definition for the constraint defined by the arguments.
        Since:
        43.00
      • sos1

        public static SOS.Definition sos1​(Variable[] items,
                                          double[] weights,
                                          java.lang.String name)
        Create a special ordered set constraint of type 1. Only one of the items in the constraint may be non-zero.
        Parameters:
        items - The elements in the constraint.
        weights - Weights for the items in the constraint. May be null.
        name - Name of constraint. May be null
        Returns:
        A definition for the constraint defined by the arguments.
        Since:
        43.00
      • sos2

        public static SOS.Definition sos2​(Variable[] items,
                                          double[] weights,
                                          java.lang.String name)
        Create a special ordered set constraint of type 2. At most two elements in the constraint may be non-zero. Additionally, non-zero elements must be adjacent. The ordering of elements is given by weights. If weights is null then the elements are given the same order in which they appear in items.
        Parameters:
        items - The elements in the constraint.
        weights - Weights for the items in the constraint. May be null.
        name - Name of constraint. May be null.
        Returns:
        A definition for the constraint defined by the arguments.
        Since:
        43.00

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.