internal static Dictionary <string, Dictionary <string, Dictionary <string, RelativeEffectivenessEstimate> > > GetSystemSystemQueryRelatives( Dictionary <string, Dictionary <string, Run> > sqRuns, IMeasure measure, IRelevanceEstimator relEstimator, IConfidenceEstimator confEstimator) { Dictionary <string, Dictionary <string, Dictionary <string, RelativeEffectivenessEstimate> > > ssqRelEstimates = new Dictionary <string, Dictionary <string, Dictionary <string, RelativeEffectivenessEstimate> > >(); // [sysA [sysB [query rel]]] string[] allSystems = sqRuns.Keys.ToArray(); Parallel.For(0, allSystems.Length - 1, i => { string sysA = allSystems[i]; var runsA = sqRuns[sysA]; Dictionary <string, Dictionary <string, RelativeEffectivenessEstimate> > sqRelEstimates = new Dictionary <string, Dictionary <string, RelativeEffectivenessEstimate> >(); for (int j = i + 1; j < allSystems.Length; j++) { Dictionary <string, RelativeEffectivenessEstimate> qRelEstimates = new Dictionary <string, RelativeEffectivenessEstimate>(); string sysB = allSystems[j]; var runsB = sqRuns[sysB]; foreach (var qRun in runsA) { qRelEstimates.Add(qRun.Key, measure.Estimate(qRun.Value, runsB[qRun.Key], relEstimator, confEstimator)); } sqRelEstimates.Add(sysB, qRelEstimates); } lock (ssqRelEstimates) { ssqRelEstimates.Add(sysA, sqRelEstimates); } }); //for (int i = 0; i < allSystems.Length - 1; i++) { // string sysA = allSystems[i]; // var runsA = sqRuns[sysA]; // Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>> sqRelEstimates = new Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>>(); // for (int j = i + 1; j < allSystems.Length; j++) { // Dictionary<string, RelativeEffectivenessEstimate> qRelEstimates = new Dictionary<string, RelativeEffectivenessEstimate>(); // string sysB = allSystems[j]; // var runsB = sqRuns[sysB]; // foreach (var qRun in runsA) { // qRelEstimates.Add(qRun.Key, measure.Estimate(qRun.Value, runsB[qRun.Key], relEstimator, confEstimator)); // } // sqRelEstimates.Add(sysB, qRelEstimates); // } // ssqRelEstimates.Add(sysA, sqRelEstimates); //} return(ssqRelEstimates); }
internal static Dictionary <string, Dictionary <string, AbsoluteEffectivenessEstimate> > GetSystemQueryAbsolutes( Dictionary <string, Dictionary <string, Run> > sqRuns, IMeasure measure, IRelevanceEstimator relEstimator, IConfidenceEstimator confEstimator) { Dictionary <string, Dictionary <string, AbsoluteEffectivenessEstimate> > sqAbss = new Dictionary <string, Dictionary <string, AbsoluteEffectivenessEstimate> >(); foreach (var sqRun in sqRuns) { Dictionary <string, AbsoluteEffectivenessEstimate> qAbs = new Dictionary <string, AbsoluteEffectivenessEstimate>(); foreach (var qRun in sqRun.Value) { qAbs.Add(qRun.Key, measure.Estimate(qRun.Value, relEstimator, confEstimator)); } sqAbss.Add(sqRun.Key, qAbs); } return(sqAbss); }
internal static Dictionary<string, Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>>> GetSystemSystemQueryRelatives( Dictionary<string, Dictionary<string, Run>> sqRuns, IMeasure measure, IRelevanceEstimator relEstimator, IConfidenceEstimator confEstimator) { Dictionary<string, Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>>> ssqRelEstimates = new Dictionary<string, Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>>>(); // [sysA [sysB [query rel]]] string[] allSystems = sqRuns.Keys.ToArray(); Parallel.For(0, allSystems.Length - 1, i => { string sysA = allSystems[i]; var runsA = sqRuns[sysA]; Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>> sqRelEstimates = new Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>>(); for (int j = i + 1; j < allSystems.Length; j++) { Dictionary<string, RelativeEffectivenessEstimate> qRelEstimates = new Dictionary<string, RelativeEffectivenessEstimate>(); string sysB = allSystems[j]; var runsB = sqRuns[sysB]; foreach (var qRun in runsA) { qRelEstimates.Add(qRun.Key, measure.Estimate(qRun.Value, runsB[qRun.Key], relEstimator, confEstimator)); } sqRelEstimates.Add(sysB, qRelEstimates); } lock (ssqRelEstimates) { ssqRelEstimates.Add(sysA, sqRelEstimates); } }); //for (int i = 0; i < allSystems.Length - 1; i++) { // string sysA = allSystems[i]; // var runsA = sqRuns[sysA]; // Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>> sqRelEstimates = new Dictionary<string, Dictionary<string, RelativeEffectivenessEstimate>>(); // for (int j = i + 1; j < allSystems.Length; j++) { // Dictionary<string, RelativeEffectivenessEstimate> qRelEstimates = new Dictionary<string, RelativeEffectivenessEstimate>(); // string sysB = allSystems[j]; // var runsB = sqRuns[sysB]; // foreach (var qRun in runsA) { // qRelEstimates.Add(qRun.Key, measure.Estimate(qRun.Value, runsB[qRun.Key], relEstimator, confEstimator)); // } // sqRelEstimates.Add(sysB, qRelEstimates); // } // ssqRelEstimates.Add(sysA, sqRelEstimates); //} return ssqRelEstimates; }
internal static Dictionary<string, Dictionary<string, AbsoluteEffectivenessEstimate>> GetSystemQueryAbsolutes( Dictionary<string, Dictionary<string, Run>> sqRuns, IMeasure measure, IRelevanceEstimator relEstimator, IConfidenceEstimator confEstimator) { Dictionary<string, Dictionary<string, AbsoluteEffectivenessEstimate>> sqAbss = new Dictionary<string, Dictionary<string, AbsoluteEffectivenessEstimate>>(); foreach (var sqRun in sqRuns) { Dictionary<string, AbsoluteEffectivenessEstimate> qAbs = new Dictionary<string, AbsoluteEffectivenessEstimate>(); foreach (var qRun in sqRun.Value) { qAbs.Add(qRun.Key, measure.Estimate(qRun.Value, relEstimator, confEstimator)); } sqAbss.Add(sqRun.Key, qAbs); } return sqAbss; }