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

- File List
- File Members

# /home/coin/SVN-release/OS-2.3.5/OS/src/OSUtils/OSMathUtil.h File Reference

`#include "OSParameters.h"`
`#include "OSdtoa.h"`
`#include "OSErrorClass.h"`
`#include "OSGeneral.h"`
`#include <sstream>`
`#include <string>`

Include dependency graph for OSMathUtil.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
class | MathUtil
| this class has routines for linear algebra. More...
## Functions
void | getMultIncr (int *i, int *mult, int *incr, int size, int defaultIncr)
| getMultIncr
void | getMultIncr (double *a, int *mult, double *incr, int size)
| getMultIncr
int | getMult (int *i, int size)
| getMult
int | getMult (double *a, int size)
| getMult
double | OSRand ()
| OSRand().
double | OSiRand (int iMin, int iMax)
| OSiRand(int iMin, int iMax).

## Function Documentation

void getMultIncr | ( | int * | i,
|  | int * | mult,
|  | int * | incr,
|  | int | size,
|  | int | defaultIncr |
| ) |  |  | `[inline]`

getMultIncr

Identify the next run in an integer array

Parameters:

  | i | holds a pointer to the array to be processed.
  | mult | holds the length of the run. This parameter is passed by reference
  | incr | holds the increment. This parameter is also passed by reference
  | size | holds the number of elements in the array. This parameter is passed by value
  | defaultIncr | holds the default value for incr from the schema file. Using just <el mult="..." saves space whenever a run of two or more elements has been encountered, whereas <el mult="..." incr="..." saves space only for runs of three or more elements. Thus the defaultIncr must be treated specially (and it might change from one schema element to the next).

Definition at line 167 of file OSMathUtil.h.

Referenced by writeIntVectorData().

void getMultIncr | ( | double * | a,
|  | int * | mult,
|  | double * | incr,
|  | int | size |
| ) |  |  | `[inline]`

getMultIncr

Identify the next run in an array of type double.

Parameters:

  | i | holds a pointer to the array to be processed.
  | mult | holds the length of the run. This parameter is passed by reference
  | incr | holds the increment. This parameter is also passed by reference
  | size | holds the number of elements in the array. This parameter is passed by value

Definition at line 205 of file OSMathUtil.h.

int getMult | ( | int * | i,
|  | int | size |
| ) |  |  | `[inline]`

getMult

Identify the number of duplicates at the start of an integer array

Parameters:

  | i | holds a pointer to the array to be processed.
  | size | holds the number of elements in the array.

Returns:
  the length of the run.

Definition at line 245 of file OSMathUtil.h.

References mult().

Referenced by writeDblVectorData().

int getMult | ( | double * | a,
|  | int | size |
| ) |  |  | `[inline]`

getMult

Identify the number of duplicates at the start of an array of type double

Parameters:

  | i | holds a pointer to the array to be processed.
  | size | holds the number of elements in the array.

Returns:
  the length of the run.

Definition at line 273 of file OSMathUtil.h.

References mult().

double OSRand | ( |  | ) | `[inline]`

OSRand().

Returns:
  a uniformly distributed random number between 0 and 1 (inclusive) The random number generator used, rand(), is not very good and should be replaced by a serious random number generator for serious work.

Definition at line 297 of file OSMathUtil.h.

Referenced by OtherConstraintResult::setRandom(), ConstraintSolution::setRandom(), OtherObjectiveResult::setRandom(), ObjectiveSolution::setRandom(), OtherVariableResult::setRandom(), VariableSolution::setRandom(), OptimizationSolution::setRandom(), TimeMeasurement::setRandom(), JobResult::setRandom(), ServiceResult::setRandom(), SolverOption::setRandom(), SolverOptions::setRandom(), OtherConOption::setRandom(), OtherConstraintOption::setRandom(), InitDualVarValue::setRandom(), InitDualVariableValues::setRandom(), InitConValue::setRandom(), InitConstraintValues::setRandom(), ConstraintOption::setRandom(), OtherObjOption::setRandom(), OtherObjectiveOption::setRandom(), InitObjBound::setRandom(), InitObjectiveBounds::setRandom(), InitObjValue::setRandom(), InitObjectiveValues::setRandom(), ObjectiveOption::setRandom(), OtherVarOption::setRandom(), OtherVariableOption::setRandom(), BranchingWeight::setRandom(), SOSWeights::setRandom(), SOSVariableBranchingWeights::setRandom(), IntegerVariableBranchingWeights::setRandom(), InitVarValueString::setRandom(), InitVariableValuesString::setRandom(), InitVarValue::setRandom(), InitVariableValues::setRandom(), VariableOption::setRandom(), Processes::setRandom(), PathPair::setRandom(), PathPairs::setRandom(), DirectoriesAndFiles::setRandom(), JobDependencies::setRandom(), OtherOption::setRandom(), OtherOptions::setRandom(), ContactOption::setRandom(), InstanceLocationOption::setRandom(), OptimizationOption::setRandom(), JobOption::setRandom(), ServiceOption::setRandom(), SystemOption::setRandom(), GeneralOption::setRandom(), OSOption::setRandom(), TimeSpan::setRandom(), CPUNumber::setRandom(), CPUSpeed::setRandom(), StorageCapacity::setRandom(), BasisStatus::setRandom(), OtherOptionEnumeration::setRandom(), IntVector::setRandom(), and GeneralFileHeader::setRandom().

double OSiRand | ( | int | iMin,
|  | int | iMax |
| ) |  |  | `[inline]`

OSiRand(int iMin, int iMax).

Returns:
  a uniformly distributed random integer between iMin and iMax (inclusive) The random number generator used, rand(), is not very good and should be replaced by a serious random number generator for serious work.

Definition at line 314 of file OSMathUtil.h.

Referenced by IntVector::setRandom().