ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
FractionalKnapsack.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*----------------------- File FractionalKnapsack.h ------------------------*/
3/*--------------------------------------------------------------------------*/
30/*--------------------------------------------------------------------------*/
31/*----------------------------- DEFINITIONS --------------------------------*/
32/*--------------------------------------------------------------------------*/
33
34#ifndef __ADS_FractionalKnapsack
35 #define __ADS_FractionalKnapsack
36/* self-identification: #endif constant */
37
38/*--------------------------------------------------------------------------*/
39/*------------------------------ INCLUDES ----------------------------------*/
40/*--------------------------------------------------------------------------*/
41
42#include "ADS/Contract.h"
43
44#include <algorithm>
45#include <cstddef>
46#include <numeric>
47#include <vector>
48
49/*--------------------------------------------------------------------------*/
50/*--------------------------- NAMESPACE ------------------------------------*/
51/*--------------------------------------------------------------------------*/
52
53namespace ADS
54{
55
75inline std::vector< double >
76fractionalKnapsack( const std::vector< double > & p ,
77 const std::vector< double > & v , double C );
78
79/*--------------------------------------------------------------------------*/
80
81} // end( namespace ADS )
82
83/*--------------------------------------------------------------------------*/
84/*-------------------------- IMPLEMENTATION --------------------------------*/
85/*--------------------------------------------------------------------------*/
86
87#include "ADS/optimization/impl/FractionalKnapsack.tpp"
88
89/*--------------------------------------------------------------------------*/
90
91#endif /* FractionalKnapsack.h included */
92
93/*--------------------------------------------------------------------------*/
94/*--------------------- End File FractionalKnapsack.h ----------------------*/
95/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::vector< double > fractionalKnapsack(const std::vector< double > &p, const std::vector< double > &v, double C)
the fractions of the objects, by decreasing (the zaino() of the book)
Definition ADT.h:96