Exemplo n.º 1
0
        private static void AddOptimizationStepAreas(TransitionDocNode nodeTran, int iResult, TReg regression,
                                                     IDictionary <int, OptimizationStep <TReg> > optTotals)
        {
            var results = (nodeTran.HasResults ? nodeTran.Results[iResult] : null);

            // Skip the result set if it only has step 0, the predicted value. This happens
            // when someone mistakenly sets "Optimizing" on a data set that does not contain
            // optimization steps.
            if (results == null || results.All(c => c.OptimizationStep == 0 || c.IsEmpty))
            {
                return;
            }
            foreach (var chromInfo in results)
            {
                if (chromInfo.Area == 0)
                {
                    continue;
                }
                int step = chromInfo.OptimizationStep;
                OptimizationStep <TReg> optStep;
                if (!optTotals.TryGetValue(step, out optStep))
                {
                    optTotals.Add(step, optStep = new OptimizationStep <TReg>(regression, step));
                }
                optStep.AddArea(chromInfo.Area);
            }
        }
Exemplo n.º 2
0
        private static void AddOptimizationStepAreas(TransitionGroupDocNode nodeGroup, int iResult, TReg regression,
                                                     IDictionary <int, OptimizationStep <TReg> > optTotals)
        {
            var results = (nodeGroup.HasResults ? nodeGroup.Results[iResult] : null);

            if (results == null)
            {
                return;
            }
            foreach (var chromInfo in results)
            {
                if (!chromInfo.Area.HasValue)
                {
                    continue;
                }
                int step = chromInfo.OptimizationStep;
                OptimizationStep <TReg> optStep;
                if (!optTotals.TryGetValue(step, out optStep))
                {
                    optTotals.Add(step, optStep = new OptimizationStep <TReg>(regression, step));
                }
                optStep.AddArea(chromInfo.Area.Value);
            }
        }