using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Science.Mathematics.LinearAlgebra { public class LeastSquareApproximation { public LeastSquareApproximation(Matrix A, Vector b) { Matrix AtA = A.Transpose * A; Vector Atb = A.Transpose * b; LinearEquation eq = new LinearEquation(AtA, Atb); eq.Solve(); s = eq.Solution; } private double[] s; public double[] Solution { get { return s; } } } }