using System; using System.Collections.Generic; using System.Linq; using System.Text; using L = Science.Mathematics.LinearAlgebra; namespace Strang3Ed.Chapter06.Section3 { public class Example01 { public Example01() { } private string result; public string Result { get{return result;} } public void Compute() { double[,] x = { {0.0, 1.0}, {1.0, 0.0}}; L.Matrix P = new L.Matrix(x); L.FactorizationAeqSLSi obj = new L.FactorizationAeqSLSi(P); obj.Compute(); result += obj.Eigenvectors.ToString() + "\r\n"; result += obj.Eigenvalues.ToString() + "\r\n"; L.MatrixComplex A = obj.Eigenvectors; L.VectorComplex b = new L.VectorComplex(2); b[0] = new Science.Mathematics.Complex(4.0, 0.0); b[1] = new Science.Mathematics.Complex(2.0, 0.0); L.LinearEquationComplex eq = new L.LinearEquationComplex(A,b); eq.Solve(); foreach(Science.Mathematics.Complex c in eq.Solution) result += c.ToString() + "\r\n"; } } } /* 0.707106781186547 -0.707106781186547 0.707106781186547 0.707106781186547 1 0 0 -1 4.24264068711929 -1.4142135623731 */