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 | |
| ~chromosome () | |
| chromosome & | operator= (const chromosome &ch) |
| assignment operator | |
| void | swap_with (chromosome &ch) |
| void | assign_allocated_segs (segment *newsegs, const int &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 90 of file SimTypes.hpp.
| Sequence::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 62 of file CoalescentSimTypes.cc.
| Sequence::chromosome::~chromosome | ( | ) |
frees pointer to segments
Definition at line 78 of file CoalescentSimTypes.cc.
| void Sequence::chromosome::assign_allocated_segs | ( | segment * | newsegs, | |
| const int & | 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 130 of file CoalescentSimTypes.cc.
| chromosome::const_iterator Sequence::chromosome::begin | ( | ) | const |
Definition at line 159 of file CoalescentSimTypes.cc.
| chromosome::iterator Sequence::chromosome::begin | ( | ) |
Definition at line 143 of file CoalescentSimTypes.cc.
| chromosome::const_iterator Sequence::chromosome::end | ( | ) | const |
Definition at line 167 of file CoalescentSimTypes.cc.
| chromosome::iterator Sequence::chromosome::end | ( | ) |
Definition at line 151 of file CoalescentSimTypes.cc.
| int Sequence::chromosome::first | ( | ) | const [inline] |
Definition at line 123 of file SimTypes.hpp.
| int Sequence::chromosome::last | ( | ) | const [inline] |
Definition at line 132 of file SimTypes.hpp.
| int Sequence::chromosome::links | ( | ) | const |
Computes and returns the number of positions at which recombination can occur in the chromosome
Definition at line 175 of file CoalescentSimTypes.cc.
| void Sequence::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 114 of file CoalescentSimTypes.cc.
| unsigned Sequence::chromosome::nsegs |
The number of segments contained in the pointer segs
Definition at line 113 of file SimTypes.hpp.
the population in which the chromosome is currently found
Definition at line 109 of file SimTypes.hpp.
The list of segments making up the ancestral material of a chromosome at the current point in the simulation.
Definition at line 103 of file SimTypes.hpp.
1.6.3