List of utility methods to do Float Array Create
float[] | toFloatArray(Float[] data) Converts an Float array to an float array
float[] result = new float[data.length]; for (int p = 0; p < data.length; p++) result[p] = data[p]; return result; |
float[] | toFloatArray(Number[] array) Turns the Number array into one consisting of primitive floats. float[] result; int i; result = new float[array.length]; for (i = 0; i < array.length; i++) result[i] = array[i].floatValue(); return result; |
float[] | toFloatArray(Object[] arr) to Float Array float[] arr2 = new float[arr.length]; for (int i = 0; i < arr.length; i++) { arr2[i] = Float.parseFloat(String.valueOf(arr[i])); return arr2; |
float[] | toFloatArray(String str, String separator) Convert a string of reals to a float array. String[] fields = str.split(separator); float[] tmp = new float[fields.length]; for (int i = 0; i < tmp.length; i++) tmp[i] = Float.parseFloat(fields[i]); return tmp; |
float[] | toFloatArray(String text, String delim) to Float Array String[] list = text.split(delim); float[] ret_ary = new float[list.length]; for (int k = 0; k < list.length; ++k) { ret_ary[k] = Float.parseFloat(list[k]); return ret_ary; |
float[] | toFloatArray(String[] anArray) to Float Array float[] output = new float[anArray.length]; for (int index = 0; index < anArray.length; index++) output[index] = Float.parseFloat(anArray[index]); return output; |
float[][] | toFloatArrays(double[][] arrays) to Float Arrays float[][] res = new float[arrays.length][]; for (int i = 0; i < arrays.length; i++) { res[i] = toFloatArray(arrays[i]); return res; |
Float | toFloatByObject(Object obj) to Float By Object try { return Float.valueOf(toStringByObject(obj, true)); } catch (Exception e) { return 0.0f; |
float[][] | toFloatMatrix(int[][] m) to Float Matrix float[][] re = new float[m.length][]; for (int i = 0; i < re.length; i++) re[i] = toFloat(m[i]); return re; |
int | toFloatRawBits(int i) Converts the raw bits of a 16-bit half float to the raw bits of a 32-bit float. int s = (i >> 15) & 0x1; int e = (i >> 10) & 0x1f; int m = i & 0x3ff; if (e == 0) { if (m == 0) { return s << 31; } else { while ((m & 0x400) == 0) { ... |