示例#1
0
        public static HistogramItem FromList(float[] rg)
        {
            HistogramItem item = new HistogramItem(rg[0], rg[1], rg[2], rg[3]);

            item.m_dfNormalizedCount = rg[4];
            item.m_dfCount           = rg[5];

            return(item);
        }
示例#2
0
        public static Histogram LoadData(PlotCollection col, out List <Tuple <float, float, int> > rgTopRanges, out double dfMin, out double dfMax, out float fTop, out float fBottom)
        {
            Histogram rgHistogram = new Histogram();
            int       nIdx        = 0;
            int       nCount      = (int)col[nIdx].Y;

            nIdx++;

            for (int i = 0; i < nCount; i++)
            {
                HistogramItem item = HistogramItem.FromList(col[nIdx].Y_values);
                nIdx++;
                rgHistogram.Add(item);
            }

            nCount = (int)col[nIdx].Y;
            nIdx++;

            rgTopRanges = new List <Tuple <float, float, int> >();

            for (int i = 0; i < nCount; i++)
            {
                float fItem1 = col[nIdx].Y_values[0];
                float fItem2 = col[nIdx].Y_values[1];
                int   nItem3 = (int)col[nIdx].Y_values[2];
                nIdx++;
                rgTopRanges.Add(new Tuple <float, float, int>(fItem1, fItem2, nItem3));
            }

            dfMin = col[nIdx].Y;
            nIdx++;
            dfMax = col[nIdx].Y;
            nIdx++;
            fTop = col[nIdx].Y;
            nIdx++;
            fBottom = col[nIdx].Y;

            return(rgHistogram);
        }