Public Member Functions | |
void | add_edge (unsigned int node1_ind, unsigned int node2_ind) |
Creates an undirected edge between two nodes. | |
void | add_node (unsigned int node_index, Particles &particles, RestraintEvaluatorI *rstr_eval) |
Creates a new node and add it to the graph. | |
void | analyse (std::ostream &out=std::cout) const |
void | clear () |
CombState * | get_minimum_configuration () const |
Float | get_minimum_score () const |
JNode * | get_node (const Particles &p) |
const CombState * | get_opt_combination (unsigned int i) const |
Get the i'th best combination. | |
Particles | get_particles () const |
Get the particles that are associated to the graph nodes. | |
void | infer (unsigned int num_of_solutions=1) |
Find the top solutions. | |
void | initialize_graph (int number_of_nodes) |
Initialize the graph. | |
void | initialize_potentials (Restraint *r, Particles *ps, Float weight) |
Initalize potentials according to the input restraint set. | |
bool | is_sampling_space_set () const |
Float | move_to_configuration (const CombState &comb) const |
Move particles to the input combination and return its score. | |
void | move_to_global_minimum_configuration () const |
Move particles to the the global minimum combination. | |
unsigned int | number_of_edges () const |
unsigned int | number_of_nodes () const |
RestraintGraph (const JunctionTree &jt, Model *mdl, RestraintEvaluatorI *r_eval) | |
Constructor. | |
void | set_sampling_space (DiscreteSampler &ds) |
void | show (std::ostream &out=std::cout) const |
Show the restraint graph. | |
void | show_sampling_space (std::ostream &out=std::cout) const |
Protected Types | |
typedef boost::graph_traits < Graph >::edge_descriptor | Edge |
typedef boost::graph_traits < Graph >::vertex_descriptor | Vertex |
Protected Member Functions | |
void | clear_infered_data () |
unsigned int | collect_evidence (unsigned int father_ind) |
void | dfs_order (unsigned int root_ind) |
Determine a DFS. | |
void | distribute_evidence (unsigned int father_ind) |
void | distribute_minimum (unsigned int father_ind, CombState *min_comb) |
Recursive Distribution of minimum state. | |
JEdge * | get_edge (unsigned int n1, unsigned int n2) const |
Pair | get_edge_key (unsigned int node1_ind, unsigned int node2_ind) const |
void | load_data (const JunctionTree &jt, Model *mdl, RestraintEvaluatorI *r_eval) |
Load junction tree and set the restraint graph. | |
void | update (unsigned int w, unsigned int v) |
Updates node with index w based on the evidence in the node with index v. | |
Protected Attributes | |
std::vector< unsigned int > | discover_time_ |
std::map< Pair, JEdge * > | edge_data_ |
Graph | g_ |
bool | infered_ |
std::vector< CombState * > * | min_combs_ |
std::vector< int > | node2particle |
std::vector< JNode * > | node_data_ |
std::map< int, int > | particle2node |
unsigned int | root_ |
bool | sampling_space_set_ |
IMP::domino::RestraintGraph::RestraintGraph | ( | const JunctionTree & | jt, | |
Model * | mdl, | |||
RestraintEvaluatorI * | r_eval | |||
) |
Constructor.
[in] | jt | Holds the junction tree that represent the system dependencies |
[in] | mdl | The IMP model |
[in] | r_eval | evaluator used to evaluate the restraints |
void IMP::domino::RestraintGraph::add_edge | ( | unsigned int | node1_ind, | |
unsigned int | node2_ind | |||
) |
Creates an undirected edge between two nodes.
[in] | node1_ind | the index of the first node |
[in] | node2_ind | the index of the second node |
void IMP::domino::RestraintGraph::add_node | ( | unsigned int | node_index, | |
Particles & | particles, | |||
RestraintEvaluatorI * | rstr_eval | |||
) |
Creates a new node and add it to the graph.
[in] | node_index | the index of the node |
[in] | particles | the particles that are part of the node |
[in] | rstr_eval | evaluator used to evaluate the restraints |
void IMP::domino::RestraintGraph::analyse | ( | std::ostream & | out = std::cout |
) | const |
Prints the value of each restraint encoded in the graph for a state of the global minimum
unsigned int IMP::domino::RestraintGraph::collect_evidence | ( | unsigned int | father_ind | ) | [protected] |
Recursive Collect Evidence, father is the cluster that invoked CollectEvidence
[in] | father_ind | the index of the node to start collecting from |
void IMP::domino::RestraintGraph::dfs_order | ( | unsigned int | root_ind | ) | [protected] |
Determine a DFS.
[in] | root_ind | the index of the node from which the DFS starts Stores the discover order of the nodes. discover_time[i] is the discover time in the DFS of node with index i. |
void IMP::domino::RestraintGraph::distribute_evidence | ( | unsigned int | father_ind | ) | [protected] |
Recursive Distribution of evidence. father is the cluster that invoked distribute_evidence
[in] | father_ind | the index of the node to start collecting from |
void IMP::domino::RestraintGraph::distribute_minimum | ( | unsigned int | father_ind, | |
CombState * | min_comb | |||
) | [protected] |
Recursive Distribution of minimum state.
[in] | father_ind | the index of the node to start the min_dist from |
[in] | min_comb | the minimum combination so far. Each child node will add the states of its particles. |
[in] | p | the set of particles |
IMP | exception if none of the graph nodes contain the given set of particles. |
const CombState* IMP::domino::RestraintGraph::get_opt_combination | ( | unsigned int | i | ) | const |
Get the i'th best combination.
[in] | i | the i'th best combination |
if | no combinations have been infered or if i is out of range. |
Particles IMP::domino::RestraintGraph::get_particles | ( | ) | const |
Get the particles that are associated to the graph nodes.
void IMP::domino::RestraintGraph::infer | ( | unsigned int | num_of_solutions = 1 |
) |
Find the top solutions.
/param[in] num_of_solutions the number of top solutions to report
void IMP::domino::RestraintGraph::initialize_graph | ( | int | number_of_nodes | ) |
Initialize the graph.
[in] | number_of_nodes | the number of nodes |
void IMP::domino::RestraintGraph::initialize_potentials | ( | Restraint * | r, | |
Particles * | ps, | |||
Float | weight | |||
) |
Initalize potentials according to the input restraint set.
[in] | r | the restraint |
[in] | ps | the particles participate in the restraint at the hierarhcy level encoded in the graph |
[in] | weight | the weight of the restraint |
void IMP::domino::RestraintGraph::load_data | ( | const JunctionTree & | jt, | |
Model * | mdl, | |||
RestraintEvaluatorI * | r_eval | |||
) | [protected] |
Load junction tree and set the restraint graph.
[in] | jt | contains the junction tree data |
[in] | mdl | The model that contains the particles |
[in] | r_eval | Evaluator to be used to evaluate the restraints |
void IMP::domino::RestraintGraph::show_sampling_space | ( | std::ostream & | out = std::cout |
) | const |
Sets the optimizable attributes of the optimizable components to the values that build the minimum of the scoring function when the state of the root of the junction tree is of a spcific index.