Efficient hierarchical clustering for continuous data