bpp-phyl  2.2.0
bpp::BipartitionTools Class Reference

This class provides tools related to the BipartitionList class. More...

#include <Bpp/Phyl/BipartitionTools.h>

Public Member Functions

 BipartitionTools ()
 
virtual ~BipartitionTools ()
 

Static Public Member Functions

static void bit1 (int *list, int num)
 Sets bit number num of bit array list to one. More...
 
static void bit0 (int *list, int num)
 Sets bit number num of bit array plist to zero. More...
 
static void bitAnd (int *listet, int *list1, int *list2, size_t len)
 bit-wise logical AND between two arrays of bits More...
 
static void bitOr (int *listou, int *list1, int *list2, size_t len)
 bit-wise logical OR between two arrays of bits More...
 
static void bitNot (int *listnon, int *list, size_t len)
 bit-wise logical NOT More...
 
static bool testBit (int *list, int num)
 Tells whether bit number num in bit array list is one. More...
 
static BipartitionListmergeBipartitionLists (const std::vector< BipartitionList *> &vecBipartL, bool checkElements=true) throw (Exception)
 Makes one BipartitionList out of several. More...
 
static BipartitionListbuildBipartitionPair (const BipartitionList &bipartL1, size_t i1, const BipartitionList &bipartL2, size_t i2, bool checkElements=true) throw (Exception)
 Construct a BipartitionList containing two bipartitions taken from distinct input lists. More...
 
static bool areIdentical (const BipartitionList &bipart1, size_t i1, const BipartitionList &bipart2, size_t i2, bool checkElements=true)
 Tells whether two bipartitions from distinct lists are identical. More...
 
static bool areCompatible (const BipartitionList &bipart1, size_t i1, const BipartitionList &bipart2, size_t i2, bool checkElements=true)
 Tells whether two bipartitions from distinct lists are compatible. More...
 
static VectorSiteContainer * MRPEncode (const std::vector< BipartitionList *> &vecBipartL) throw (Exception)
 Create a sequence data set corresponding to the Matrix Representation of the input BipartitionList objects. More...
 
static VectorSiteContainer * MRPEncodeMultilabel (const std::vector< BipartitionList *> &vecBipartL) throw (Exception)
 Create a sequence data set corresponding to the Matrix Representation of the input BipartitionList objects and accomodates multilabel trees. More...
 

Static Public Attributes

static int LWORD = static_cast<int>(CHAR_BIT * sizeof(int))
 Unit length (in bits) of arrays of bits. Must be a multiple of CHAR_BIT*sizeof(int). Default value is 64. More...
 

Detailed Description

This class provides tools related to the BipartitionList class.

BipartitionTools includes functions dealing with dynamic arrays of bits and tools for dealing with bipartitions from distinct lists.

See also
Tree
BipartitionList
TreeTools

Definition at line 60 of file BipartitionTools.h.

Constructor & Destructor Documentation

◆ BipartitionTools()

bpp::BipartitionTools::BipartitionTools ( )
inline

Definition at line 72 of file BipartitionTools.h.

◆ ~BipartitionTools()

virtual bpp::BipartitionTools::~BipartitionTools ( )
inlinevirtual

Definition at line 73 of file BipartitionTools.h.

Member Function Documentation

◆ areCompatible()

bool BipartitionTools::areCompatible ( const BipartitionList bipart1,
size_t  i1,
const BipartitionList bipart2,
size_t  i2,
bool  checkElements = true 
)
static

Tells whether two bipartitions from distinct lists are compatible.

Definition at line 192 of file BipartitionTools.cpp.

References bpp::BipartitionList::areCompatible().

◆ areIdentical()

bool BipartitionTools::areIdentical ( const BipartitionList bipart1,
size_t  i1,
const BipartitionList bipart2,
size_t  i2,
bool  checkElements = true 
)
static

Tells whether two bipartitions from distinct lists are identical.

Definition at line 179 of file BipartitionTools.cpp.

References bpp::BipartitionList::areIdentical().

Referenced by bpp::TreeTools::computeBootstrapValues(), bpp::TreeTools::haveSameTopology(), and bpp::TreeTools::robinsonFouldsDistance().

◆ bit0()

void BipartitionTools::bit0 ( int *  list,
int  num 
)
static

Sets bit number num of bit array plist to zero.

Note that no control of memory allocation is made

Definition at line 79 of file BipartitionTools.cpp.

Referenced by bpp::BipartitionList::addBipartition(), bpp::BipartitionList::buildBitBipartitions(), and bpp::BipartitionList::sortElements().

◆ bit1()

void BipartitionTools::bit1 ( int *  list,
int  num 
)
static

Sets bit number num of bit array list to one.

