pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::DistanceMatrix Struct Reference

The distances between every pair of n points, condensed. More...

#include <distance_matrix.hpp>

Public Member Functions

std::size_t index (int64_t i, int64_t j) const
 The index in values of the pair (i, j), i != j, in either order.
 
float at (int64_t i, int64_t j) const
 The distance between points i and j; 0 when i == j.
 

Public Attributes

int64_t size = 0
 The number of points, n.
 
std::vector< float > values
 The n (n - 1) / 2 distances, in pdist order, as float32.
 
double error_bound = 0
 A bound on the error of every stored distance: |values[k] - exact| <= error_bound for every pair. "Exact" means the distance between the points as given, or, with center or normalize, as centered and normalized in exact arithmetic.
 
float max_distance = 0
 The largest stored distance.
 

Detailed Description

The distances between every pair of n points, condensed.

Pairs are stored as scipy's pdist stores them, (0, 1), (0, 2), ..., (0, n-1), (1, 2), ..., so a matrix can go to or come from Python unchanged, as RSA's Rdm does.

Member Function Documentation

◆ at()

float pulsatrix::DistanceMatrix::at ( int64_t  i,
int64_t  j 
) const

The distance between points i and j; 0 when i == j.

◆ index()

std::size_t pulsatrix::DistanceMatrix::index ( int64_t  i,
int64_t  j 
) const

The index in values of the pair (i, j), i != j, in either order.

Member Data Documentation

◆ error_bound

double pulsatrix::DistanceMatrix::error_bound = 0

A bound on the error of every stored distance: |values[k] - exact| <= error_bound for every pair. "Exact" means the distance between the points as given, or, with center or normalize, as centered and normalized in exact arithmetic.

Note
It is rigorous, not an estimate, under the standard model of floating-point arithmetic with float32 accumulation in the GEMM (no TF32 or other reduced-precision modes). It covers the dot products, the double-precision arithmetic, the rounding of centered or normalized points to float32, and the final rounding to float32.

◆ max_distance

float pulsatrix::DistanceMatrix::max_distance = 0

The largest stored distance.

◆ size

int64_t pulsatrix::DistanceMatrix::size = 0

The number of points, n.

◆ values

std::vector<float> pulsatrix::DistanceMatrix::values

The n (n - 1) / 2 distances, in pdist order, as float32.


The documentation for this struct was generated from the following file: