- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# SOSWeights Class Reference

the SOSWeights class. More...

`#include <OSOption.h>`

Collaboration diagram for SOSWeights:

[legend]
List of all members.

## Public Member Functions
| SOSWeights ()
| Default constructor.
| ~SOSWeights ()
| Class destructor.
bool | IsEqual (SOSWeights *that)
| A function to check for the equality of two objects.
bool | setRandom (double density, bool conformant)
| A function to make a random instance of this class.
bool | setVar (int numberOfVar, BranchingWeight **var)
| A function to set an array of elements.
bool | addVar (int idx, double value)
| A function to add a element.
## Public Attributes
int | sosIdx
| index of the SOS (to match the OSiL file)
double | groupWeight
| branching weight for the entire SOS
int | numberOfVar
| number of children
BranchingWeight ** | var
| branching weights for individual variables

## Detailed Description

the SOSWeights class.

Author:
  Robert Fourer, Gus Gassmann, Jun Ma, Kipp Martin

Version:
  1.0, 21/11/2008

Since:
  OS 1.1

Remarks:
  A data structure class that corresponds to an xml element in the OSoL schema.

Definition at line 1525 of file OSOption.h.

## Constructor & Destructor Documentation

SOSWeights::SOSWeights | ( |  | ) |

Default constructor.

Definition at line 601 of file OSOption.cpp.

References var.

SOSWeights::~SOSWeights | ( |  | ) |

Class destructor.

Definition at line 612 of file OSOption.cpp.

References numberOfVar, and var.

## Member Function Documentation

bool SOSWeights::IsEqual | ( | SOSWeights * | that | ) |

A function to check for the equality of two objects.

Definition at line 9287 of file OSOption.cpp.

References groupWeight, isEqual(), numberOfVar, sosIdx, and var.

bool SOSWeights::setRandom | ( | double | density,
|  | bool | conformant |
| ) |  |  |

A function to make a random instance of this class.

Parameters:

  | density,: | corresponds to the probability that a particular child element is created
  | conformant,: | if true enforces side constraints not enforceable in the schema (e.g., agreement of "numberOfXXX" atrbutes and <XXX> children)

Definition at line 10785 of file OSOption.cpp.

References groupWeight, numberOfVar, OSRand(), BranchingWeight::setRandom(), sosIdx, and var.

Referenced by SOSVariableBranchingWeights::setRandom().

bool SOSWeights::setVar | ( | int | numberOfVar,
|  | BranchingWeight ** | var |
| ) |  |  |

A function to set an array of elements.

Parameters:

  | numberOfVar,: | number of elements to be set
  | var,: | the array of elements that are to be set

Definition at line 4876 of file OSOption.cpp.

References ErrorClass::errormsg, and var.

bool SOSWeights::addVar | ( | int | idx,
|  | double | value |
| ) |  |  |

A function to add a element.

Parameters:

  | idx,: | the index of the variable to be given a branching weight
  | value,: | the branching weight to be added

Definition at line 4909 of file OSOption.cpp.

References ErrorClass::errormsg, BranchingWeight::idx, numberOfVar, BranchingWeight::value, and var.

## Member Data Documentation

int SOSWeights::sosIdx

index of the SOS (to match the OSiL file)

Definition at line 1529 of file OSOption.h.

Referenced by SOSVariableBranchingWeights::addSOS(), IsEqual(), setRandom(), and SOSVariableBranchingWeights::setSOS().

double SOSWeights::groupWeight

branching weight for the entire SOS

Definition at line 1532 of file OSOption.h.

Referenced by SOSVariableBranchingWeights::addSOS(), IsEqual(), setRandom(), and SOSVariableBranchingWeights::setSOS().

int SOSWeights::numberOfVar

number of children

Definition at line 1535 of file OSOption.h.

Referenced by SOSVariableBranchingWeights::addSOS(), addVar(), OSOption::getNumberOfSOSVarBranchingWeights(), IsEqual(), setRandom(), SOSVariableBranchingWeights::setSOS(), and ~SOSWeights().

BranchingWeight** SOSWeights::var

branching weights for individual variables

Definition at line 1538 of file OSOption.h.

Referenced by SOSVariableBranchingWeights::addSOS(), addVar(), IsEqual(), setRandom(), SOSVariableBranchingWeights::setSOS(), setVar(), SOSWeights(), and ~SOSWeights().

The documentation for this class was generated from the following files:

- /home/coin/SVN-release/OS-2.3.5/OS/src/OSCommonInterfaces/OSOption.h
- /home/coin/SVN-release/OS-2.3.5/OS/src/OSCommonInterfaces/OSOption.cpp