void UpdateProcrustesDistances(params ProcrustedDataset[] p)
{
// Create the procrustes distance matrix
ProcrustesDistances = new double[p.Length, p.Length];
for (int i = 0; i < ProcrustesDistances.GetLength(0); i++)
{
ProcrustesDistances[i, i] = 0;
}
// Compute the distances for one corner of the matrix (this is a symmetric matrix)
for (int i = 0; i < ProcrustesDistances.GetLength(0); i++)
{
for (int j = 0; j <= i; j++)
{
if (i != j)
{
// Calculate the Procrusted distance
ProcrustesDistances[i, j] = ProcrustesDistance(p[i].Dataset, p[j].Dataset);
// The other corner of the matrix is the same as the other corner
ProcrustesDistances[j, i] = ProcrustesDistances[i, j];
}
}
}
}