Implements Sequential_Forward_Retreating_Search and Sequential_Backward_Retreating_Search. More...
#include <search_seq_sfrs.hpp>
Classes | |
struct | OneSubset |
Structure to hold [subset,criterion value] temporary solutions in the course of search. More... | |
Public Types | |
typedef Search_Sequential < RETURNTYPE, DIMTYPE, SUBSET, CRITERION, EVALUATOR > | parent |
typedef parent::parent | grandparent |
typedef boost::shared_ptr < EVALUATOR > | PEvaluator |
typedef boost::shared_ptr < CRITERION > | PCriterion |
typedef boost::shared_ptr< SUBSET > | PSubset |
Public Member Functions | |
Search_SFRS (const PEvaluator evaluator) | |
virtual bool | search (const DIMTYPE target_d, RETURNTYPE &result, const PSubset sub, const PCriterion crit, std::ostream &os=std::cout) |
returns found subset + criterion value | |
void | set_search_direction (const SearchDirection direction) |
true=SFS, false=SBS (do not change concurrently to running search()) | |
SearchDirection | get_search_direction () const |
void | set_delta (const DIMTYPE delta) |
optional parameter to restrict search extent | |
DIMTYPE | get_delta () const |
bool | get_result (const DIMTYPE d, RETURNTYPE &result, PSubset &sub) |
retrieves temporary solution of cardinality d that had been updated in the course of the last search (if it exists) | |
virtual std::ostream & | print (std::ostream &os) const |
Protected Attributes | |
SearchDirection | _direction |
DIMTYPE | _delta |
boost::scoped_array< OneSubset > | bsubs |
DIMTYPE | _n |
bsubs array size | |
boost::scoped_ptr< SUBSET > | pivotsub |
Note: this has different meaning than in DOS, the DOS pivotsub is called maxcritsub here. | |
boost::scoped_ptr< SUBSET > | maxcritsub |
stores the subset with maximum known crit value |
Implements Sequential_Forward_Retreating_Search and Sequential_Backward_Retreating_Search.
demo20.cpp, and demo52t.cpp.
SearchDirection FST::Search_SFRS< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, EVALUATOR >::_direction [protected] |
accepted values FORWARD for SFRS or BACKWARD for SBRS
Referenced by FST::Search_SFRS< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, EVALUATOR >::search(), and FST::Search_SFRS< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, EVALUATOR >::set_search_direction().