Note that no control of memory allocation is made

Definition at line 70 of file BipartitionTools.cpp.

Referenced by bpp::BipartitionList::addBipartition(), bpp::BipartitionList::buildBitBipartitions(), and bpp::BipartitionList::sortElements().

◆ bitAnd()

void BipartitionTools::bitAnd ( int *  listet,
int *  list1,
int *  list2,
size_t  len 
)
static

bit-wise logical AND between two arrays of bits

(1 AND 1 = 1; 1 AND 0 = 0 AND 1 = 0 AND 0 = 0)

Note that no control of memory allocation is made

param list1 first array of bit param list2 second array of bit param listet resulting array of bit param len number of int over which the operation is performed

Definition at line 88 of file BipartitionTools.cpp.

◆ bitNot()

void BipartitionTools::bitNot ( int *  listnon,
int *  list,
size_t  len 
)
static

bit-wise logical NOT

(NOT 1 = 0; NOT 0 = 1)

Note that no control of memory allocation is made

param list input array of bit param listnot resulting array of bit param len number of int over which the operation is performed

Definition at line 108 of file BipartitionTools.cpp.

Referenced by bpp::BipartitionList::flip().

◆ bitOr()

void BipartitionTools::bitOr ( int *  listou,
int *  list1,
int *  list2,
size_t  len 
)
static

bit-wise logical OR between two arrays of bits

(1 OR 1 = 1 OR 0 = 0 OR 1 = 1; 0 OR 0 = 0)

Note that no control of memory allocation is made

param list1 first array of bit param list2 second array of bit param listou resulting array of bit param len number of int over which the operation is performed

Definition at line 98 of file BipartitionTools.cpp.

Referenced by bpp::BipartitionList::toTree().

◆ buildBipartitionPair()

BipartitionList * BipartitionTools::buildBipartitionPair ( const BipartitionList bipartL1,
size_t  i1,
const BipartitionList bipartL2,
size_t  i2,
bool  checkElements = true 
)
throw (Exception
)
static

Construct a BipartitionList containing two bipartitions taken from distinct input lists.

Definition at line 126 of file BipartitionTools.cpp.

References bpp::BipartitionList::sortElements().

◆ mergeBipartitionLists()

BipartitionList * BipartitionTools::mergeBipartitionLists ( const std::vector< BipartitionList *> &  vecBipartL,
bool  checkElements = true 
)
throw (Exception
)
static

Makes one BipartitionList out of several.

The input BipartitionList objects must share the same set of elements. This will be checked or not depending on checkElements

Definition at line 205 of file BipartitionTools.cpp.

References bpp::BipartitionList::getBitBipartitionList(), LWORD, and bpp::BipartitionList::sortElements().

Referenced by bpp::TreeTools::bipartitionOccurrences().

◆ MRPEncode()

VectorSiteContainer * BipartitionTools::MRPEncode ( const std::vector< BipartitionList *> &  vecBipartL)
throw (Exception
)
static

Create a sequence data set corresponding to the Matrix Representation of the input BipartitionList objects.

The input BipartitionList objects can have distinct sets of elements - missing data will be represented as 'N'. The output alignment (DNA sequences including only A, C and N)) is ready for maximum parsimony analysis according to the MRP supertree method.

Definition at line 266 of file BipartitionTools.cpp.

Referenced by bpp::TreeTools::MRPEncode().

◆ MRPEncodeMultilabel()

VectorSiteContainer * BipartitionTools::MRPEncodeMultilabel ( const std::vector< BipartitionList *> &  vecBipartL)
throw (Exception
)
static

Create a sequence data set corresponding to the Matrix Representation of the input BipartitionList objects and accomodates multilabel trees.

The input BipartitionList objects can have distinct sets of elements - missing data will be represented as 'N'. The output alignment (DNA sequences including only A, C and N)) is ready for maximum parsimony analysis according to the MRP supertree method.

Definition at line 330 of file BipartitionTools.cpp.

Referenced by bpp::TreeTools::MRPEncodeMultilabel().

◆ testBit()

Member Data Documentation

◆ LWORD

int BipartitionTools::LWORD = static_cast<int>(CHAR_BIT * sizeof(int))
static

Unit length (in bits) of arrays of bits. Must be a multiple of CHAR_BIT*sizeof(int). Default value is 64.

Definition at line 69 of file BipartitionTools.h.

Referenced by bpp::BipartitionList::addBipartition(), bpp::BipartitionList::BipartitionList(), bpp::BipartitionList::flip(), mergeBipartitionLists(), bpp::BipartitionList::operator=(), bpp::BipartitionList::sortElements(), and bpp::BipartitionList::toTree().


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