using System; namespace Science.Mathematics.LinearAlgebra { /// /// LinearEquation /// public class LinearEquation { private double[] s; private double[,] a; public LinearEquation() { } public LinearEquation(Matrix A, Vector b) { s = new double[b.Size]; for (int i = 0; i < b.Size; i++) s[i] = b[i]; a = new double[A.SizeOfRow, A.SizeOfColumn]; for (int i = 0; i < A.SizeOfRow; i++) for (int j = 0; j < A.SizeOfColumn; j++) a[i, j] = A[i, j]; } public void Solve() { LUdcmp obj = new LUdcmp(a); obj.solve(s, s); } public double[] Solution { get{ return s; } } } }