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

Data table. More...

#include <DataMatrix.hpp>

Inheritance diagram for DataMatrix:
CharMatrix

Public Member Functions

 DataMatrix ()
 Default constructor. More...
 
 DataMatrix (unsigned int numberOfSequences, unsigned int numberOfSites)
 Standard constructor. More...
 
 DataMatrix (const DataMatrix &)
 Copy constructor. More...
 
 DataMatrix (const CharMatrix &)
 Copy constructor. More...
 
virtual DataMatrixoperator= (const DataMatrix &)
 Assignment operator. More...
 
virtual DataMatrixoperator= (const CharMatrix &)
 Assignment operator. More...
 
virtual ~DataMatrix ()
 Destructor. More...
 
unsigned int numberOfSites () const
 Gets number of sites. More...
 
unsigned int numberOfSequences () const
 Gets number of sequences. More...
 
void set (unsigned int sequence, unsigned int site, int value)
 Sets a value of the data table. More...
 
int get (unsigned int sequence, unsigned int site) const
 Gets a value from the data table. More...
 
int fget (unsigned int sequence, unsigned int site) const
 Faster and unsecure version of get. More...
 
void sitePosition (unsigned int site, double value)
 Sets the position of a site. More...
 
double sitePosition (unsigned int site) const
 Gets the position of a site. More...
 
void populationLabel (unsigned int sequence, unsigned int value)
 Sets the group label of a sequence. More...
 
unsigned int populationLabel (unsigned int sequence) const
 Gets the group label of a sequence. More...
 
void clear ()
 Removes all information from the object. More...
 
void resize (unsigned int newNumberOfSequences, unsigned int newNumberOfSites)
 Resizes the data matrix. More...
 
void shift (int minimum)
 Shifts allele value. More...
 
char character (unsigned int sequence, unsigned int site) const
 Gets the character at a given position. More...
 

Detailed Description

Data table.

Holds a data matrix representing genotype data from simulations. Data are stored as integers, to each site is associated a position, and to each sequence is associated a group index (any integer labelling, for example, a subpopulation). Supports the CharMatrix interface with the condition that allele genotype datum is >=0 and <=9.

Constructor & Destructor Documentation

Default constructor.

The data table default dimensions are {0,0}

DataMatrix ( unsigned int  numberOfSequences,
unsigned int  numberOfSites 
)

Standard constructor.

The data table dimensions must be given. Each cell default default is 0, and each site position is 0..

Parameters
numberOfSequencesnumber of lines of the data table.
numberOfSitesnumber of columns of the data table.
DataMatrix ( const DataMatrix source)

Copy constructor.

DataMatrix ( const CharMatrix source)

Copy constructor.

~DataMatrix ( )
virtual

Destructor.

Member Function Documentation

char character ( unsigned int  sequence,
unsigned int  site 
) const
virtual

Gets the character at a given position.

An exception is generated if the allele value at this position is not >=0 and <=9. Not out-of-bound check is performed.

Implements CharMatrix.

void clear ( )

Removes all information from the object.

int fget ( unsigned int  sequence,
unsigned int  site 
) const
inline

Faster and unsecure version of get.

int get ( unsigned int  sequence,
unsigned int  site 
) const

Gets a value from the data table.

unsigned int numberOfSequences ( ) const
virtual

Gets number of sequences.

Implements CharMatrix.

unsigned int numberOfSites ( ) const
virtual

Gets number of sites.

Implements CharMatrix.

DataMatrix & operator= ( const DataMatrix source)
virtual

Assignment operator.

DataMatrix & operator= ( const CharMatrix source)
virtual

Assignment operator.

void populationLabel ( unsigned int  sequence,
unsigned int  value 
)

Sets the group label of a sequence.

unsigned int populationLabel ( unsigned int  sequence) const
virtual

Gets the group label of a sequence.

Implements CharMatrix.

void resize ( unsigned int  newNumberOfSequences,
unsigned int  newNumberOfSites 
)

Resizes the data matrix.

Parameters
newNumberOfSequencesnumber of sequences (rows)
newNumberOfSitesnumber of sites (columns)

If new values are larger, data already set is left unchanged. New data are set to zero.

void set ( unsigned int  sequence,
unsigned int  site,
int  value 
)

Sets a value of the data table.

void shift ( int  minimum)

Shifts allele value.

Parameters
minimumthe minimum allele value.

Shifts all alleles at all sites to ensure that alleles alleles are equal to or larger than minimum. The shifting is specific to each site.

void sitePosition ( unsigned int  site,
double  value 
)

Sets the position of a site.

double sitePosition ( unsigned int  site) const
virtual

Gets the position of a site.

Implements CharMatrix.


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