|
|
| Criterion_Negative (const PCriterion crit) |
| | Constructs the adapter around crit, the criterion whose evaluate() result is negated.
|
| virtual bool | evaluate (RETURNTYPE &result, const PSubset sub) override |
| | Scores the given feature subset; higher is better (FST4 searches maximize).
|
| virtual std::ostream & | print (std::ostream &os) const override |
| | writes a human-readable identification of the object; base default writes nothing
|
| Criterion< RETURNTYPE, SUBSET > * | clone () const override |
| | dispatches to the DEEP_KIND mechanism (default CLONE_DEEP: Derived's copy-constructor)
|
| Criterion< RETURNTYPE, SUBSET > * | sharing_clone () const override |
| | dispatches to the SHARING_KIND mechanism (default CLONE_INHERIT: defers to Base, which throws by family convention)
|
| Criterion< RETURNTYPE, SUBSET > * | stateless_clone () const override |
| | dispatches to the STATELESS_KIND mechanism (default CLONE_INHERIT: defers to Base, which throws by family convention)
|
| virtual bool | is_monotonic () const |
| Criterion * | sharing_clone () const override |
| Criterion * | stateless_clone () const override |
| bool | is_clone () const |
|
bool | is_sharing () const |
| | true if this instance is a sharing_clone() result (referencing, not owning, the source's structures)
|
|
bool | is_sharing_clone () const |
| | true if this instance is BOTH a clone and sharing – i.e. specifically a sharing_clone() result, not a clone()/stateless_clone() one
|
template<class CRITERION, class RETURNTYPE, class SUBSET>
class FST::Criterion_Negative< CRITERION, RETURNTYPE, SUBSET >
Returns the negative of another Criterion's result.
This trivial criterion can be used to turn maximization to minimization. Useful, e.g., in subset size minimizing scenarios (in conjunction with Criterion_Subset_Size) or in feature acquisition weight minimization scenarios (in conjunction with Criterion_Sum_Of_Weights).
- Note
- is_monotonic() is left at its false default and must stay there: negating a criterion destroys cardinality monotonicity by construction. If the wrapped criterion cannot decrease when a feature is added, the negated one cannot increase - which is the opposite property, and not the one Branch & Bound prunes on. A negated criterion is therefore never a valid Branch & Bound criterion, however monotonic its operand.
- Examples
- demo52t.cpp.