using System; using System.Collections.Generic; using System.Linq; using System.Text; using L = Science.Mathematics.LinearAlgebra; namespace Strang3Ed.Chapter02.Section3 { public class ExampleB { public ExampleB() { } private string result; public string Result { get { return result; } } public void Compute() { double[,] x = {{1.0,0.0,0.0}, {-4.0,1.0,0.0}, {0.0,0.0,1.0}}; L.Matrix E21 = new L.Matrix(x); double[,] y = {{1.0,0.0,0.0}, {0.0,0.0,1.0}, {0.0,1.0,0.0}}; L.Matrix P32 = new L.Matrix(y); double[,] z = {{1.0,2.0,2.0}, {4.0,8.0,9.0}, {0.0,3.0,2.0}}; L.Matrix A = new L.Matrix(z); double[] v = { 1.0, 3.0, 1.0 }; L.Vector b = new L.Vector(v); L.AugmentedMatrix Ab = new L.AugmentedMatrix(A, b); L.Matrix P32E21Ab = P32 * (E21 * Ab); result += P32E21Ab.ToString() + "\r\n"; } } } /* 1 2 2 1 0 3 2 1 0 0 1 -1 */