private FP[, ][] DeserializeWeightTable(SerializableWeightDimentionX table) { int xLength = table.data.Length; if (xLength == 0) { return(new FP[0, 0][]); } int yLength = table.data[0].data.Length; FP[, ][] output = new FP[xLength, yLength][]; for (int x = 0; x < xLength; x++) { for (int y = 0; y < yLength; y++) { output[x, y] = table.data[x].data[y].data; } } return(output); }
private SerializableWeightDimentionX SerializeWeightTable(FP[, ][] table) { int xLength = table.GetLength(0); int yLength = table.GetLength(1); if (xLength == 0) { return(new SerializableWeightDimentionX()); } SerializableWeightDimentionX output = new SerializableWeightDimentionX(); output.data = new SerializableWeightDimentionY[xLength]; for (int x = 0; x < xLength; x++) { output.data[x].data = new SerializableWeightDimentionZ[yLength]; for (int y = 0; y < yLength; y++) { output.data[x].data[y].data = table[x, y]; } } return(output); }