class SelectSegment : public feasst::TrialSelectParticle

Select a random segment of a linear chain.

Subclassed by feasst::SelectEndSegment

Public Functions

int max_length() const

Return the maximum length.

bool random_segment_in_particle(const Configuration &config, Select *select, Random *random, const int max_length = -1)

Select all sites between two randomly selected sites in a randomly selected particle in group. Return true if selection is valid

param max_length:

Set the maximum length of the segment. If -1 (default), consider all possible lengths.

bool select(const Select &perturbed, System *system, Random *random)

Perform the selection as implemented in the derived class. Return false if the selection cannot be made. Otherwise, return true.

param perturbed:

Perturbed is included to allow chaining of selection based on previous.


  • max_length : maximum length of selected segment. If -1 (default), then randomly select all possible lengths.

  • TrialSelectParticle arguments.