private static HowLong[] GenerateSequenceFromClusteredData(int[] clustering, long[] time) { ArrayList seqence = new ArrayList(); HowLong hl = null; for (int a = 0; a < time.Length; a++) { if (hl == null) { hl = new HowLong(); hl.claster = clustering[a]; //hl.time = time[a]; seqence.Add(hl); } if (hl.claster != clustering[a]) { hl = new HowLong(); hl.claster = clustering[a]; seqence.Add(hl); hl.time += time[a]; } else { hl.time += time[a]; } } HowLong[] hla = new HowLong[seqence.Count]; for (int a = 0; a < hla.Length; a++) { hla[a] = (HowLong)seqence[a]; } return(hla); }
private static HowLong[] GenerateSequenceFromRawData(int[] clustering, long[] time) { ArrayList seqence = new ArrayList(); HowLong hl = null; long firstTime = 0; for (int a = 0; a < time.Length; a++) { if (hl == null) { if (clustering[a] != -1) { hl = new HowLong(); hl.claster = clustering[a]; //hl.time = time[a]; hl.time = firstTime; seqence.Add(hl); } else { firstTime += time[a]; } } else { if (hl.claster != clustering[a]) { if (clustering[a] != -1) { hl = new HowLong(); hl.claster = clustering[a]; seqence.Add(hl); } } hl.time += time[a]; /*if (hl.claster != clustering[a]) * { * if (clustering[a] != -1) * { * hl = new HowLong(); * hl.claster = clustering[a]; * seqence.Add(hl); * } * hl.time += time[a]; * } * else * { * hl.time += time[a]; * }*/ } } HowLong[] hla = new HowLong[seqence.Count]; for (int a = 0; a < hla.Length; a++) { hla[a] = (HowLong)seqence[a]; } return(hla); }