public static float[][] BinaryStringToMatrix(int rows, int cols, string encoded, int subStart) { float[][] matrix = MatrixUtils.CreateMatrix2D(rows, cols); for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { int substringStart = (i * cols + j) * 32 + subStart; matrix[i][j] = BinaryStringToFloat(encoded, substringStart, 32); } } return(matrix); }
public static float[][] BinaryStringToMatrix(int rows, int cols, string encoded) { string[] parts = StringUtils.WholeChunks(encoded, 32); float[][] matrix = MatrixUtils.CreateMatrix2D(rows, cols); for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { matrix[i][j] = BinaryStringToFloat(parts[i * cols + j]); } } return(matrix); }