Created
December 31, 2010 01:17
-
-
Save mad/760590 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment