Guest User

Untitled

a guest
Jul 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Matrix_M_B
  9. {
  10. class Matrx
  11. {
  12.  
  13. private int m = 100;
  14. private double[,] A;
  15. private double[,] B;
  16. private int n = 100;
  17. private double[,] Result;
  18.  
  19. public static void Main ()
  20. {
  21. List<int> A = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  22. List<int> B = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  23. }
  24. public Matrx( int m, int n, double[,] result , int amountflow)
  25. {
  26.  
  27. Result = result;
  28.  
  29.  
  30.  
  31. Parallel.For(0, m, i => {
  32.  
  33. for (int j = 0; j < 100; j++)
  34.  
  35. {
  36.  
  37. for (int k = 0; k < 100; k++)
  38.  
  39. {
  40.  
  41. Result[i, j] += A[i, k] * B[k, j];
  42.  
  43. }
  44.  
  45. }
  46.  
  47. }
  48.  
  49. );
  50. Console.ReadKey();
  51. }
  52.  
  53. public void Rresult (double[,] A,double[,] B)
  54. {
  55. Console.WriteLine("Matrx: {0} start.", A);
  56. Thread.Sleep(2000);
  57. Console.WriteLine("Matrx: {0} done.", B);
  58. }
  59. }
  60. }
Add Comment
Please, Sign In to add comment