Memory efficient cdist implementation that performs blockwise operations
scipy cdist uses 64 bit floats (double) which can scratch at the upper
memory end for most machines when number of positions become larger.
E.g. ~4000 residues might for example have 35000 atom positions. That's
Almost 10GB to hold all pairwise distances in 64bit floats. This function
calls cdist blockwise and stores the results in a 32bit float matrix.
This function is adapted from chatgpt output
Definition at line 19 of file lddt.py.