Here is a version that should compile. (I don't have one of the classes you are using.) But you will get some errors about loss of precision.
There were many errors in this. I suggest you use an
IDE for syntax checking such as Eclipse. You were missing matching parens, brackets, semicolons, you mis capilized and misspelled some of your variable names.
------------------------------
public class Clusteringclass {
distances dist = new distances();
double theRow = 1;
double theCoulmn =0;
double newRow = 1;
public Clusteringclass(){
dist.getMatrix();
}
private void obtainClusters(double distanceMatrix[][])
{
for (int i=0;i<distanceMatrix.length; ++i){
for (int all = 1; all<distanceMatrix.length; ++all){
for (double checkDistanceVal = 100; (checkDistanceVal > distanceMatrix[i][all]) && (distanceMatrix[i][all] !=0)
{
checkDistanceVal = distanceMatrix[i][all];/*This will hold the final value ie, the value with the smallest distance.*/
double row = i;
double column = all;/*These assignments ensure that the corresponding row and column numbers are stored for the
shortest value.*/
}
}
}
}
public double[][] addElement(double[][] distanceMatrix, double row, double column ){
double[][] newArray = new double [distanceMatrix.length - 1][distanceMatrix.length - 1];/*Creates a brand new array of greater
length*/
for ( int i = 0; i < distanceMatrix.length; i++){
System.out.println (i+"\n");
if (i != row && i != column){/*As long as the element of distance matrix being covered is not*/
newArray[i - 1] = distanceMatrix[i];/*Assigns elements of the distance matrix to the new Array. use -1 because obviously
the array size will decrease since the rows that are of the shortest distance will be amalgamated into 1. */
}
}
for (int i = 0; i < distanceMatrix.length; ++i){
newArray[row][column] = Math.min(distanceMatrix [row][i], distanceMatrix [column][i]);
/*Puts the minimum value into the new array at the beginning.*/
++newRow;
/*Only increment the row value because going to input the new values downwards. */
}
distanceMatrix = newArray;
return distanceMatrix;
}
}