PAMSIL is described in the following publication:

M.J. van der Laan, K.S. Pollard, J. Bryan (2003). A new partitioning 
around medoids algorithm.  revised for Journal of Statistical Computation 
and Simulation, 73(8), pp. 575-584.

The algorithm is a modification of Partitioning Around Medoids (PAM), 
described by Kaufman and Rousseeuw (1990), where the criteria function
is now the average silhouette.  

The input is a text file with the following:

 K should be an int.  It tells PAM how many clusters (medoids) to make.

 n should be an int.  It tells PAM how many objects to cluster.

 dys is an array of dissimilarities and it MUST have a very specific
 form.  First imagine the d by d matrix of all pairwise
 dissimilarities.  Color in with black the lower triangle, because
 it is redundant with the upper triangle.  Color in the diagonal,
 except for the very first element, because they are all zeros.  
 Now read what's left *column by column* into an array of doubles.
 Here it is graphically:

 0  a  b  c  d     0  a  b  c  d     0  a  b  c  d
 a  0  e  f  g     x  0  e  f  g     x  x  e  f  g
 b  e  0  h  i --> x  x  0  h  i --> x  x  x  h  i
 c  f  h  0  j     x  x  x  0  j     x  x  x  x  j
 d  g  i  j  0     x  x  x  x  0     x  x  x  x  x

 --> 0 a b e c f h d g i j

So, the total input file is:

k n 0 a b e c f h d g i j

Then you run PAMSIL like this:

PAMSIL < inputfile > outputfile
