Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_WL_Data_Structure_MS< Conformation, Move_Set_Controller, Bin_properties_, DS_Snapshot_ > Class Template Reference

This class specializes its internal counterpart to record additional info used by move sets. More...

#include <WL_data_structure.hpp>

Classes

class  DS_Interface
 
class  Initial_Parameters
 

Public Types

typedef T_WL_Data_Structure_MS< Conformation, Move_Set_Controller, Bin_properties_, DS_Snapshot_ > Self
 
typedef T_WL_Data_Structure_Internal< Conformation, Bin_properties_< typename Move_Set_Controller::Move_Set_Controller_Data >, DS_Snapshot_ > Base
 
using Bin_Properties = Bin_properties_< typename Move_Set_Controller::Move_Set_Controller_Data >
 
typedef Base::DS_conformation DS_conformation
 
using DS_Snapshot = typename Base::DS_snapshot
 
typedef Base::Snapshot_ptr Snapshot_ptr
 
using DS_snapshot = T_DS_snapshot_default< T_Bin_properties< Move_Set_Controller::Move_Set_Controller_Data > >
 

Public Member Functions

 T_WL_Data_Structure_MS ()
 
 T_WL_Data_Structure_MS (Initial_Parameters parameters)
 
virtual Snapshot_ptr create_snapshot ()
 
void update_histogram (const DS_conformation &newpt, const DS_conformation &oldpt, const bool &accepted, const bool &boundary_check, auto &move_stats, Move_Set_Controller &controller)
 
void split_bin (const Bin_index &bin)
 
virtual Snapshot_ptr update_increment ()
 update_increment is called after new points have been generated and accepted(or not) in the WL algo. it updates the increment by which the (log) density is increased when a new point is generated in a given bin. More...
 
virtual void reset_increment ()
 
void update_densities (const Bin_index &index)
 update_densities updates the density vector when a new point is sampled by the WL algorithm. More...
 
virtual void display_state ()
 
std::pair< bool, Snapshot_ptrenergy_out_of_range (const DS_conformation &conf)
 energy_out_of_range is called when a point is sampled in a not already existing bin. It should handle the creation of a new bin if supported. This should be modified to initialize Custom_per_bin_stats at propers values if needed. More...
 
void update_histogram (const DS_conformation &newpt, const DS_conformation &oldpt, const bool &accepted, const bool &boundary_check)
 update_histogram is called when a new point is sampled. It should be used to store some statistics on how the algorithm is working, which might be later used in update_parameters() More...
 
double & get_density (const Bin_index &index)
 get_density returns the density of a point More...
 
Bin_index get_bin_index_from_energy (const double &e)
 get_bin_index_from_energy finds the bin containing the energy e More...
 
Bin_index get_bin_index_from_energy (const double &e, const double &e1, const Bin_index &i1)
 get_bin_index_from_energy should uses that the point previously sampled should be in a bin close to the new newly sampled point More...
 
bool is_energy_in_range (const DS_conformation &conf)
 is_energy_in_range checks if a Bin_index is valid. More...
 
bool is_bin_index_valid (Bin_index index)
 
unsigned int get_number_of_bins ()
 
virtual void restore_state (const DS_snapshot *snap)
 
Initial_Parameters get_params () const
 

Public Attributes

std::vector< decltype(get_conf_data_type())> pos_list
 
Initial_Parameters mParams_adaptive
 
std::vector< Bin_energy_rangebin_ranges
 
std::vector< T_Bin_properties< Move_Set_Controller::Move_Set_Controller_Data > > bin_properties
 
double increment
 
int gamma_index
 
uint64_t num_steps
 
bool exp_regime
 
std::vector< std::pair< uint64_t, uint64_t > > climbs
 
std::vector< std::pair< uint64_t, uint64_t > > descents
 
bool is_climbing
 
bool is_descending
 

Protected Member Functions

virtual void reset_histogram (Move_Set_Controller &controller)
 
double gamma (unsigned int n)
 
void reset_gamma ()
 
void update_density (double &density)
 
double get_gamma ()
 
double get_gamma_index ()
 
virtual void reset_histogram ()
 
virtual std::list< Bin_energy_rangeget_new_bins_ranges (const double &energy)
 
Bin_index add_bin (Bin_energy_range bin)
 add_bin is a helper function which add a bin to the bin vector/ properties vector More...
 
virtual bool flat_hist () const
 

Protected Attributes

Initial_Parameters mParams
 
double averageInterbinSize
 
uint64_t h_tot
 

Detailed Description

template<class Conformation, class Move_Set_Controller, template< class > class Bin_properties_ = T_Bin_properties, template< class > class DS_Snapshot_ = T_DS_snapshot_default>
class SBL::GT::T_WL_Data_Structure_MS< Conformation, Move_Set_Controller, Bin_properties_, DS_Snapshot_ >

This class specializes its internal counterpart to record additional info used by move sets.


Class Documentation

◆ SBL::GT::T_WL_Data_Structure_MS::Initial_Parameters

class SBL::GT::T_WL_Data_Structure_MS::Initial_Parameters

template<class Conformation, class Move_Set_Controller, template< class > class Bin_properties_ = T_Bin_properties, template< class > class DS_Snapshot_ = T_DS_snapshot_default>
class SBL::GT::T_WL_Data_Structure_MS< Conformation, Move_Set_Controller, Bin_properties_, DS_Snapshot_ >::Initial_Parameters

Class Members
typedef Flat_Histogram_Policy Flat_Histogram_Policy
typedef One_Over_t_Policy One_Over_t_Policy
Class Members
Initial_Parameters base_ds_params
bool integrate_function
function< double(const DS_conformation &x)> integration_function
int position_save_frequency

Member Typedef Documentation

◆ Base

typedef T_WL_Data_Structure_Internal<Conformation,Bin_properties_<typename Move_Set_Controller::Move_Set_Controller_Data>,DS_Snapshot_> Base

◆ Bin_Properties

using Bin_Properties = Bin_properties_<typename Move_Set_Controller::Move_Set_Controller_Data>

◆ DS_conformation

◆ DS_Snapshot

using DS_Snapshot = typename Base::DS_snapshot

◆ DS_snapshot

using DS_snapshot = T_DS_snapshot_default <T_Bin_properties< Move_Set_Controller::Move_Set_Controller_Data > >
inherited

◆ Self

typedef T_WL_Data_Structure_MS<Conformation,Move_Set_Controller,Bin_properties_,DS_Snapshot_> Self

◆ Snapshot_ptr

Constructor & Destructor Documentation

◆ T_WL_Data_Structure_MS() [1/2]

◆ T_WL_Data_Structure_MS() [2/2]

Member Function Documentation

◆ add_bin()

Bin_index add_bin ( Bin_energy_range  bin)
inlineprotectedinherited

add_bin is a helper function which add a bin to the bin vector/ properties vector

Parameters
bin
Returns

◆ create_snapshot()

◆ display_state()

virtual void display_state ( )
inlinevirtualinherited

◆ energy_out_of_range()

std::pair<bool,Snapshot_ptr> energy_out_of_range ( const DS_conformation conf)
inlineinherited

energy_out_of_range is called when a point is sampled in a not already existing bin. It should handle the creation of a new bin if supported. This should be modified to initialize Custom_per_bin_stats at propers values if needed.

Parameters
conf
Returns
false is returned if this case is not supported. WL algorithm should then quit gracefully.

◆ flat_hist()

virtual bool flat_hist ( ) const
inlineprotectedvirtualinherited

◆ gamma()

double gamma ( unsigned int  n)
inlineprotectedinherited

◆ get_bin_index_from_energy() [1/2]

Bin_index get_bin_index_from_energy ( const double &  e)
inlineinherited

get_bin_index_from_energy finds the bin containing the energy e

Parameters
e
Returns
return a Bin_index describing the bin contatining energy e. If no bin contains e, an invalid bin is returned (here -1)

◆ get_bin_index_from_energy() [2/2]

Bin_index get_bin_index_from_energy ( const double &  e,
const double &  e1,
const Bin_index i1 
)
inlineinherited

