static double[] toDoubleArray(float[] arr) {
		  if (arr == null) return null;
		  int n = arr.length;
		  double[] ret = new double[n];
		  for (int i = 0; i < n; i++) {
		    ret[i] = (double)arr[i];
		  }
		  return ret;
		}