using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter6.Section4 { public class Example01 { public Example01() { } private string result; public string Result { get{return result;} } public void Compute() { Science.Mathematics.Function.ToLastType f = new Science.Mathematics.Function.ToLastType(func); double[] from = { 0.0 , 0.0 }; double[] to = { 1.0, 1.0 }; V.IntegrationMultiD obj = new V.IntegrationMultiD(f, from, to); obj.Compute(); result += obj.BestEstimation.ToString() + "\r\n"; obj.NumberOfCall = 1000000; obj.Compute(); result += obj.BestEstimation.ToString() + "\r\n"; double ans = 9.0/4.0; result += ans.ToString() + "\r\n"; } private double func(double[] x) { return 1.0/Math.Pow(x[0] * x[1], 1.0/3.0); } } } /* 2.24981734607704 2.25000448734115 2.25 */