asardaes / dtwclust

R Package for Time Series Clustering Along with Optimizations for DTW
https://cran.r-project.org/package=dtwclust
GNU General Public License v3.0
252 stars 29 forks source link

Support distmat as lower triangular for PAM #77

Closed asardaes closed 3 weeks ago

asardaes commented 1 month ago

Up until now, all the proxy::dist wrappers included in this package returned complete matrices regardless of the values of their input parameters. When discussing the space requirements for a cross-distance matrix, the dominant factor is the numerator in n² / 2, but when it comes to real use cases in current hardware, that half can be significant in terms of required RAM. Therefore, I've updated the code so that distances that can result in symmetric matrices can be handled with only the lower triangular values, but strictly speaking this will be a breaking change with respect to previous versions.

Documentation has been updated, in particular to mention the DistmatLowerTriangular reference class that can help in some common scenarios.