A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
placement/pquery/placement.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_PLACEMENT_PQUERY_PLACEMENT_H_
2 #define GENESIS_PLACEMENT_PQUERY_PLACEMENT_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2017 Lucas Czech
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@h-its.org>
23  Exelixis Lab, Heidelberg Institute for Theoretical Studies
24  Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
25 */
26 
34 namespace genesis {
35 
36 // =================================================================================================
37 // Forward Declarations
38 // =================================================================================================
39 
40 namespace tree {
41 
42  class TreeEdge;
43 
44 }
45 
46 namespace placement {
47 
48  using PlacementTreeEdge = tree::TreeEdge;
49 
50  class PlacementEdgeData;
51  class PlacementNodeData;
52  class Pquery;
53 
54 }
55 
56 // =================================================================================================
57 // Pquery Placement
58 // =================================================================================================
59 
60 namespace placement {
61 
74 {
75 public:
76 
77  // -------------------------------------------------------------------
78  // Constructor and Rule of Five
79  // -------------------------------------------------------------------
80 
85  : likelihood(0.0)
86  , like_weight_ratio(0.0)
87  , proximal_length(0.0)
88  , pendant_length(0.0)
89  , parsimony(0)
90  , edge_(nullptr)
91  {}
92 
97  : likelihood(0.0)
98  , like_weight_ratio(0.0)
99  , proximal_length(0.0)
100  , pendant_length(0.0)
101  , parsimony(0)
102  , edge_(&edge)
103  {}
104 
105  ~PqueryPlacement() = default;
106 
107  PqueryPlacement( PqueryPlacement const& ) = default;
108  PqueryPlacement( PqueryPlacement&& ) = default;
109 
110  PqueryPlacement& operator= ( PqueryPlacement const& ) = default;
112 
113  // -------------------------------------------------------------------
114  // Public Property Data Members
115  // -------------------------------------------------------------------
116 
117  // Yes, the following members are public data members. It's neither nice nor consistent,
118  // but makes life so much easier for the moment. Maybe we'll fix that in the future...
119 
125  double likelihood;
126 
138 
156 
166 
173 
174  // -------------------------------------------------------------------
175  // Properties
176  // -------------------------------------------------------------------
177 
178  int edge_num() const;
179 
180  const PlacementTreeEdge& edge() const;
182 
184 
185  // -------------------------------------------------------------------
186  // Data Members
187  // -------------------------------------------------------------------
188 
189 private:
190 
191  PlacementTreeEdge* edge_;
192 };
193 
194 } // namespace placement
195 } // namespace genesis
196 
197 #endif // include guard
double proximal_length
Distance of this placement to the next node towards the root.
const PlacementTreeEdge & edge() const
Get the PlacementTreeEdge where this PqueryPlacement is placed.
Definition: placement.cpp:58
One placement position of a Pquery on a Tree.
PqueryPlacement()
Default constructor. Sets all values to 0.
PqueryPlacement & operator=(PqueryPlacement const &)=default
tree::TreeEdge PlacementTreeEdge
Alias for tree::TreeEdge used in a PlacementTree. See PlacementEdgeData for the data stored on the ed...
PqueryPlacement(PlacementTreeEdge &edge)
Constructor that takes the edge where this placement is being placed at.
void reset_edge(PlacementTreeEdge &edge)
Set the PlacementTreeEdge at which this PqueryPlacement is placed.
Definition: placement.cpp:79
int edge_num() const
Get the edge_num where this PqueryPlacement is placed.
Definition: placement.cpp:50
double pendant_length
Length of the attached branch of this placement.
double like_weight_ratio
Likelihood weight ratio of this placement.
double likelihood
Total likelihood of the tree with this placement attached to it.