public bool Transfer(Rossi rap, RossiAlphaResult rar) { if (rar == null) { return(true); } bool res = true; try { RossiAlphaResultExt ra = new RossiAlphaResultExt(rar.gateWidth, rar.gateData); // deep copy via constructor menas no extra transfer function is needed countresults.Add(rap, ra); } catch (OutOfMemoryException e) { rap.reason = "Rossi transfer " + e.Message; res = false; logger?.TraceEvent(LogLevels.Error, 87408, rap.reason); } return(res); }
public bool Transfer(Rossi rap, RossiAlphaResult rar) { if (rar == null) return true; bool res = true; try { RossiAlphaResultExt ra = new RossiAlphaResultExt(rar.gateWidth, rar.gateData); // deep copy via constructor menas no extra transfer function is needed countresults.Add(rap, ra); } catch (OutOfMemoryException e) { rap.reason = "Rossi transfer " + e.Message; res = false; logger.TraceEvent(LogLevels.Error, 87408, rap.reason); } return res; }
Row GenRossiParamsRow(RossiAlphaResultExt rar, Cycle c = null) { Row row = new Row(); int shift = 0; if (c != null) { row.Add(0, c.seq.ToString()); shift = 1; } row.Add((int)Rossi.GateWidth + shift, rar.gateWidth.ToString()); row.Add((int)Rossi.Numgates + shift, rar.gateData.Length.ToString()); return row; }
Row[] GenRossiRows(RossiAlphaResultExt rar, Cycle c = null) { Row[] rows = new Row[2]; rows[0] = GenRossiParamsRow(rar, c); rows[1] = GenRossiDataRow(rar, c); return rows; }
// print only up to the last non-zero entry, later use the Feynman X,Y dual row technique for this compression attempt Row GenRossiDataRow(RossiAlphaResultExt rar, Cycle c = null) { Row row = new Row(); int shift = 0; if (c != null) { row.Add(0, c.seq.ToString()); shift = 1; } int maxindex = rar.gateData.Length - 1; int i = 0; for (i = rar.gateData.Length - 1; i >= 0; i--) { if (rar.gateData[i] > 0) { maxindex = i; break; } } //happy dad! if (i == 0) // rolled all the way to the start ofthe array and found all 0s, empty bins! { maxindex = 0; // not 1000 and not -1 } for (i = 0; i <= maxindex; i++) { row.Add(i + shift, rar.gateData[i].ToString()); } return row; }