How can use GaussNewton class to solve a linear equations

15 views
Skip to first unread message

afen...@gmail.com

unread,
Mar 6, 2016, 9:52:59 AM3/6/16
to Accord.NET Framework
Suppose the linear euqations is Ax=B, I have get the input A[][] and result B[], then I want to get result x[] by GaussNewton.

Like this in VS:
static void Main(string[] args)
{
int number=5;
double[][] a = new double[number][];
a[0] = new double[]{1, 2, 3, 1,1};
a[1] = new double[]{2,1,2,6,2};
a[2] = new double[]{3,8,3,2,3};
a[3] = new double[]{4,9,4,6,4};
a[4] = new double[]{5,1,7,9,5};
double[] b = new double[] { 1, 2, 3, 4, 5 };
double[] x = new double[number];
GaussNewton GN = new GaussNewton(number);

GN.Minimize(a, b);

x = GN.Solution;
Console.WriteLine(x);
}

Its warning the LM is still null !

Anyone could tell me the step of using GaussNewton class to solve a linear equations?
Thank you!

Yanfeng Liu

Reply all
Reply to author
Forward
0 new messages