using System; using System.Collections.Generic; using System.Linq; using System.Text; using L = Science.Mathematics.LinearAlgebra; namespace Strang3Ed.Chapter02.Section4 { 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,0.0}, {1.0,1.0,0.0,0.0}, {1.0,2.0,1.0,0.0}, {1.0,3.0,3.0,1.0}}; L.Matrix Pascal = new L.Matrix(x); L.Matrix H = Pascal*Pascal; result += H.ToString(); double[] yy = { 1.0, 1.0, 1.0, 1.0 }; L.Vector y = new L.Vector(yy); L.Vector z = H*y; result += z.ToString(); } } } /* 1 0 0 0 2 1 0 0 4 4 1 0 8 12 6 1 1 3 9 27 */