Form1.cs 678 B

1234567891011121314151617181920212223242526272829303132
  1. using MathNet.Numerics.LinearAlgebra;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. namespace _02_1_Approx
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19. private void button1_Click(object sender, EventArgs e)
  20. {
  21. var A = Matrix<double>.Build.DenseOfArray(new double[,] {
  22. { 3, 2, -1 },
  23. { 2, -2, 4 },
  24. { -1, 0.5, -1 }
  25. });
  26. var b = Vector<double>.Build.Dense(new double[] { 1, -2, 0 });
  27. var x = A.Solve(b);
  28. }
  29. }
  30. }