FocusingProtocol

class FocusingProtocol

Abstract type representing a protocol for the focusing procedure, i.e. a way to produce successive values for the quantities γ, n_rep and β. Currently, however, only β=Inf is supported. To be provided as an argument to focusingBP.

Available protocols are: StandardReinforcement, Scoping, PseudoReinforcement and FreeScoping

Public Functions

FocusingProtocol()

Default constructor.

FocusingProtocol(const std::string &prot, const long int &size)

Constructor with protocol type and number of replicas.

Protocol types are set with default values. If you want introduce other values you must use appropriated protocol functions

Parameters
  • prot: protocol type. Available protocols are: StandardReinforcement, Scoping, PseudoReinforcement and FreeScoping. This value is used to switch between the available protocols and the corresponding arrays are stored.
  • size: number of step. Converted to Nrep into the class

~FocusingProtocol()

Destructor set as default.

void StandardReinforcement(const double *rho, const long int &Nrho)

Standard reinforcement protocol, returns γ=Inf and n_rep=1/(1-x), where x is taken from the given range ρ.

Parameters
  • rho: double pointer which store the range values of x
  • Nrho: number of step. Converted to Nrep into the class

void StandardReinforcement(const double &drho)

Shorthand for Standard reinforcement protocol.

Parameters
  • drho: double related to the range increment

void Scoping(const double *gr, const double &x, const long int &ngr)

Focusing protocol with fixed n_rep and a varying γ taken from the given γ * r range.

Parameters
  • gr: double pointer with γ * r values
  • x: fixed value of n_rep
  • ngr: number of replicas

void PseudoReinforcement(const double *rho, const long int &nrho, double x = .5)

A focusing protocol in which both γ and n_rep are progressively increased, according to the formulas.

γ = atanh(ρ**x)
n_rep = 1 + ρ**(1 - 2x) / (1 - ρ)

where ρ is taken from the given range(ngr) r. With x=0, this is basically the same as StandardReinforcement.

Parameters
  • rho: double pointer with ρ values
  • nrho: lenght of rho array
  • x: fixed value of n_rep

void PseudoReinforcement(const double &drho, double x = .5)

Shorthand for Pseudo Reinforcement protocol.

Parameters
  • drho: double related to the range increment
  • x: fixed value of n_rep

void FreeScoping(double **list, const long int &nlist)

A focusing protocol which just returns the values of (γ, n_rep) from the given list.

Parameters
  • list: array of lists (nlist, 3) with values
  • nlist: lenght of list

Public Members

long int Nrep

Number of repetitions, i.e. number of focusing iterations.

std::unique_ptr<double[]> gamma

Distance parameters.

std::unique_ptr<double[]> n_rep

Number of replicas (y in the paper and original code)

std::unique_ptr<double[]> beta

1/kT (it must be infinite in the current implementation)