Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using MathNet.Numerics.LinearAlgebra;
- namespace MatrixMul
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N = 1000;
- Matrix m1 = new Matrix(N, N),
- m2 = new Matrix(N, N),
- m3 = new Matrix(N, N);
- Random r = new Random();
- for (int i = 0; i < N; i++)
- {
- for (int k = 0; k < N; k++)
- {
- m1[i, k] = r.NextDouble();
- m2[i, k] = r.NextDouble();
- }
- }
- DateTime start = DateTime.Now;
- m3 = m1 * m2;
- DateTime stop = DateTime.Now;
- TimeSpan diff = stop - start;
- Console.WriteLine("Multiplyer time {0}\n", diff);
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment