示例#1
0
        static void Main(string[] args)
        {
            var result = MoveZeroes(new int[] { 1, 2, 0, 1, 0, 1, 0, 3, 0, 1 });

            Console.WriteLine("[{0}]", string.Join(", ", result));

            RiemannSum.usage();
        }
示例#2
0
        public static void usage()
        {
            var result = RiemannSum.Both((double x) => Math.Sin(x), 0, 1, 4);

            Console.WriteLine("Left sum: {0}, Right sum: {1}", result.leftSum, result.rightSum);

            var ave = RiemannSum.AverageValue((double x) => Math.Sin(x), 0, Math.PI);

            Console.WriteLine("Ave {0}", ave);

            ave = RiemannSum.AverageValue((double x) => 6 - 3 * x, 0, 2);
            Console.WriteLine("Ave {0}", ave);

            var point = RiemannSum.AverageValueWithC((double x) => (0.5 * x) + 3, 0, 4);

            Console.WriteLine("Ave and C is {0}", point);
        }