From ddc2813adaac4bca71601a750ca96e1efe209e22 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Fri, 8 Aug 2014 11:35:42 +0200 Subject: [PATCH] Docs: improve inline doc of Vector.Count --- src/Numerics/LinearAlgebra/Vector.cs | 2 +- src/Performance/LinearAlgebra/DenseVectorAdd.cs | 3 ++- src/Performance/Program.cs | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Numerics/LinearAlgebra/Vector.cs b/src/Numerics/LinearAlgebra/Vector.cs index 4056ff89..3cd2b96f 100644 --- a/src/Numerics/LinearAlgebra/Vector.cs +++ b/src/Numerics/LinearAlgebra/Vector.cs @@ -66,7 +66,7 @@ namespace MathNet.Numerics.LinearAlgebra public VectorStorage Storage { get; private set; } /// - /// Gets the number of items. + /// Gets the length or number of dimensions of this vector. /// public int Count { get; private set; } diff --git a/src/Performance/LinearAlgebra/DenseVectorAdd.cs b/src/Performance/LinearAlgebra/DenseVectorAdd.cs index a5d7f80b..66476854 100644 --- a/src/Performance/LinearAlgebra/DenseVectorAdd.cs +++ b/src/Performance/LinearAlgebra/DenseVectorAdd.cs @@ -28,6 +28,7 @@ namespace Performance.LinearAlgebra #if NATIVEMKL mkl.InitializeVerify(); Console.WriteLine("MklProvider: {0}", mkl); + //Control.LinearAlgebraProvider = mkl; #endif } @@ -78,7 +79,7 @@ namespace Performance.LinearAlgebra var aa = ((DenseVectorStorage)a.Storage).Data; var ab = ((DenseVectorStorage)b.Storage).Data; var ar = new Double[aa.Length]; - CommonParallel.For(0, ar.Length, 32768*32, (u, v) => + CommonParallel.For(0, ar.Length, 32768, (u, v) => { for (int i = u; i < v; i++) { diff --git a/src/Performance/Program.cs b/src/Performance/Program.cs index 63ed8a8d..cb9717da 100644 --- a/src/Performance/Program.cs +++ b/src/Performance/Program.cs @@ -8,8 +8,8 @@ namespace Performance { public static void Main() { - Run(new LinearAlgebra.DenseVectorAdd(10000000), 10, "Large"); - Run(new LinearAlgebra.DenseVectorAdd(100), 10000, "Small"); + Run(new LinearAlgebra.DenseVectorAdd(10000000), 10, "Large (10'000'000)"); + Run(new LinearAlgebra.DenseVectorAdd(100), 10000, "Small (100)"); } static void Run(uint iterations, string suffix = null) where T:new() @@ -17,7 +17,7 @@ namespace Performance var bench = new BenchShark(); var result = bench.EvaluateDecoratedTasks(iterations); var label = string.IsNullOrEmpty(suffix) ? typeof (T).FullName : string.Concat(typeof (T).FullName, ": ", suffix); - result.FastestEvaluations.Select(x => new { x.Name, x.BestExecutionTime, x.AverageExecutionTime, x.WorstExecutionTime, x.TotalExecutionTime }).Dump(label); + result.FastestEvaluations.Select(x => new { x.Name, x.BestExecutionTime, x.AverageExecutionTime, x.WorstExecutionTime }).Dump(label); } static void Run(object obj, uint iterations, string suffix = null) @@ -25,7 +25,7 @@ namespace Performance var bench = new BenchShark(); var result = bench.EvaluateDecoratedTasks(obj, iterations); var label = string.IsNullOrEmpty(suffix) ? obj.GetType().FullName : string.Concat(obj.GetType().FullName, ": ", suffix); - result.FastestEvaluations.Select(x => new { x.Name, x.BestExecutionTime, x.AverageExecutionTime, x.WorstExecutionTime, x.TotalExecutionTime }).Dump(label); + result.FastestEvaluations.Select(x => new { x.Name, x.BestExecutionTime, x.AverageExecutionTime, x.WorstExecutionTime }).Dump(label); } } }