コード例 #1
0
        private static void TestRange(IterationData itdata)
        {
            var ienum = new IndexesEnumerator(itdata.End, itdata.Start, itdata.Reverse);

            RecursiveArrayEnumerator.Iterate(
                null, itdata.Start, itdata.End, new IndexesEnumeratorTestAction(ienum).Iterate, itdata.Reverse);
        }
コード例 #2
0
 private static IterationData ToReverse(IterationData itdata)
 {
     return new IterationData(
         IndexesHelper.Add(itdata.End, -1),
         IndexesHelper.Add(itdata.Start, -1),
         !itdata.Reverse);
 }
コード例 #3
0
 private static IterationData ToReverse(IterationData itdata)
 {
     return(new IterationData(
                IndexesHelper.Add(itdata.End, -1),
                IndexesHelper.Add(itdata.Start, -1),
                !itdata.Reverse));
 }
コード例 #4
0
        private static void TestRange(IterationData itdata)
        {
            var ienum = new IndexesEnumerator(itdata.End, itdata.Start, itdata.Reverse);

            RecursiveArrayEnumerator.Iterate(
                null, itdata.Start, itdata.End, new IndexesEnumeratorTestAction(ienum).Iterate, itdata.Reverse);
        }
コード例 #5
0
        public Measurement RunIteration(IterationData data)
        {
            double nanoseconds = measure(data).Nanoseconds;
            var    measurement = new Measurement(1, data.IterationMode, data.Index, data.InvokeCount * OperationsPerInvoke, nanoseconds);

            WriteLine(measurement.ToOutputLine());
            return(measurement);
        }
コード例 #6
0
ファイル: Loop.cs プロジェクト: i2117/Chilly-Snow
 IterationData ReversedIteration(IterationData iter)
 {
     return(new IterationData
     {
         preDelay = iter.preDelay,
         to = -iter.to,
         duration = iter.duration
     });
 }
コード例 #7
0
 public void TestRange(
     [Values(new[] { 0 },
         new[] { 10258 },
         new[] { 0, 0 },
         new[] { 100, 1560 },
         new[] { 0, 0, 0 },
         new[] { 12000, 15000, 158220 },
         new[] { 0, 0, 0, 0 },
         new[] { 30, 300, 3000, 30000 })] int[] start,
     [Values(new[] { 125 },
         new[] { 11169 },
         new[] { 150, 17 },
         new[] { 320, 1587 },
         new[] { 49, 17, 9 },
         new[] { 12010, 15015, 158270 },
         new[] { 10, 7, 12, 18 },
         new[] { 35, 317, 3002, 30018 })]int[] end)
 {
     var itdata = new IterationData(start, end);
     TestRange(itdata);
     TestRange(ToReverse(itdata));
 }
コード例 #8
0
        public void TestRange(
            [Values(new[] { 0 },
                    new[] { 10258 },
                    new[] { 0, 0 },
                    new[] { 100, 1560 },
                    new[] { 0, 0, 0 },
                    new[] { 12000, 15000, 158220 },
                    new[] { 0, 0, 0, 0 },
                    new[] { 30, 300, 3000, 30000 })] int[] start,
            [Values(new[] { 125 },
                    new[] { 11169 },
                    new[] { 150, 17 },
                    new[] { 320, 1587 },
                    new[] { 49, 17, 9 },
                    new[] { 12010, 15015, 158270 },
                    new[] { 10, 7, 12, 18 },
                    new[] { 35, 317, 3002, 30018 })] int[] end)
        {
            var itdata = new IterationData(start, end);

            TestRange(itdata);
            TestRange(ToReverse(itdata));
        }
コード例 #9
0
        private void FillFormData()
        {
            Random        r    = new Random();
            IterationData data = new IterationData();
            KeyValuePair <string, string> item;

            if (_isTest)
            {
                int skipNumber = r.Next(0, 15);

                if (countPassedQuestion < maxCount / 2)
                {
                    item = data.CodecData.Skip(skipNumber).First();
                }
                else
                {
                    item   = data.DeCodecData.Skip(skipNumber).First();
                    _codec = false;
                }
            }
            else
            {
                if (_codec)
                {
                    int skipNumber = r.Next(15, data.CodecData.Count);
                    item = data.CodecData.Skip(skipNumber).First();
                }
                else
                {
                    int skipNumber = r.Next(15, data.DeCodecData.Count);
                    item = data.DeCodecData.Skip(skipNumber).First();
                }
            }

            taskLabel.Text = item.Key;
            correctAnswer  = item.Value;
        }
コード例 #10
0
 public Measurement RunIteration(IterationData data)
 {
     throw new NotImplementedException();
 }