public static void writeSortedFirstDim(float[][] matrix,String fn) throws IOException {
  BufferedWriter outBuf=new BufferedWriter(new FileWriter(fn));
  ArrayList<Float> firsts=new ArrayList<>();
  for (int row=0; row < matrix.length; ++row) {
    firsts.add(matrix[row][0]);
  }
  Collections.sort(firsts);
  for (  Float num : firsts) {
    outBuf.write(String.format("%f\n",num));
  }
  outBuf.close();
}

public static void writeSortedFirstDim ( float [ ] [ ] matrix , String fn ) throws IOException { BufferedWriter outBuf = new BufferedWriter ( new FileWriter ( fn ) ) ; ArrayList < Float > firsts = new ArrayList < > ( ) ; for ( int row = 0 ; row < matrix . length ; ++ row ) { firsts . add ( matrix [ row ] [ 0 ] ) ; } Collections . sort ( firsts ) ; for ( Float num : firsts ) { outBuf . write ( String . format ( "%f\n" , num ) ) ; } outBuf . close ( ) ; }
writes the first column of the matrix to a file . this is particular for an experiment on convergence .
