private float[] ProcessLoadedData(SparseTwinIndex <float[]> loadedData, int types, int times) { var flatLoadedData = loadedData.GetFlatData(); var dataEntries = DataEntries = times * types; var zoneArray = Root.ZoneSystem.ZoneArray; var zones = zoneArray.GetFlatData(); NumberOfZones = zones.Length; var ret = new float[zones.Length * zones.Length * types * times]; Parallel.For(0, flatLoadedData.Length, i => { var flatI = zoneArray.GetFlatIndex(loadedData.GetSparseIndex(i)); for (int j = 0; j < flatLoadedData[i].Length; j++) { if (flatLoadedData[i][j] == null) { continue; } var flatJ = zoneArray.GetFlatIndex(loadedData.GetSparseIndex(i, j)); for (int k = 0; k < flatLoadedData[i][j].Length; k++) { ret[(flatI * zones.Length + flatJ) * dataEntries + k] = flatLoadedData[i][j][k]; } } }); return(ret); }
private float[] ProcessLoadedData(SparseTwinIndex<float[]> loadedData, int types, int times) { var flatLoadedData = loadedData.GetFlatData(); var dataEntries = this.DataEntries = times * types; var zoneArray = this.Root.ZoneSystem.ZoneArray; var zones = zoneArray.GetFlatData(); this.NumberOfZones = zones.Length; var ret = new float[zones.Length * zones.Length * types * times]; Parallel.For( 0, flatLoadedData.Length, (int i) => { var flatI = zoneArray.GetFlatIndex( loadedData.GetSparseIndex( i ) ); for ( int j = 0; j < flatLoadedData[i].Length; j++ ) { if ( flatLoadedData[i][j] == null ) continue; var flatJ = zoneArray.GetFlatIndex( loadedData.GetSparseIndex( i, j ) ); for ( int k = 0; k < flatLoadedData[i][j].Length; k++ ) { ret[( flatI * zones.Length + flatJ ) * dataEntries + k] = flatLoadedData[i][j][k]; } } } ); return ret; }