SOS
A special ordered set constraint. More...

Public Member Functions |
|||
virtual auto | compareTo (SOS const &other) const -> int final | ||
virtual auto | getHashCode () const -> std::size_t final | ||
auto | getIndex () const -> int override | ||
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.
|
|||
auto | getIndexForProb (XpressProblem const *xprob) const -> int override | ||
Get the index stored in this object but raise an exception if the problem that created this object is not prob .
|
|||
auto | getName () const -> std::string override | ||
Get the name of this object.Queries the problem instance that owns this object and returns the name from that instance.Examples using getName :
getName : |
|||
auto | getProblem () const -> xpress::objects::XpressProblem *override | ||
Get the problem to which this element belongs.
|
|||
auto | setName (std::optional< std::string > newName) -> SOS & | ||
Set the name of this SOS. |
|||
Public Member Functions inherited from xpress::objects::Index |
Static Public Member Functions |
|
static auto | sos (xpress::SetType type, xpress::SizedArray< Variable const > const &items, xpress::SizedArray< double const > const &weights, std::optional< std::string > name) -> xpress::objects::SOSDefinition |
Create a special ordered set constraint. |
|
static auto | sos1 (xpress::SizedArray< Variable const > const &items, xpress::SizedArray< double const > const &weights, std::optional< std::string > name) -> xpress::objects::SOSDefinition |
Create a special ordered set constraint of type 1. |
|
static auto | sos2 (xpress::SizedArray< Variable const > const &items, xpress::SizedArray< double const > const &weights, std::optional< std::string > name) -> xpress::objects::SOSDefinition |
Create a special ordered set constraint of type 2. |
|
Detailed Description
A special ordered set constraint.
- Since
- 44.00
Member Function Documentation
compareTo()
|
inlinefinalvirtual |
- Since
- 44.00
getHashCode()
|
inlinefinalvirtual |
- Since
- 44.00
getIndex()
|
inlineoverridevirtual |
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.
- Returns
- The index of this object in the underlying model.
- Since
- 44.00
- Since
- 44.00
Implements xpress::objects::Index.
getIndexForProb()
|
inlineoverridevirtual |
Get the index stored in this object but raise an exception if the problem that created this object is not prob
.
- 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
- 44.00
- Since
- 44.00
Implements xpress::objects::Index.
getName()
|
inlineoverridevirtual |
Get the name of this object.Queries the problem instance that owns this object and returns the name from that instance.Examples using getName
:
- BinBurglar.cpp
- BoolVars.cpp
- ContractAllocation.cpp
- CuttingStock.cpp
- FolioHeuristic.cpp
- FolioIIS.cpp
- FolioInit.cpp
- FolioMip1.cpp
- FolioMip2.cpp
- FolioMipIIS.cpp
- FolioQC.cpp
- FolioQP.cpp
- PolygonObjects.cpp
- QuadraticProgramming.cpp
- RecursiveFinancialPlanning.cpp
- Returns
- The name of this object.
- Since
- 44.00
getName
:
- BinBurglar.cpp
- BoolVars.cpp
- ContractAllocation.cpp
- CuttingStock.cpp
- FolioHeuristic.cpp
- FolioIIS.cpp
- FolioInit.cpp
- FolioMip1.cpp
- FolioMip2.cpp
- FolioMipIIS.cpp
- FolioQC.cpp
- FolioQP.cpp
- PolygonObjects.cpp
- QuadraticProgramming.cpp
- RecursiveFinancialPlanning.cpp
- Since
- 44.00
Implements xpress::objects::Index.
getProblem()
|
inlineoverridevirtual |
Get the problem to which this element belongs.
- Returns
-
The problem to which this element belongs. This will be
nullptr
if the element was deleted.
- Since
- 44.00
- Returns
-
The problem to which this element belongs. This will be
nullptr
if the element was deleted.
- Since
- 44.00
Implements xpress::objects::Index.
setName()
|
inline |
Set the name of this SOS.
Sets the name of this SOS in the problem instance that owns the object.
Examples using setName
:
- Catenary.cpp
- ContractAllocation.cpp
- CuttingStock.cpp
- FolioIIS.cpp
- FolioInit.cpp
- FolioMip1.cpp
- FolioMipIIS.cpp
- FolioQC.cpp
- GeneralConstraints.cpp
- ProductionPlanning_Index.cpp
- RecursiveFinancialPlanning.cpp
- Parameters
-
newName The name to be set.
- Returns
- This set
- Since
- 44.00
sos()
|
inlinestatic |
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 nullptr
.name Name of constraint. May be std::nullopt
- Returns
- A definition for the constraint defined by the arguments.
- Since
- 44.00
sos1()
|
inlinestatic |
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 nullptr
.name Name of constraint. May be std::nullopt
- Returns
- A definition for the constraint defined by the arguments.
- Since
- 44.00
sos2()
|
inlinestatic |
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 nullptr
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 nullptr
.name Name of constraint. May be std::nullopt
.
- Returns
- A definition for the constraint defined by the arguments.
- Since
- 44.00
The documentation for this class was generated from the following file:
- xpress_objects.hpp
© 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.