Browse Source

Docs: improve inline doc of Vector.Count

pull/248/head
Christoph Ruegg 12 years ago
parent
commit
ddc2813ada
  1. 2
      src/Numerics/LinearAlgebra/Vector.cs
  2. 3
      src/Performance/LinearAlgebra/DenseVectorAdd.cs
  3. 8
      src/Performance/Program.cs

2
src/Numerics/LinearAlgebra/Vector.cs

@ -66,7 +66,7 @@ namespace MathNet.Numerics.LinearAlgebra
public VectorStorage<T> Storage { get; private set; }
/// <summary>
/// Gets the number of items.
/// Gets the length or number of dimensions of this vector.
/// </summary>
public int Count { get; private set; }

3
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<double>)a.Storage).Data;
var ab = ((DenseVectorStorage<double>)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++)
{

8
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<T>(uint iterations, string suffix = null) where T:new()
@ -17,7 +17,7 @@ namespace Performance
var bench = new BenchShark();
var result = bench.EvaluateDecoratedTasks<T>(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);
}
}
}

Loading…
Cancel
Save