vocabtree  0.0.1
numerics.cxx File Reference
#include "numerics.hpp"
Include dependency graph for numerics.cxx:

Go to the source code of this file.

Namespaces

namespace  numerics
 Provides useful wrappers around many numerical functionality, such as dealing with sparse and dense matrix / vector data.
 

Functions

std::vector< std::pair
< uint32_t, float > > 
numerics::sparsify (const cv::Mat &dense)
 Converts the input 1D cv::Mat to a sparse format, where each pair in the vector is index, value. More...
 
float numerics::cos_sim (const std::vector< std::pair< uint32_t, float > > &weights0, const std::vector< std::pair< uint32_t, float > > &weights1, const std::vector< float > &idfw)
 Converts the cosine similarity between two sparse weight vectors, which are premultiplied by the relevant entries in idfw. More...
 
float numerics::min_hist (const std::vector< std::pair< uint32_t, float > > &weights0, const std::vector< std::pair< uint32_t, float > > &weights1, const std::vector< float > &idfw)
 Converts the histogram intersection (min) between two sparse weight vectors, which are premultiplied by the relevant entries in idfw. More...