IMP logo
Public Member Functions | Static Public Member Functions
IMP::RestraintSet Class Reference

Detailed Description

Container used to hold a set of restraints.

RestraintSets allow one to define a tree of restraints and to weight various restraints. Upon evaluation, all of the restraints in RestraintSets that have been added to the model are evaluated using the provided weight (weights are multiplicative when RestraintSets are nested).

If the weight is 0, the restraints are not evaluated.

Note:
Restraints can belong to multiple RestraintSets. The total effect is simply one of adding up the weights.
Advanced:

Talk to Daniel if you want to inherit from RestraintSet.

Examples: optimize em2d with montecarlo, dock with crosslinks, analyze convergence, optimize balls

+ Inheritance diagram for IMP::RestraintSet:

List of all members.

Public Member Functions

 RestraintSet (Model *m, double weight, const std::string &name="RestraintSet %1%")
 Create an empty set that is registered with the model.
ContainersTemp get_input_containers () const
ParticlesTemp get_input_particles () const
std::pair< RestraintsTemp,
RestraintSetsTemp > 
get_non_sets_and_sets () const
double unprotected_evaluate (DerivativeAccumulator *accum) const
double unprotected_evaluate_if_below (DerivativeAccumulator *accum, double max) const
double unprotected_evaluate_if_good (DerivativeAccumulator *accum, double max) const
- Public Member Functions inherited from IMP::Restraint
 Restraint (Model *m, std::string name)
Restraintcreate_current_decomposition () const
 Decompose this restraint into constituent terms for the current conf.
Restraintcreate_decomposition () const
 Decompose this restraint into constituent terms.
double evaluate (bool calc_derivs) const
 Return the score for this restraint for the current state of the model.
double evaluate_if_below (bool calc_derivatives, double max) const
 See Model::evaluate_with_maximum()
double evaluate_if_good (bool calc_derivatives) const
 See Model::evaluate_if_good()
double get_last_score () const
bool get_was_good () const
void set_weight (Float weight)
Float get_weight () const
double get_maximum_score () const
void set_maximum_score (double s)
- Public Member Functions inherited from IMP::ModelObject
 ModelObject (Model *m, std::string name)
ModelObjectsTemp get_inputs () const
Modelget_model () const
ModelObjectsTemp get_outputs () const
- Public Member Functions inherited from IMP::base::Object
std::size_t __hash__ () const
virtual std::string get_type_name () const =0
 Return a string identifying the type of the object.
virtual IMP::base::VersionInfo get_version_info () const =0
 Get information about the module and version of the object.
void set_check_level (CheckLevel l)
void set_log_level (LogLevel l)
 Set the logging level used in this object.
void set_was_used (bool tf) const
void show (std::ostream &out=std::cout) const
const std::string & get_name () const
void set_name (std::string name)

Static Public Member Functions

static RestraintSetget_from (IMP::base::Object *o)

Methods to control the nested Restraint objects

This container manages a set of Restraint objects. To manipulate the stored set use the methods below.

void remove_restraint (Restraint *d)
template<class F >
void remove_restraints_if (const F &f)
template<class List >
void remove_restraints (List d)
template<class List >
void set_restraints (List ps)
template<class List >
void set_restraints_order (List ps)
unsigned int add_restraint (Restraint *obj)
template<class List >
void add_restraints (List objs)
void clear_restraints ()
unsigned int get_number_of_restraints () const
bool get_has_restraints () const
Restraintget_restraint (unsigned int i) const
Restraints get_restraints () const
void reserve_restraints (unsigned int sz)
RestraintIterator restraints_begin ()
RestraintIterator restraints_end ()
RestraintConstIterator restraints_begin () const
RestraintConstIterator restraints_end () const

Additional Inherited Members

- Protected Member Functions inherited from IMP::Restraint
virtual Restraints do_create_current_decomposition () const
virtual Restraints do_create_decomposition () const
- Protected Member Functions inherited from IMP::ModelObject
virtual ModelObjectsTemp do_get_inputs () const =0
virtual ModelObjectsTemp do_get_outputs () const =0
virtual void do_update_dependencies (const DependencyGraph &, const DependencyGraphVertexIndex &)
void update_dependencies (const DependencyGraph &dg, const DependencyGraphVertexIndex &index)
- Protected Member Functions inherited from IMP::base::Object
 Object (std::string name)

Constructor & Destructor Documentation

IMP::RestraintSet::RestraintSet ( Model m,
double  weight,
const std::string &  name = "RestraintSet %1%" 
)

Create an empty set that is registered with the model.


Member Function Documentation

std::pair<RestraintsTemp, RestraintSetsTemp> IMP::RestraintSet::get_non_sets_and_sets ( ) const

Divide the list of contained restraints into sets and non-sets.

double IMP::RestraintSet::unprotected_evaluate ( DerivativeAccumulator ) const
virtual

Return the unweighted score for the restraint.

Implements IMP::Restraint.

double IMP::RestraintSet::unprotected_evaluate_if_below ( DerivativeAccumulator da,
double  max 
) const
virtual

The function calling this will treat any score >= max as bad.

Reimplemented from IMP::Restraint.

double IMP::RestraintSet::unprotected_evaluate_if_good ( DerivativeAccumulator da,
double  max 
) const
virtual

The function calling this will treat any score >= get_maximum_score as bad and so can return early as soon as such a situation is found.

Reimplemented from IMP::Restraint.


The documentation for this class was generated from the following file:

Generated on Tue May 22 2012 23:33:24 for IMP by doxygen 1.8.1