Skip to content

Instantly share code, notes, and snippets.

@mad
Created December 31, 2010 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mad/760590 to your computer and use it in GitHub Desktop.
Save mad/760590 to your computer and use it in GitHub Desktop.
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