|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
61 #pragma omp parallel for
62 for(
size_t k = 0; k < max_k; ++k ) {
66 auto const i = ij.first;
67 auto const j = ij.second;
71 data.
row(i).begin(), data.
row(i).end(),
72 data.
row(j).begin(), data.
row(j).end(),
76 assert( result( i, j ) == 0.0 );
77 assert( result( j, i ) == 0.0 );
78 result( i, j ) = dist;
79 result( j, i ) = dist;
85 for(
size_t i = 0; i < data.
rows() - 1; ++i ) {
88 for(
size_t j = i + 1; j < data.
cols(); ++j ) {
91 data.
row(i).begin(), data.
row(i).end(),
92 data.
row(j).begin(), data.
row(j).end(),
95 result( i, j ) = dist;
96 result( j, i ) = dist;
std::pair< size_t, size_t > triangular_indices(size_t k, size_t n)
Given a linear index in a upper triangular Matrix, find the corresponding Matrix indices.
Matrix< double > manhattan_distance_matrix(Matrix< double > const &data)
Calculate the pairwise manhatten distance matrix between the rows of a given matrix.
Matrix< double > maximum_distance_matrix(Matrix< double > const &data)
Calculate the pairwise maximum distance matrix between the rows of a given matrix.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
MatrixRow< self_type, value_type > row(size_t row)
Matrix< double > p_norm_distance_matrix(Matrix< double > const &data, double p)
Calculate the pairwise distance matrix between the rows of a given matrix.
size_t triangular_size(size_t n)
Calculate the number of linear indices needed for a triangular Matrix of size n.
double p_norm_distance(ForwardIteratorA first_a, ForwardIteratorA last_a, ForwardIteratorB first_b, ForwardIteratorB last_b, double p=2.0)
Calculate the p-norm distance between two (mathematical) vectors.
Matrix< double > euclidean_distance_matrix(Matrix< double > const &data)
Calculate the pairwise euclidean distance matrix between the rows of a given matrix.