Branching on float variables
Functionality by programming task » Programming models » Using float variables and constraints

## Topics

| Variable selection for float variables
| Value selection for float variables
| Value selection for assigning float variables

## Classes

class | Gecode::FloatNumBranch
| Value description class for branching. More...
class | Gecode::FloatAFC
| Recording AFC information for float variables. More...
class | Gecode::FloatAction
| Recording actions for float variables. More...
class | Gecode::FloatCHB
| Recording CHB for float variables. More...
class | Gecode::FloatVarBranch
| Which variable to select for branching. More...
class | Gecode::FloatValBranch
| Which values to select for branching first. More...
class | Gecode::FloatAssign
| Which values to select for assignment. More...

## Typedefs

typedef std::function< bool(const Space &home, FloatVar x, int i)> | Gecode::FloatBranchFilter
| Branch filter function type for float variables.
typedef std::function< double(const Space &home, FloatVar x, int i)> | Gecode::FloatBranchMerit
| Branch merit function type for float variables.
typedef std::function< FloatNumBranch(const Space &home, FloatVar x, int i)> | Gecode::FloatBranchVal
| Branch value function type for float variables.
typedef std::function< void(Space &home, unsigned int a, FloatVar x, int i, FloatNumBranch nl)> | Gecode::FloatBranchCommit
| Branch commit function type for float variables.

## Functions

void | Gecode::branch (Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
| Branch over x with variable selection vars and value selection vals.
void | Gecode::branch (Home home, const FloatVarArgs &x, TieBreak< FloatVarBranch > vars, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
| Branch over x with tie-breaking variable selection vars and value selection vals.
void | Gecode::branch (Home home, FloatVar x, FloatValBranch vals, FloatVarValPrint vvp=nullptr)
| Branch over x with value selection vals.
void | Gecode::assign (Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatAssign vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
| Assign all x with variable selection vars and value selection vals.
void | Gecode::assign (Home home, const FloatVarArgs &x, TieBreak< FloatVarBranch > vars, FloatAssign vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
| Assign all x with tie-breaking variable selection vars and value selection vals.
void | Gecode::assign (Home home, FloatVar x, FloatAssign vals, FloatVarValPrint vvp=nullptr)
| Assign x with value selection vals.
void | Gecode::branch (Home home, const FloatVarArgs &x, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
| Branch over x with value selection vals.
void | Gecode::assign (Home home, const FloatVarArgs &x, FloatAssign vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
| Assign all x with value selection vals.

## Detailed Description

## Typedef Documentation

## FloatBranchFilter

typedef std::function<bool(const Space& home, FloatVar x, int i)> Gecode::FloatBranchFilter

Branch filter function type for float variables.

The variable x is considered for selection and i refers to the variable's position in the original array passed to the brancher.

Definition at line 1442 of file float.hh.

## FloatBranchMerit

typedef std::function<double(const Space& home, FloatVar x, int i)> Gecode::FloatBranchMerit

Branch merit function type for float variables.

The function must return a merit value for the variable x. The value i refers to the variable's position in the original array passed to the brancher.

Definition at line 1455 of file float.hh.

## FloatBranchVal

typedef std::function<FloatNumBranch(const Space& home, FloatVar x, int i)> Gecode::FloatBranchVal

Branch value function type for float variables.

Returns a value for the variable x that is to be used in the corresponding branch commit function. The integer i refers to the variable's position in the original array passed to the brancher.

Definition at line 1481 of file float.hh.

## FloatBranchCommit

typedef std::function<void(Space& home, unsigned int a, FloatVar x, int i, FloatNumBranch nl)> Gecode::FloatBranchCommit

Branch commit function type for float variables.

The function must post a constraint on the variable x which corresponds to the alternative a. The integer i refers to the variable's position in the original array passed to the brancher. The value nl is the value description computed by the corresponding branch value function.

Definition at line 1496 of file float.hh.

## Function Documentation

## branch() [1/4]

void Gecode::branch | ( | Home | home,
|  | const FloatVarArgs & | x,
|  | FloatVarBranch | vars,
|  | FloatValBranch | vals,
|  | FloatBranchFilter | bf = nullptr,
|  | FloatVarValPrint | vvp = nullptr )

Branch over x with variable selection vars and value selection vals.

Definition at line 39 of file branch.cpp.

## branch() [2/4]

void Gecode::branch | ( | Home | home,
|  | const FloatVarArgs & | x,
|  | TieBreak< FloatVarBranch > | vars,
|  | FloatValBranch | vals,
|  | FloatBranchFilter | bf = nullptr,
|  | FloatVarValPrint | vvp = nullptr )

Branch over x with tie-breaking variable selection vars and value selection vals.

Definition at line 55 of file branch.cpp.

## branch() [3/4]

void Gecode::branch | ( | Home | home,
|  | FloatVar | x,
|  | FloatValBranch | vals,
|  | FloatVarValPrint | vvp = nullptr )

Branch over x with value selection vals.

Definition at line 105 of file branch.cpp.

## assign() [1/4]

void Gecode::assign | ( | Home | home,
|  | const FloatVarArgs & | x,
|  | FloatVarBranch | vars,
|  | FloatAssign | vals,
|  | FloatBranchFilter | bf = nullptr,
|  | FloatVarValPrint | vvp = nullptr )

Assign all x with variable selection vars and value selection vals.

Definition at line 111 of file branch.cpp.

## assign() [2/4]

void Gecode::assign | ( | Home | home,
|  | const FloatVarArgs & | x,
|  | TieBreak< FloatVarBranch > | vars,
|  | FloatAssign | vals,
|  | FloatBranchFilter | bf = nullptr,
|  | FloatVarValPrint | vvp = nullptr )

Assign all x with tie-breaking variable selection vars and value selection vals.

Definition at line 126 of file branch.cpp.

## assign() [3/4]

void Gecode::assign | ( | Home | home,
|  | FloatVar | x,
|  | FloatAssign | vals,
|  | FloatVarValPrint | vvp = nullptr )

Assign x with value selection vals.

Definition at line 176 of file branch.cpp.

## branch() [4/4]

void Gecode::branch | ( | Home | home,
|  | const FloatVarArgs & | x,
|  | FloatValBranch | vals,
|  | FloatBranchFilter | bf = nullptr,
|  | FloatVarValPrint | vvp = nullptr )

inline

Branch over x with value selection vals.

Definition at line 37 of file branch.hpp.

## assign() [4/4]

void Gecode::assign | ( | Home | home,
|  | const FloatVarArgs & | x,
|  | FloatAssign | vals,
|  | FloatBranchFilter | bf = nullptr,
|  | FloatVarValPrint | vvp = nullptr )

inline

Assign all x with value selection vals.

Definition at line 43 of file branch.hpp.