lower2upper.tri.inds is the same as lower.to.upper.tri.inds
from package cluster. It computes an index vector for extracting or reordering a lower
triangular matrix that is stored as a contiguous vectors.
diag.off returns a vector of off-diagonal elements of a matrix.
off specifies the distance above the main (0) diagonal.
clus2memship converts a list whose ith element contains the indices
of objects in the ith cluster into a vector whose ith
element gives the cluster number of the ith object.
memship2clus converts a vector whose ith
element gives the cluster number of the ith object into a list
whose ith element contains the indices
of objects in the ith cluster.