using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter3.Section3 { public class Example07 { public Example07() { } private string result; public string Result { get{return result;} } public void Compute() { Science.Mathematics.Function.ToLastType f = new Science.Mathematics.Function.ToLastType(func); double[] at = { 0.0, 0.0 }; double[] h = { 0.01, 0.03 }; V.Hessian obj = new V.Hessian(f, at, h); obj.Compute(); result += obj.Result.ToString() + "\r\n"; result += obj.Matrix.ToString(); } private double func(double[] x) { return Math.Log(x[0] * x[0] + x[1] * x[1] + 1.0); } } } /* 0.0010000000017541 2.0000000035082 0 0 2.0000000035082 */