Guest User

Untitled

a guest
Jul 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using MathNet.Numerics.LinearAlgebra;
  6.  
  7. namespace MatrixMul
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int N = 1000;
  14.  
  15. Matrix m1 = new Matrix(N, N),
  16. m2 = new Matrix(N, N),
  17. m3 = new Matrix(N, N);
  18. Random r = new Random();
  19.  
  20. for (int i = 0; i < N; i++)
  21. {
  22. for (int k = 0; k < N; k++)
  23. {
  24. m1[i, k] = r.NextDouble();
  25. m2[i, k] = r.NextDouble();
  26. }
  27. }
  28.  
  29. DateTime start = DateTime.Now;
  30. m3 = m1 * m2;
  31. DateTime stop = DateTime.Now;
  32.  
  33. TimeSpan diff = stop - start;
  34.  
  35. Console.WriteLine("Multiplyer time {0}\n", diff);
  36. Console.ReadKey();
  37. }
  38. }
  39. }
Add Comment
Please, Sign In to add comment