A toolkit for working with phylogenetic data.
v0.24.0
utils/containers/matrix/operators.cpp File Reference
#include "genesis/utils/containers/matrix/operators.hpp"
#include <cmath>
#include <iomanip>
#include <stdexcept>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Functions

template<>
std::ostream & operator<< (std::ostream &os, const Matrix< signed char > &matrix)
 Template specialization for signed char, in order to print nicely. More...
 
template<>
std::ostream & operator<< (std::ostream &os, const Matrix< unsigned char > &matrix)
 Template specialization for unsigned char, in order to print nicely. More...
 
template<typename T >
void print_byte_matrix_ (std::ostream &os, const Matrix< T > &matrix, size_t width)
 Local helper function to avoid code duplication. More...
 
size_t triangular_index (size_t i, size_t j, size_t n)
 Given indices i and j in a quadratic Matrix, find the corresponding linear index. More...
 
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. More...
 
size_t triangular_size (size_t n)
 Calculate the number of linear indices needed for a triangular Matrix of size n. More...