libsequence
1.9.5
|
A chromosome is a container of segments. More...
#include <Sequence/Coalescent/SimTypes.hpp>
Public Types | |
typedef segment * | iterator |
typedef const segment * | const_iterator |
Public Member Functions | |
chromosome () | |
constructor sets segs to NULL, pop to 0, and nsegs to 0 | |
chromosome (const chromosome &ch) | |
copy constructor | |
chromosome (const std::vector< segment > &initial_segs, const int &population=0) | |
constructor More... | |
~chromosome () | |
chromosome & | operator= (const chromosome &ch) |
assignment operator | |
void | swap_with (chromosome &ch) |
void | assign_allocated_segs (segment *newsegs, const unsigned &new_nsegs) |
int | first () const |
int | last () const |
int | links () const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Public Attributes | |
segment * | segs |
int | pop |
unsigned | nsegs |
A chromosome is a container of segments.
Definition at line 92 of file SimTypes.hpp.
Sequence::coalsim::chromosome::chromosome | ( | const std::vector< segment > & | initial_segs, |
const int & | population = 0 |
||
) |
constructor
initial_segs | a vector of segments |
population | used to set pop |
Definition at line 63 of file CoalescentSimTypes.cc.
Sequence::coalsim::chromosome::~chromosome | ( | ) |
frees pointer to segments
Definition at line 79 of file CoalescentSimTypes.cc.
void Sequence::coalsim::chromosome::assign_allocated_segs | ( | segment * | newsegs, |
const unsigned & | new_nsegs | ||
) |
Replaces the current segs with those pointed to by newsegs
newsegs | an array of segments allocated with malloc |
new_nsegs | the number of segs stored in newsegs |
Definition at line 133 of file CoalescentSimTypes.cc.
chromosome::iterator Sequence::coalsim::chromosome::begin | ( | ) |
Definition at line 146 of file CoalescentSimTypes.cc.
chromosome::const_iterator Sequence::coalsim::chromosome::begin | ( | ) | const |
Definition at line 162 of file CoalescentSimTypes.cc.
chromosome::iterator Sequence::coalsim::chromosome::end | ( | ) |
Definition at line 154 of file CoalescentSimTypes.cc.
chromosome::const_iterator Sequence::coalsim::chromosome::end | ( | ) | const |
Definition at line 170 of file CoalescentSimTypes.cc.
|
inline |
Definition at line 125 of file SimTypes.hpp.
|
inline |
Definition at line 134 of file SimTypes.hpp.
int Sequence::coalsim::chromosome::links | ( | ) | const |
Computes and returns the number of positions at which recombination can occur in the chromosome
Definition at line 178 of file CoalescentSimTypes.cc.
void Sequence::coalsim::chromosome::swap_with | ( | chromosome & | ch | ) |
Swaps the data members of the current chromosome with chromosome ch. Called by the coalesce routine, and is necessary to prevent nastiness such as multiple calls to free when vectors of chromosomes go out of scope. Implemented as: std::swap(this->segs,ch.segs); std::swap(this->nsegs,ch.nsegs); std::swap(this->pop,ch.pop);
Definition at line 117 of file CoalescentSimTypes.cc.
unsigned Sequence::coalsim::chromosome::nsegs |
The number of segments contained in the pointer segs
Definition at line 115 of file SimTypes.hpp.
int Sequence::coalsim::chromosome::pop |
the population in which the chromosome is currently found
Definition at line 111 of file SimTypes.hpp.
segment* Sequence::coalsim::chromosome::segs |
The list of segments making up the ancestral material of a chromosome at the current point in the simulation.
Definition at line 105 of file SimTypes.hpp.