using System; using System.Collections.Generic; using System.Linq; using System.Text; using L = Science.Mathematics.LinearAlgebra; namespace Strang3Ed.Chapter06.Section3 { public class Example02 { public Example02() { } private string result; public string Result { get { return result; } } public void Compute() { double[,] x = { {1.0, 1.0, 1.0}, {0.0, 2.0, 1.0}, {0.0, 0.0, 3.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(3); b[0] = new Science.Mathematics.Complex(6.0, 0.0); b[1] = new Science.Mathematics.Complex(5.0, 0.0); b[2] = new Science.Mathematics.Complex(4.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"; } } } /* 1 1 1 1 1 0 1 0 0 3 0 0 0 2 0 0 0 1 4 1 1 */