Computes proximity between rows or columns of large matrices efficiently in C++
