normalization of methods

This commit is contained in:
Miha Kralj
2026-02-10 21:33:16 -08:00
parent 915d7a007b
commit 6d6259a47d
527 changed files with 10525 additions and 2123 deletions
+11 -4
View File
@@ -129,7 +129,7 @@ public sealed class Accel : AbstractBase
var tSpan = CollectionsMarshal.AsSpan(t);
var vSpan = CollectionsMarshal.AsSpan(v);
Calculate(sourceValues, vSpan);
Batch(sourceValues, vSpan);
sourceTimes.CopyTo(tSpan);
// Prime state with last two values using cached span
@@ -176,7 +176,7 @@ public sealed class Accel : AbstractBase
}
}
public static TSeries Calculate(TSeries source)
public static TSeries Batch(TSeries source)
{
var accel = new Accel();
return accel.Update(source);
@@ -187,7 +187,7 @@ public sealed class Accel : AbstractBase
/// accel[i] = source[i] - 2*source[i-1] + source[i-2]
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Calculate(ReadOnlySpan<double> source, Span<double> output)
public static void Batch(ReadOnlySpan<double> source, Span<double> output)
{
if (source.Length != output.Length)
{
@@ -314,6 +314,13 @@ public sealed class Accel : AbstractBase
}
}
public static (TSeries Results, Accel Indicator) Calculate(TSeries source)
{
var indicator = new Accel();
TSeries results = indicator.Update(source);
return (results, indicator);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static double FindFinite(double a, double b, double c)
{
@@ -334,4 +341,4 @@ public sealed class Accel : AbstractBase
return 0.0;
}
}
}