2019-06-26 07:59:17 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< title > OR-Tools< / title >
< meta http-equiv = "Content-Type" content = "text/html;" / >
< meta charset = "utf-8" / >
<!-- <link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/> -->
< link rel = "stylesheet" type = "text/css" href = "ortools.css" title = "default" media = "screen,print" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "dynsections.js" > < / script >
< / head >
< body >
< div id = "banner-container" >
< div id = "banner" >
2019-06-29 18:18:08 +02:00
< span id = "sfml" > OR-Tools 7.2< / span >
2019-06-26 07:59:17 +02:00
< / div >
< / div >
2019-06-29 18:18:08 +02:00
< link rel = "icon" href = "https://developers.google.com/optimization/images/orLogo.png" >
2019-06-26 07:59:17 +02:00
< div id = "content" >
<!-- Generated by Doxygen 1.8.15 -->
< div id = "navrow1" class = "tabs" >
< ul class = "tablist" >
< li > < a href = "index.html" > < span > Main  Page< / span > < / a > < / li >
< li > < a href = "pages.html" > < span > Related  Pages< / span > < / a > < / li >
< li > < a href = "namespaces.html" > < span > Namespaces< / span > < / a > < / li >
< li class = "current" > < a href = "annotated.html" > < span > Classes< / span > < / a > < / li >
< li > < a href = "files.html" > < span > Files< / span > < / a > < / li >
< / ul >
< / div >
< div id = "navrow2" class = "tabs2" >
< ul class = "tablist" >
< li > < a href = "annotated.html" > < span > Class  List< / span > < / a > < / li >
< li > < a href = "classes.html" > < span > Class  Index< / span > < / a > < / li >
< li > < a href = "inherits.html" > < span > Class  Hierarchy< / span > < / a > < / li >
< li > < a href = "functions.html" > < span > Class  Members< / span > < / a > < / li >
< / ul >
< / div >
< div id = "nav-path" class = "navpath" >
< ul >
< li class = "navelem" > < a class = "el" href = "namespaceoperations__research.html" > operations_research< / a > < / li > < li class = "navelem" > < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html" > BaseKnapsackSolver< / a > < / li > < / ul >
< / div >
< / div > <!-- top -->
< div class = "header" >
< div class = "summary" >
< a href = "#pub-methods" > Public Member Functions< / a > |
< a href = "classoperations__research_1_1BaseKnapsackSolver-members.html" > List of all members< / a > < / div >
< div class = "headertitle" >
< div class = "title" > operations_research::BaseKnapsackSolver Class Reference< span class = "mlabels" > < span class = "mlabel" > abstract< / span > < / span > < / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< p > --— < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html" title = "--— BaseKnapsackSolver --— This is the base class for knapsack solvers." > BaseKnapsackSolver< / a > --— This is the base class for knapsack solvers.
< a href = "classoperations__research_1_1BaseKnapsackSolver.html#details" > More...< / a > < / p >
< p > < code > #include < < a class = "el" href = "knapsack__solver_8h_source.html" > knapsack_solver.h< / a > > < / code > < / p >
< div class = "dynheader" >
Inheritance diagram for operations_research::BaseKnapsackSolver:< / div >
< div class = "dyncontent" >
< div class = "center" > < img src = "classoperations__research_1_1BaseKnapsackSolver__inherit__graph.png" border = "0" usemap = "#operations__research_1_1BaseKnapsackSolver_inherit__map" alt = "Inheritance graph" / > < / div >
< map name = "operations__research_1_1BaseKnapsackSolver_inherit__map" id = "operations__research_1_1BaseKnapsackSolver_inherit__map" >
< area shape = "rect" title = "--â BaseKnapsackSolver --â This is the base class for knapsack solvers." alt = "" coords = "13,5,169,44" / >
< area shape = "rect" href = "classoperations__research_1_1KnapsackGenericSolver.html" title = "--â KnapsackGenericSolver --â KnapsackGenericSolver is the multi-dimensional knapsack solver class." alt = "" coords = "5,92,177,131" / >
< / map >
< center > < span class = "legend" > [< a href = "graph_legend.html" > legend< / a > ]< / span > < / center > < / div >
< table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "pub-methods" > < / a >
Public Member Functions< / h2 > < / td > < / tr >
< tr class = "memitem:a507afd9932799f0be34f34605cd5ffee" > < td class = "memItemLeft" align = "right" valign = "top" >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html#a507afd9932799f0be34f34605cd5ffee" > BaseKnapsackSolver< / a > (const std::string & solver_name)< / td > < / tr >
< tr class = "separator:a507afd9932799f0be34f34605cd5ffee" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a5f685ec61d9de86d57bdc53124c08b12" > < td class = "memItemLeft" align = "right" valign = "top" > virtual  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html#a5f685ec61d9de86d57bdc53124c08b12" > ~BaseKnapsackSolver< / a > ()< / td > < / tr >
< tr class = "separator:a5f685ec61d9de86d57bdc53124c08b12" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a3e8f72facec15537065c1625e647d58b" > < td class = "memItemLeft" align = "right" valign = "top" > virtual void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html#a3e8f72facec15537065c1625e647d58b" > Init< / a > (const std::vector< int64 > & profits, const std::vector< std::vector< int64 > > & weights, const std::vector< int64 > & capacities)=0< / td > < / tr >
< tr class = "memdesc:a3e8f72facec15537065c1625e647d58b" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Initializes the solver and enters the problem to be solved. < a href = "#a3e8f72facec15537065c1625e647d58b" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:a3e8f72facec15537065c1625e647d58b" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a381cc9d7b544a8ec4727f9618f0b4f8f" > < td class = "memItemLeft" align = "right" valign = "top" > virtual void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html#a381cc9d7b544a8ec4727f9618f0b4f8f" > GetLowerAndUpperBoundWhenItem< / a > (int item_id, bool is_item_in, int64 *lower_bound, int64 *upper_bound)< / td > < / tr >
< tr class = "memdesc:a381cc9d7b544a8ec4727f9618f0b4f8f" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Gets the lower and upper bound when the item is in or out of the knapsack. < a href = "#a381cc9d7b544a8ec4727f9618f0b4f8f" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:a381cc9d7b544a8ec4727f9618f0b4f8f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a952deb24e032890d2781e52fedb70efa" > < td class = "memItemLeft" align = "right" valign = "top" > virtual int64  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html#a952deb24e032890d2781e52fedb70efa" > Solve< / a > (TimeLimit *time_limit, bool *is_solution_optimal)=0< / td > < / tr >
< tr class = "memdesc:a952deb24e032890d2781e52fedb70efa" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Solves the problem and returns the profit of the optimal solution. < a href = "#a952deb24e032890d2781e52fedb70efa" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:a952deb24e032890d2781e52fedb70efa" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a08bf62b91f6cf3fca10a504f7dd278a6" > < td class = "memItemLeft" align = "right" valign = "top" > virtual bool  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html#a08bf62b91f6cf3fca10a504f7dd278a6" > best_solution< / a > (int item_id) const =0< / td > < / tr >
< tr class = "memdesc:a08bf62b91f6cf3fca10a504f7dd278a6" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Returns true if the item 'item_id' is packed in the optimal knapsack. < a href = "#a08bf62b91f6cf3fca10a504f7dd278a6" > More...< / a > < br / > < / td > < / tr >
< tr class = "separator:a08bf62b91f6cf3fca10a504f7dd278a6" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ae19aff92b4b38e712ead1cfcafd81f03" > < td class = "memItemLeft" align = "right" valign = "top" > virtual std::string  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html#ae19aff92b4b38e712ead1cfcafd81f03" > GetName< / a > () const< / td > < / tr >
< tr class = "separator:ae19aff92b4b38e712ead1cfcafd81f03" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
< div class = "textblock" > < p > --— < a class = "el" href = "classoperations__research_1_1BaseKnapsackSolver.html" title = "--— BaseKnapsackSolver --— This is the base class for knapsack solvers." > BaseKnapsackSolver< / a > --— This is the base class for knapsack solvers. < / p >
2019-06-29 18:18:08 +02:00
< p class = "definition" > Definition at line < a class = "el" href = "knapsack__solver_8h_source.html#l00494" > 494< / a > of file < a class = "el" href = "knapsack__solver_8h_source.html" > knapsack_solver.h< / a > .< / p >
2019-06-26 07:59:17 +02:00
< / div > < h2 class = "groupheader" > Constructor & Destructor Documentation< / h2 >
< a id = "a507afd9932799f0be34f34605cd5ffee" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a507afd9932799f0be34f34605cd5ffee" > ◆ < / a > < / span > BaseKnapsackSolver()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > operations_research::BaseKnapsackSolver::BaseKnapsackSolver < / td >
< td > (< / td >
< td class = "paramtype" > const std::string &   < / td >
< td class = "paramname" > < em > solver_name< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > inline< / span > < span class = "mlabel" > explicit< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2019-06-29 18:18:08 +02:00
< p class = "definition" > Definition at line < a class = "el" href = "knapsack__solver_8h_source.html#l00496" > 496< / a > of file < a class = "el" href = "knapsack__solver_8h_source.html" > knapsack_solver.h< / a > .< / p >
2019-06-26 07:59:17 +02:00
< / div >
< / div >
< a id = "a5f685ec61d9de86d57bdc53124c08b12" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a5f685ec61d9de86d57bdc53124c08b12" > ◆ < / a > < / span > ~BaseKnapsackSolver()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > virtual operations_research::BaseKnapsackSolver::~BaseKnapsackSolver < / td >
< td > (< / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > inline< / span > < span class = "mlabel" > virtual< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2019-06-29 18:18:08 +02:00
< p class = "definition" > Definition at line < a class = "el" href = "knapsack__solver_8h_source.html#l00498" > 498< / a > of file < a class = "el" href = "knapsack__solver_8h_source.html" > knapsack_solver.h< / a > .< / p >
2019-06-26 07:59:17 +02:00
< / div >
< / div >
< h2 class = "groupheader" > Member Function Documentation< / h2 >
< a id = "a08bf62b91f6cf3fca10a504f7dd278a6" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a08bf62b91f6cf3fca10a504f7dd278a6" > ◆ < / a > < / span > best_solution()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > virtual bool operations_research::BaseKnapsackSolver::best_solution < / td >
< td > (< / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > item_id< / em > < / td > < td > )< / td >
< td > const< / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > pure virtual< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Returns true if the item 'item_id' is packed in the optimal knapsack. < / p >
< p > Implemented in < a class = "el" href = "classoperations__research_1_1KnapsackGenericSolver.html#a3f48cb5dfceb3c4129779568d2569606" > operations_research::KnapsackGenericSolver< / a > .< / p >
< / div >
< / div >
< a id = "a381cc9d7b544a8ec4727f9618f0b4f8f" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a381cc9d7b544a8ec4727f9618f0b4f8f" > ◆ < / a > < / span > GetLowerAndUpperBoundWhenItem()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > virtual void operations_research::BaseKnapsackSolver::GetLowerAndUpperBoundWhenItem < / td >
< td > (< / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > item_id< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > bool  < / td >
< td class = "paramname" > < em > is_item_in< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int64 *  < / td >
< td class = "paramname" > < em > lower_bound< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int64 *  < / td >
< td class = "paramname" > < em > upper_bound< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > virtual< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Gets the lower and upper bound when the item is in or out of the knapsack. < / p >
< p > To ensure objects are correctly initialized, this method should not be called before ::Init. < / p >
< p > Reimplemented in < a class = "el" href = "classoperations__research_1_1KnapsackGenericSolver.html#aa49dbbb2b6eae494f521992c964bad53" > operations_research::KnapsackGenericSolver< / a > .< / p >
< / div >
< / div >
< a id = "ae19aff92b4b38e712ead1cfcafd81f03" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ae19aff92b4b38e712ead1cfcafd81f03" > ◆ < / a > < / span > GetName()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > virtual std::string operations_research::BaseKnapsackSolver::GetName < / td >
< td > (< / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > const< / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > inline< / span > < span class = "mlabel" > virtual< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
2019-06-29 18:18:08 +02:00
< p class = "definition" > Definition at line < a class = "el" href = "knapsack__solver_8h_source.html#l00518" > 518< / a > of file < a class = "el" href = "knapsack__solver_8h_source.html" > knapsack_solver.h< / a > .< / p >
2019-06-26 07:59:17 +02:00
< / div >
< / div >
< a id = "a3e8f72facec15537065c1625e647d58b" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a3e8f72facec15537065c1625e647d58b" > ◆ < / a > < / span > Init()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > virtual void operations_research::BaseKnapsackSolver::Init < / td >
< td > (< / td >
< td class = "paramtype" > const std::vector< int64 > &   < / td >
< td class = "paramname" > < em > profits< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const std::vector< std::vector< int64 > > &   < / td >
< td class = "paramname" > < em > weights< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const std::vector< int64 > &   < / td >
< td class = "paramname" > < em > capacities< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > pure virtual< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Initializes the solver and enters the problem to be solved. < / p >
< p > Implemented in < a class = "el" href = "classoperations__research_1_1KnapsackGenericSolver.html#af9635774fd7761f62ee92e64205034b3" > operations_research::KnapsackGenericSolver< / a > .< / p >
< / div >
< / div >
< a id = "a952deb24e032890d2781e52fedb70efa" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a952deb24e032890d2781e52fedb70efa" > ◆ < / a > < / span > Solve()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > virtual int64 operations_research::BaseKnapsackSolver::Solve < / td >
< td > (< / td >
< td class = "paramtype" > TimeLimit *  < / td >
< td class = "paramname" > < em > time_limit< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > bool *  < / td >
< td class = "paramname" > < em > is_solution_optimal< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > pure virtual< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Solves the problem and returns the profit of the optimal solution. < / p >
< p > Implemented in < a class = "el" href = "classoperations__research_1_1KnapsackGenericSolver.html#a8f57ec05930a3df316b5df101c814984" > operations_research::KnapsackGenericSolver< / a > .< / p >
< / div >
< / div >
< hr / > The documentation for this class was generated from the following file:< ul >
< li > < a class = "el" href = "knapsack__solver_8h_source.html" > knapsack_solver.h< / a > < / li >
< / ul >
< / div > <!-- contents -->
< / div >
< div id = "footer-container" >
< div id = "footer" >
< / div >
< / div >
< / body >
< / html >