#include <KS.hpp>
|
| void | sortItems (const double *c, const double *w) |
| |
|
| double | cap_ |
| | The capacity of the knapsack. More...
|
| |
| int | n_ |
| | The number of items. More...
|
| |
| int * | perm_ |
| | The permutation corresponding to the ordering (element perm[i] is the i-th in the original order. More...
|
| |
| const double * | cost_ |
| | The cost of each item (the order is after doing the cost/weight ordering) More...
|
| |
| const double * | weight_ |
| | The weight of the items (the order is after doing the cost/weight ordering) More...
|
| |
| int * | x |
| | The optimal solution in terms of the input order. More...
|
| |
| double | z |
| | The optimal solution value. More...
|
| |
Definition at line 52 of file KS.hpp.
| Knapsack::Knapsack |
( |
int |
n, |
|
|
double |
cap, |
|
|
const double * |
c, |
|
|
const double * |
w |
|
) |
| |
|
inline |
| void Knapsack::sortItems |
( |
const double * |
c, |
|
|
const double * |
w |
|
) |
| |
|
inlineprivate |
| void Knapsack::setCosts |
( |
const double * |
c | ) |
|
|
inline |
| void Knapsack::setCapacity |
( |
double |
cap | ) |
|
|
inline |
| void Knapsack::optimize |
( |
double |
lb = 0.0, |
|
|
double |
minimp = 1e-6 |
|
) |
| |
| const int* Knapsack::getBestSol |
( |
| ) |
const |
|
inline |
Definition at line 121 of file KS.hpp.
References x.
| const double Knapsack::getBestVal |
( |
| ) |
const |
|
inline |
Definition at line 122 of file KS.hpp.
References z.
| const double* Knapsack::cost_ |
|
private |
| const double* Knapsack::weight_ |
|
private |
The documentation for this class was generated from the following file:
- /tmp/Bcp-1.4.4/Applications/Csp/include/KS.hpp