using System; using System.Collections.Generic; using System.Linq; using System.Text; using L = Science.Mathematics.LinearAlgebra; namespace Strang3Ed.Chapter02.Section3 { public class ExampleA { public ExampleA() { } 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,7.0,6.0}, {4.0,0.0,1.0}, {8.0,1.0,9.0}}; L.Matrix A = new L.Matrix(z); L.Matrix E21A = E21 * A; L.Matrix AE21 = A * E21; result += E21A.ToString() + "\r\n"; result += AE21.ToString() + "\r\n"; L.Matrix P32A = P32 * A; L.Matrix AP32 = A * P32; result += P32A.ToString() + "\r\n"; result += AP32.ToString() + "\r\n"; } } } /* 1 7 6 0 -28 -23 8 1 9 -27 7 6 4 0 1 4 1 9 1 7 6 8 1 9 4 0 1 1 6 7 4 1 0 8 9 1 */