ContentsIndexHome
PreviousUpNext
IAimmsMathProgramInfo::GetSOSData Method

Get SOS information.

virtual _LONG_T GetSOSData(
    _LONG_T nsos, 
    char sos_type[], 
    _LONG_T sos_set_no[], 
    _LONG_T sos_set_elem[], 
    _LONG_T sos_len[], 
    double sos_ref[], 
    double sos_prior[]
) = 0;
Parameters 
Description 
_LONG_T nsos 
The maximum number of SOS set members to retrieve. 
char sos_type[] 
Array containing the SOS type information for the sets. Possible values are
  • '1': Type 1
  • '2': Type 2
The length of this array must be at least equal to the total number of SOS sets. 
_LONG_T sos_set_no[] 
The sequence number of each SOS set. The length of this array must be at least equal to the total number of SOS sets. If you are not interested in the set numbers, you can set this argument to NULL. 
_LONG_T sos_set_elem[] 
In this array the members (columns) of each SOS set are listed sequentially. For example, if the first SOS set has 4 elements, then the first 4 entries in this array contain the column numbers of the members in this SOS set. The length of this array must be at least nsos
_LONG_T sos_len[] 
Length of each SOS set. The length of this array must be at least equal to the total number of SOS sets. 
double sos_ref[] 
The weight (or reference row value) of each SOS set member. The length of this array must be at least nsos. The positions in this array are defined in a similar way as in sos_set_elem
double sos_prior[] 
The priority of each SOS set. In case no priority is present, the value sos_prior[i] is set equal to -1 by AIMMS. The length of this array must be at least equal to the total number of SOS sets. If you are not interested in priority settings, you can set this argument to NULL. 

The GetSOSData method

The GetSOSData method is used to retrieve SOS information from AIMMS. This method should only be used by MIP solvers.

  1. If the SOS sets are loaded using multiple calls to GetSOSData,certain set numbers may occur more than once. The array sos_prior always returns the total length of each SOS set, even if a SOS set was cut into two pieces because of multiple calls to GetSOSData. Because of these complications we strongly recommend not to use multiple calls to GetSOSData.
  2. The total number of SOS sets is provided in the call to the DoSolve method through the integer parameters IntegerMathProgramInfo::IPARAM_SOS1_R and IntegerMathProgramInfo::IPARAM_SOS2_R. The sum of these two parameters may be used as the array size of sos_type, sos_set_no, sos_len and sos_prior.
  3. The total number of SOS elements (or non-zeros) is provided by AIMMS via the integer parameters IntegerMathProgramInfo::IPARAM_SOS1_NZ and IntegerMathProgramInfo::IPARAM_SOS2_NZ in the DoSolve method. If you set nsos to the sum of these two parameters, all SOS data is retrieved in one single call.

Copyright © 1993–2016 by AIMMS B.V. All rights reserved.