NCBI C++ ToolKit
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
NJ_TreeAlgorithm Class Reference

Search Toolkit Book for NJ_TreeAlgorithm

#include <algo/structure/cd_utils/cuSeqTreeNj.hpp>

+ Inheritance diagram for NJ_TreeAlgorithm:
+ Collaboration diagram for NJ_TreeAlgorithm:

Public Member Functions

 NJ_TreeAlgorithm ()
 
 NJ_TreeAlgorithm (DistanceMatrix *dm)
 
virtual ~NJ_TreeAlgorithm ()
 
virtual long GetNumLoopsForTreeCalc ()
 
virtual void ComputeTree (SeqTree *tree, pProgressFunction pFunc)
 
virtual string toString ()
 
virtual void SetDistMat (DistanceMatrix *dm)
 
- Public Member Functions inherited from TreeAlgorithm
 TreeAlgorithm (Rootedness rooted=DEF_ROOTED, ETreeMethod tmethod=eNoTreeMethod)
 
const SeqTreeGetTree () const
 
string GetName ()
 
ETreeMethod GetTreeMethod ()
 
void SetRootedness (Rootedness rooted)
 
Rootedness GetRootedness ()
 
bool isRooted ()
 
void SetMidpointRooting (bool rooting)
 
bool useMidpointRooting ()
 
virtual ~TreeAlgorithm ()
 
const DistanceMatrixGetDistMat () const
 

Private Member Functions

void initializeNodes ()
 
bool isHub (const TSeqIt &sit)
 
bool isInternal (const TSeqIt &sit)
 
int numChildren (const TSeqIt &sit)
 
void Join (int inode1, int inode2, double len1, double len2)
 

Private Attributes

int m_nseqs
 
int m_nextNode
 
vector< SeqItem * > m_items
 
TTreeIt m_seqiters
 

Static Private Attributes

static const double REPLACE_NEG_DIST = 0.001
 
static const Rootedness MY_ROOTEDNESS = TreeAlgorithm::eUnrooted
 
static const ETreeMethod MY_TREE_METHOD = eNJ
 
static const DistanceMatrix::TMatType INIT_MINIMA = kMax_Double
 
static const int USED_ROW = -1
 
static const int BAD_INDEX = -1
 

Additional Inherited Members

- Public Types inherited from TreeAlgorithm
enum  Rootedness { eUnrooted =0 , eRooted =1 , eMidpointRooted =2 }
 
typedef SeqTree::iterator TSeqIt
 
typedef SeqTree::sibling_iterator TChildIt
 
typedef vector< TSeqItTTreeIt
 
- Protected Member Functions inherited from TreeAlgorithm
void midpointRootIfNeeded ()
 
- Protected Attributes inherited from TreeAlgorithm
SeqTreem_tree
 
DistanceMatrixm_dm
 
Rootedness m_rootedness
 
ETreeMethod m_tmethod
 

Detailed Description

Definition at line 47 of file cuSeqTreeNj.hpp.

Constructor & Destructor Documentation

◆ NJ_TreeAlgorithm() [1/2]

NJ_TreeAlgorithm::NJ_TreeAlgorithm ( )

Definition at line 52 of file cuSeqTreeNj.cpp.

References initializeNodes(), TreeAlgorithm::m_dm, and NULL.

◆ NJ_TreeAlgorithm() [2/2]

NJ_TreeAlgorithm::NJ_TreeAlgorithm ( DistanceMatrix dm)

Definition at line 59 of file cuSeqTreeNj.cpp.

References initializeNodes(), and TreeAlgorithm::m_dm.

◆ ~NJ_TreeAlgorithm()

NJ_TreeAlgorithm::~NJ_TreeAlgorithm ( )
virtual

Definition at line 143 of file cuSeqTreeNj.cpp.

References i, m_items, m_nseqs, and m_seqiters.

Member Function Documentation

◆ ComputeTree()

void NJ_TreeAlgorithm::ComputeTree ( SeqTree tree,
pProgressFunction  pFunc 
)
virtual

