vash
Fast genetic similarity estimation with hash tables
Loading...
Searching...
No Matches
similarityMatrix.hpp File Reference

Similarity matrix. More...

#include <vector>
#include <array>
#include <string>
#include <cstdint>
#include <cstddef>
Include dependency graph for similarityMatrix.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BayesicSpace::RowColIdx
 Row and column index pair. More...
 
struct  BayesicSpace::FullIdxValue
 Full vectorized index and similarity value. More...
 
struct  BayesicSpace::JaccardPair
 Pair of integers to calculate Jaccard similarity. More...
 
class  BayesicSpace::SimilarityMatrix
 Similarity matrix. More...
 

Functions

void BayesicSpace::chunkedAppend (std::vector< uint64_t > &source, std::vector< uint64_t > &target)
 Append one vector to another by chunks.
 
RowColIdx BayesicSpace::recoverRCindexes (const uint64_t &vecIdx) noexcept
 Recover row and column indexes.
 

Detailed Description

Similarity matrix.

Author
Anthony J. Greenberg
Version
0.1

Definitions and interface documentation for a compact representation of a (possibly sparse) similarity matrix.

Function Documentation

◆ chunkedAppend()

void BayesicSpace::chunkedAppend ( std::vector< uint64_t > & source,
std::vector< uint64_t > & target )

Append one vector to another by chunks.

Moves the contents of the source vector to the end of the target vector. Uses \( \sqrt{N} \), where \( N \) is the size of the source vector, extra memory. The source vector is cleared.

Parameters
[in]sourcethe source vector, is cleared as a result
[in,out]targetthe vector accepting the data from source

◆ recoverRCindexes()

RowColIdx BayesicSpace::recoverRCindexes ( const uint64_t & vecIdx)
noexcept

Recover row and column indexes.

Recovers the row and column indexes from the matrix element.

Parameters
[in]vecIdxindex into the vectorized matrix
Returns
row and column index pair