using System; namespace Science.Mathematics.VectorCalculus { public class JacobianDeterminant { private Function.ToLastType dela; private Function.ToLastType del; private double[] at1; public JacobianDeterminant(Function.ToLastType map, double[] at) { dela = map; at1 = at; } private PartialDerivative obj; private int comp; private MatrixSquare ma; public void Compute() { ma = new MatrixSquare(at1.Length); for (int i = 0; i < at1.Length; i++) { comp = i; del = new Function.ToLastType(OneComponent); obj = new PartialDerivative(del, at1); for (int j = 0; j < at1.Length; j++) { obj.WithRespectTo = j; obj.Compute(); ma[i,j] = obj.Result; } } result = ma.Determinant; } private double OneComponent(double[] u) { return dela(u)[comp]; } private double result; public double[] At { set { at1 = value; } } public double Result { get { return result; } } } }