# LagBaBCover.h File Reference

`#include "CovMatrix.h"`
`#include "Cover.h"`

Go to the source code of this file.

## Classes

struct | header_of_solution_UCP
| Structure where is kept linkt to set of columns included to solution. More...
struct | CLink
| Structure representing one row or column in matrix. More...
struct | CoveringMatrix
| Structure where row an column links are kept. More...
class | SCPView
| Structure representing part of problem matrix. More...
class | LagrangeSolver
| Lagrangean relaxation. More...
class | LagBaBCover
| Recursive UCP solver using Lagrangean relaxation. More...

## Defines

#define | NEG_INFINITY -100000000.0/0.0000001f
#define | POS_INFINITY +100000000.0/0.0000001f
#define | NG_INFINITY -2147483647
#define | PS_INFINITY +2147483647

## Functions

int | compare_three_arrays (float costs[], int number_of_ones[], int c1, int c2)
| compares columns by costs, if those are equal then by number of covered rows
void | swap_in_arrays (int columns[], float costs[], int number_of_ones[], int left, int right)
| swaps two columns
void | quick_sort_three_arrays (int columns[], float costs[], int number_of_ones[], int l, int r)
| sort given part of arrays representing columns
int | compare_column_links (CLink *links[], int c1, int c2)
| compares columns by costs, if those are equal then by number of covered rows
int | compare_row_links (CLink *links[], int r1, int r2)
| compares rows by number of covered columns
void | swap_in_links (CLink *links[], int left, int right)
| swaps two links
void | quick_sort_column_links (CLink *links[], int l, int r)
| sort given part of array with links to columns
void | quick_sort_row_links (CLink *links[], int l, int r)
| sort given part of array with links to rows

## Define Documentation

#define NEG_INFINITY -100000000.0/0.0000001f

#define NG_INFINITY -2147483647

#define POS_INFINITY +100000000.0/0.0000001f

#define PS_INFINITY +2147483647

## Function Documentation

int compare_column_links | ( | CLink * | links[],
|  | int | c1,
|  | int | c2 |
| ) |  |  |

compares columns by costs, if those are equal then by number of covered rows

Parameters:

  | links | array with links to columns
  | c1 | index of first compared column
  | c2 | index of second compared column

Returns:
  -1,0 or 1

int compare_row_links | ( | CLink * | links[],
|  | int | r1,
|  | int | r2 |
| ) |  |  |

compares rows by number of covered columns

Parameters:

  | links | array with links to rows
  | r1 | index of first compared row
  | r2 | index of second compared row

Returns:
  -1,0 or 1

int compare_three_arrays | ( | float | costs[],
|  | int | number_of_ones[],
|  | int | c1,
|  | int | c2 |
| ) |  |  |

compares columns by costs, if those are equal then by number of covered rows

Parameters:

  | costs | array with costs of columns
  | number_of_ones | array eith counts of covers of columns
  | c1 | index of first compared column
  | c2 | index of second compared column

Returns:
  -1,0 or 1

void quick_sort_column_links | ( | CLink * | links[],
|  | int | l,
|  | int | r |
| ) |  |  |

sort given part of array with links to columns

Parameters:

  | links | array with links to columns
  | l | index of first column link to be sorted
  | r | index of last column link to be sorted

void quick_sort_row_links | ( | CLink * | links[],
|  | int | l,
|  | int | r |
| ) |  |  |

sort given part of array with links to rows

Parameters:

  | links | array with links to rows
  | l | index of first row link to be sorted
  | r | index of last row link to be sorted

void quick_sort_three_arrays | ( | int | columns[],
|  | float | costs[],
|  | int | number_of_ones[],
|  | int | l,
|  | int | r |
| ) |  |  |

sort given part of arrays representing columns

Parameters:

  | columns | array with indexes of columns
  | costs | array with costs of columns
  | number_of_ones | array eith counts of covers of columns
  | l | index of last column to be sorted
  | r | index of last column to be sorted

void swap_in_arrays | ( | int | columns[],
|  | float | costs[],
|  | int | number_of_ones[],
|  | int | left,
|  | int | right |
| ) |  |  |

swaps two columns

Parameters:

  | columns | array with indexes of columns
  | costs | array with costs of columns
  | number_of_ones | array eith counts of covers of columns
  | c1 | index of first swapped column
  | c2 | index of second swapped column

void swap_in_links | ( | CLink * | links[],
|  | int | left,
|  | int | right |
| ) |  |  |

swaps two links

Parameters:

  | links | array with links to rows or columns
  | left | index of first link to be swapped
  | right | index of second link to be swapped