using System; using System.Collections.Generic; using System.Linq; using System.Text; using L = Science.Mathematics.LinearAlgebra; namespace Strang3Ed.Chapter05.Section2 { public class ExampleB { public ExampleB() { } private string result; public string Result { get { return result; } } public void Compute() { double[,] x = {{0.0,0.0,1.0}, {0.0,2.0,3.0}, {4.0,5.0,6.0}}; L.Matrix A = new L.Matrix(x); result += A.Determinant.ToString() + "\r\n"; result += A.ToString() + " "; for (int i = 0; i < A.SizeOfRow; i++) for (int j = 0; j < A.SizeOfRow; j++) A[i, j] = (i+1.0)/(j+1.0) * A[i, j]; result += A.Determinant.ToString() + "\r\n"; result += A.ToString() + " "; } } } /* -8 0 0 1 0 2 3 4 5 6 -8 0 0 0.333333333333333 0 2 2 12 7.5 6 */