Egglib 2.1.11
C++ library reference manual
Public Member Functions | List of all members
Population Class Reference

Handles a single population. More...

#include <Population.hpp>

Public Member Functions

 Population ()
 Default constructor. More...
 
 Population (const Population &source)
 Copy constructor. More...
 
Populationoperator= (const Population &source)
 Assignment operator. More...
 
 ~Population ()
 Destructor. More...
 
 Population (unsigned int numberOfSegments, unsigned int numberOfLineages, unsigned firstIndex)
 Standard constructor. More...
 
unsigned int numberOfLineages () const
 Gets the number of lineages. More...
 
unsigned int efficientNumberOfLineages () const
 Gets the efficient number of lineages. More...
 
void set (unsigned int index, Edge *edge)
 Sets the Edge of a lineage. More...
 
EdgeextractRandomly (Random *random)
 Removes and returns a random lineage. More...
 
EdgeextractByIndex (unsigned int index)
 Removes and returns a given lineage. More...
 
void push (Edge *edge)
 Appends a lineage to the object. More...
 
unsigned int coverage (unsigned int edgeIndex) const
 Gets coverage. More...
 

Detailed Description

Handles a single population.

Constructor & Destructor Documentation

Default constructor.

Generates an empty population.

Population ( const Population source)

Copy constructor.

~Population ( )

Destructor.

The object only cleans Edge objects currently stored in it.

Population ( unsigned int  numberOfSegments,
unsigned int  numberOfLineages,
unsigned  firstIndex 
)

Standard constructor.

The Edge instances will be handled by address and they MUST be passed using the method set().

Parameters
numberOfSegmentsnumber of recombining segments.
numberOfLineagesthe number of lineages contained in this population.
firstIndexthe absolute index (or ID) of the first lineage (the other will have consecutive incremented ID's).

Member Function Documentation

unsigned int coverage ( unsigned int  edgeIndex) const

Gets coverage.

unsigned int efficientNumberOfLineages ( ) const

Gets the efficient number of lineages.

The number of lineages is multiplied by the number of covered segments of each lineages.

Edge * extractByIndex ( unsigned int  index)

Removes and returns a given lineage.

Parameters
indexthe relative index of the lineage.
Edge * extractRandomly ( Random random)

Removes and returns a random lineage.

Parameters
randompointer to simulator's random generator instance.
unsigned int numberOfLineages ( ) const

Gets the number of lineages.

Population & operator= ( const Population source)

Assignment operator.

void push ( Edge edge)

Appends a lineage to the object.

void set ( unsigned int  index,
Edge edge 
)

Sets the Edge of a lineage.

Parameters
indexthe index of the lineage within the population.
edgethe address of the Edge instance representing the lineage.

The documentation for this class was generated from the following files:

Hosted by 
Get EggLib at SourceForge.net. Fast, secure and Free Open Source software downloads