Skip to content

Instantly share code, notes, and snippets.

@kurema
Created March 15, 2015 21:42
Show Gist options
  • Save kurema/8368a15feaa7f583babb to your computer and use it in GitHub Desktop.
Save kurema/8368a15feaa7f583babb to your computer and use it in GitHub Desktop.
Gauss Newton Method in C#
static public Matrix GaussNewtonMethod(Matrix Jacobian, Matrix EnergyVector, Matrix StatusVector,double ZeroTolerance=1e-10)
{
Matrix M1 = Jacobian.Duplicate();
M1.Transpose();
Matrix M2 = M1 * Jacobian;
M2.Invert(ZeroTolerance);
M1 = M1 * EnergyVector;
M1 = M2 * M1;
M1.Scale(-1);
return M1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment