63 lines
1.3 KiB
C#
63 lines
1.3 KiB
C#
using BenchmarkDotNet.Attributes;
|
|
using BenchmarkDotNet.Running;
|
|
using ConsoleApp1;
|
|
using System.Collections.Concurrent;
|
|
|
|
BenchmarkRunner.Run<MatrixTest>();
|
|
|
|
[MemoryDiagnoser]
|
|
public class MatrixTest
|
|
{
|
|
|
|
double[,] Matrix100;
|
|
double[,] Matrix10;
|
|
|
|
|
|
MatrixHelper matrixHelper;
|
|
|
|
|
|
public MatrixTest()
|
|
{
|
|
matrixHelper = new MatrixHelper();
|
|
|
|
Matrix10 = matrixHelper.RandomGenerateMatrix(10);
|
|
Matrix100 = matrixHelper.RandomGenerateMatrix(100);
|
|
|
|
}
|
|
|
|
[Benchmark]
|
|
public double MatrixDeterminantLaplas10()
|
|
{
|
|
return matrixHelper.determinantOfMatrixLaplas(Matrix10, 1);
|
|
}
|
|
|
|
[Benchmark]
|
|
public double MatrixDeterminantLaplasParallel10()
|
|
{
|
|
return matrixHelper.determinantOfMatrixLaplas(Matrix10, 15);
|
|
}
|
|
|
|
[Benchmark]
|
|
public double MatrixDeterminantGausParallel10()
|
|
{
|
|
return matrixHelper.determinantOfMatrixParallelGaus(Matrix10, 15);
|
|
}
|
|
|
|
[Benchmark]
|
|
public double MatrixDeterminantGaus10()
|
|
{
|
|
return matrixHelper.determinantOfMatrixGaus(Matrix10);
|
|
}
|
|
|
|
[Benchmark]
|
|
public double MatrixDeterminantGausParallel100()
|
|
{
|
|
return matrixHelper.determinantOfMatrixParallelGaus(Matrix100, 15);
|
|
}
|
|
|
|
[Benchmark]
|
|
public double MatrixDeterminantGaus100()
|
|
{
|
|
return matrixHelper.determinantOfMatrixGaus(Matrix100);
|
|
}
|
|
} |