bpp-phyl3
3.0.0
|
This class provides tools related to the BipartitionList class. More...
#include <Bpp/Phyl/Tree/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 std::unique_ptr< BipartitionList > | mergeBipartitionLists (const std::vector< std::unique_ptr< BipartitionList >> &vecBipartL, bool checkElements=true) |
Makes one BipartitionList out of several. More... | |
static std::unique_ptr< BipartitionList > | buildBipartitionPair (const BipartitionList &bipartL1, size_t i1, const BipartitionList &bipartL2, size_t i2, bool checkElements=true) |
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 std::unique_ptr< VectorSiteContainer > | MRPEncode (const std::vector< std::unique_ptr< BipartitionList >> &vecBipartL) |
Create a sequence data set corresponding to the Matrix Representation of the input BipartitionList objects. More... | |
static std::unique_ptr< VectorSiteContainer > | MRPEncodeMultilabel (const std::vector< std::unique_ptr< BipartitionList >> &vecBipartL) |
Create a sequence data set corresponding to the Matrix Representation of the input BipartitionList objects and accommodates 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... | |
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.
Definition at line 26 of file BipartitionTools.h.
|
inline |
Definition at line 38 of file BipartitionTools.h.
|
inlinevirtual |
Definition at line 39 of file BipartitionTools.h.
|
static |
Tells whether two bipartitions from distinct lists are compatible.
Definition at line 155 of file BipartitionTools.cpp.
|
static |
Tells whether two bipartitions from distinct lists are identical.
Definition at line 144 of file BipartitionTools.cpp.
Referenced by bpp::TreeTools::computeBootstrapValues(), bpp::TreeTools::haveSameTopology(), and bpp::TreeTools::robinsonFouldsDistance().
|
static |
Sets bit number num of bit array plist to zero.
Note that no control of memory allocation is made
Definition at line 45 of file BipartitionTools.cpp.
Referenced by bpp::BipartitionList::addBipartition(), bpp::BipartitionList::buildBitBipartitions(), and bpp::BipartitionList::sortElements().
|
static |
Sets bit number num of bit array list to one.
Note that no control of memory allocation is made
Definition at line 36 of file BipartitionTools.cpp.
Referenced by bpp::BipartitionList::addBipartition(), bpp::BipartitionList::buildBitBipartitions(), and bpp::BipartitionList::sortElements().
|
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 54 of file BipartitionTools.cpp.
|
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 74 of file BipartitionTools.cpp.
Referenced by bpp::BipartitionList::flip().
|
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 64 of file BipartitionTools.cpp.
Referenced by bpp::BipartitionList::toTree().
|
static |
Construct a BipartitionList containing two bipartitions taken from distinct input lists.
Definition at line 92 of file BipartitionTools.cpp.
References bpp::BipartitionList::getBitBipartitionList(), bpp::BipartitionList::getElementNames(), bpp::BipartitionList::getNumberOfBipartitions(), bpp::VectorTools::haveSameElements(), bpp::BipartitionList::isSorted(), and bpp::BipartitionList::sortElements().
|
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 166 of file BipartitionTools.cpp.
References bpp::BipartitionList::getBitBipartitionList(), bpp::VectorTools::haveSameElements(), LWORD, and bpp::BipartitionList::sortElements().
Referenced by bpp::TreeTools::bipartitionOccurrences().
|
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 227 of file BipartitionTools.cpp.
References bpp::VectorTools::contains(), bpp::AlphabetTools::DNA_ALPHABET, bpp::MapTools::getKeys(), and bpp::VectorTools::vectorUnion().
Referenced by bpp::TreeTools::MRPEncode().
|
static |
Create a sequence data set corresponding to the Matrix Representation of the input BipartitionList objects and accommodates 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 286 of file BipartitionTools.cpp.
References bpp::VectorTools::contains(), bpp::AlphabetTools::DNA_ALPHABET, element, bpp::MapTools::getKeys(), bpp::VectorTools::vectorIntersection(), and bpp::VectorTools::vectorUnion().
Referenced by bpp::TreeTools::MRPEncodeMultilabel().
|
static |
Tells whether bit number num in bit array list is one.
Definition at line 83 of file BipartitionTools.cpp.
Referenced by bpp::BipartitionList::areCompatible(), bpp::BipartitionList::areIdentical(), bpp::BipartitionList::containsBipartition(), bpp::BipartitionList::getBipartition(), bpp::BipartitionList::getPartitionSize(), bpp::BipartitionList::sortElements(), and bpp::BipartitionList::toTree().
|
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 35 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().