get_bin_index_from_energy should uses that the point previously sampled should be in a bin close to the new newly sampled point

Parameters
enew energy
e1previous energy
i1previous bin
Returns

◆ get_density()

double& get_density ( const Bin_index index)
inlineinherited

get_density returns the density of a point

Parameters
index
Returns

◆ get_gamma()

double get_gamma ( )
inlineprotectedinherited

◆ get_gamma_index()

double get_gamma_index ( )
inlineprotectedinherited

◆ get_new_bins_ranges()

virtual std::list<Bin_energy_range> get_new_bins_ranges ( const double &  energy)
inlineprotectedvirtualinherited

◆ get_number_of_bins()

unsigned int get_number_of_bins ( )
inlineinherited

◆ get_params()

Initial_Parameters get_params ( ) const
inlineinherited

◆ is_bin_index_valid()

bool is_bin_index_valid ( Bin_index  index)
inlineinherited

◆ is_energy_in_range()

bool is_energy_in_range ( const DS_conformation conf)
inlineinherited

is_energy_in_range checks if a Bin_index is valid.

Parameters
conf
Returns

◆ reset_gamma()

void reset_gamma ( )
inlineprotectedinherited

◆ reset_histogram() [1/2]

virtual void reset_histogram ( )
inlineprotectedvirtualinherited

◆ reset_histogram() [2/2]

virtual void reset_histogram ( Move_Set_Controller &  controller)
inlineprotectedvirtual

◆ reset_increment()

virtual void reset_increment ( )
inlinevirtualinherited

◆ restore_state()

virtual void restore_state ( const DS_snapshot snap)
inlinevirtualinherited

◆ split_bin()

void split_bin ( const Bin_index bin)
inline

◆ update_densities()

void update_densities ( const Bin_index index)
inlineinherited

update_densities updates the density vector when a new point is sampled by the WL algorithm.

Parameters
index

◆ update_density()

void update_density ( double &  density)
inlineprotectedinherited

◆ update_histogram() [1/2]

void update_histogram ( const DS_conformation newpt,
const DS_conformation oldpt,
const bool &  accepted,
const bool &  boundary_check 
)
inlineinherited

update_histogram is called when a new point is sampled. It should be used to store some statistics on how the algorithm is working, which might be later used in update_parameters()

Parameters
oldptprevious point in the algorithm
newptpoint sampled by the Point_generator
acceptedis the new point accepted after the metropolis test
boundary_checkis the result of the boundary check

◆ update_histogram() [2/2]

void update_histogram ( const DS_conformation newpt,
const DS_conformation oldpt,
const bool &  accepted,
const bool &  boundary_check,
auto &  move_stats,
Move_Set_Controller &  controller 
)
inline

◆ update_increment()

virtual Snapshot_ptr update_increment ( )
inlinevirtualinherited

update_increment is called after new points have been generated and accepted(or not) in the WL algo. it updates the increment by which the (log) density is increased when a new point is generated in a given bin.

Member Data Documentation

◆ averageInterbinSize

double averageInterbinSize
protectedinherited

◆ bin_properties

std::vector<T_Bin_properties< Move_Set_Controller::Move_Set_Controller_Data > > bin_properties
inherited

◆ bin_ranges

std::vector<Bin_energy_range> bin_ranges
inherited

◆ climbs

std::vector<std::pair<uint64_t,uint64_t> > climbs
inherited

◆ descents

std::vector<std::pair<uint64_t,uint64_t> > descents
inherited

◆ exp_regime

bool exp_regime
inherited

◆ gamma_index

int gamma_index
inherited

◆ h_tot

uint64_t h_tot
protectedinherited

◆ increment

double increment
inherited

◆ is_climbing

bool is_climbing
inherited

◆ is_descending

bool is_descending
inherited

◆ mParams

Initial_Parameters mParams
protectedinherited

◆ mParams_adaptive

Initial_Parameters mParams_adaptive

◆ num_steps

uint64_t num_steps
inherited

◆ pos_list

std::vector<decltype(get_conf_data_type())> pos_list