A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
measures.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_PLACEMENT_FUNCTION_MEASURES_H_
2 #define GENESIS_PLACEMENT_FUNCTION_MEASURES_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2018 Lucas Czech and HITS gGmbH
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 
35 
36 #include <cstddef>
37 #include <utility>
38 #include <vector>
39 
40 namespace genesis {
41 
42 // =================================================================================================
43 // Forward Declarations
44 // =================================================================================================
45 
46 namespace placement {
47 
48  class Sample;
49  class SampleSet;
50  class PlacementTreeEdgeData;
51  class PlacementTreeNodeData;
52  class Pquery;
53  class PqueryPlacement;
54  struct PqueryPlain;
55 
56 }
57 
58 namespace utils {
59 
60  template<typename T>
61  class Matrix;
62 
63  class Histogram;
64 
65 }
66 
67 namespace placement {
68 
69 // =================================================================================================
70 // Expected Distance between Placement Locations
71 // =================================================================================================
72 
83 double edpl( Pquery const& pquery, utils::Matrix<double> const& node_distances );
84 
91 std::vector<double> edpl( Sample const& sample, utils::Matrix<double> const& node_distances );
92 
101 double edpl( Sample const& sample, Pquery const& pquery );
102 
109 std::vector<double> edpl( Sample const& sample );
110 
111 // =================================================================================================
112 // Pairwise Distance
113 // =================================================================================================
114 
129 double pairwise_distance (
130  const Sample& smp_a,
131  const Sample& smp_b,
132  bool with_pendant_length = false
133 );
134 
135 // double closest_pair_distance (
136 // const Sample& smp_a,
137 // const Sample& smp_b,
138 // bool with_pendant_length = false
139 // );
140 
141 // =================================================================================================
142 // Variance
143 // =================================================================================================
144 
169 double variance (
170  const Sample& smp,
171  bool with_pendant_length = false
172 );
173 
174 } // namespace placement
175 } // namespace genesis
176 
177 #endif // include guard
double pairwise_distance(const Sample &smp_a, const Sample &smp_b, bool with_pendant_length)
Calculate the normalized pairwise distance between all placements of the two Samples.
Definition: measures.cpp:130
double edpl(Pquery const &pquery, utils::Matrix< double > const &node_distances)
Calculate the EDPL uncertainty values for a Pquery.
Definition: measures.cpp:78
double variance(const Sample &smp, bool with_pendant_length)
Calculate the variance of the placements on a tree.
Definition: measures.cpp:228