◆ GetNumLoopsForTreeCalc()

long NJ_TreeAlgorithm::GetNumLoopsForTreeCalc ( )
virtual

Implements TreeAlgorithm.

Definition at line 202 of file cuSeqTreeNj.cpp.

References i, m_nseqs, and USED_ROW.

Referenced by ComputeTree().

◆ initializeNodes()

void NJ_TreeAlgorithm::initializeNodes ( )
private

◆ isHub()

bool NJ_TreeAlgorithm::isHub ( const TSeqIt sit)
inlineprivate

Definition at line 94 of file cuSeqTreeNj.hpp.

References m_seqiters.

Referenced by isInternal().

◆ isInternal()

bool NJ_TreeAlgorithm::isInternal ( const TSeqIt sit)
inlineprivate

◆ Join()

void NJ_TreeAlgorithm::Join ( int  inode1,
int  inode2,
double  len1,
double  len2 
)
private

◆ numChildren()

int NJ_TreeAlgorithm::numChildren ( const TSeqIt sit)
private

◆ SetDistMat()

void NJ_TreeAlgorithm::SetDistMat ( DistanceMatrix dm)
virtual

Reimplemented from TreeAlgorithm.

Definition at line 67 of file cuSeqTreeNj.cpp.

References initializeNodes(), and TreeAlgorithm::m_dm.

◆ toString()

string NJ_TreeAlgorithm::toString ( )
virtual

Reimplemented from TreeAlgorithm.

Definition at line 481 of file cuSeqTreeNj.cpp.

References TreeAlgorithm::m_tree, and CdTreeStream::toNestedString().

Member Data Documentation

◆ BAD_INDEX

const int NJ_TreeAlgorithm::BAD_INDEX = -1
staticprivate

Definition at line 72 of file cuSeqTreeNj.hpp.

◆ INIT_MINIMA

const DistanceMatrix::TMatType NJ_TreeAlgorithm::INIT_MINIMA = kMax_Double
staticprivate

Definition at line 52 of file cuSeqTreeNj.hpp.

Referenced by ComputeTree().

◆ m_items

vector< SeqItem* > NJ_TreeAlgorithm::m_items
private

Definition at line 86 of file cuSeqTreeNj.hpp.

Referenced by ComputeTree(), initializeNodes(), Join(), and ~NJ_TreeAlgorithm().

◆ m_nextNode

int NJ_TreeAlgorithm::m_nextNode
private

Definition at line 85 of file cuSeqTreeNj.hpp.

Referenced by ComputeTree(), initializeNodes(), and Join().

◆ m_nseqs

int NJ_TreeAlgorithm::m_nseqs
private

◆ m_seqiters

TTreeIt NJ_TreeAlgorithm::m_seqiters
private

Definition at line 87 of file cuSeqTreeNj.hpp.

Referenced by ComputeTree(), initializeNodes(), isHub(), Join(), and ~NJ_TreeAlgorithm().

◆ MY_ROOTEDNESS

const TreeAlgorithm::Rootedness NJ_TreeAlgorithm::MY_ROOTEDNESS = TreeAlgorithm::eUnrooted
staticprivate

Definition at line 50 of file cuSeqTreeNj.hpp.

◆ MY_TREE_METHOD

const ETreeMethod NJ_TreeAlgorithm::MY_TREE_METHOD = eNJ
staticprivate

Definition at line 51 of file cuSeqTreeNj.hpp.

◆ REPLACE_NEG_DIST

const double NJ_TreeAlgorithm::REPLACE_NEG_DIST = 0.001
staticprivate

Definition at line 49 of file cuSeqTreeNj.hpp.

Referenced by ComputeTree().

◆ USED_ROW

const int NJ_TreeAlgorithm::USED_ROW = -1
staticprivate

Definition at line 71 of file cuSeqTreeNj.hpp.

Referenced by ComputeTree(), GetNumLoopsForTreeCalc(), and Join().


The documentation for this class was generated from the following files:
Modified on Fri Apr 12 17:22:50 2024 by modify_doxy.py rev. 669887