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
+9 -2
View File
@@ -108,7 +108,7 @@ public sealed class StdDev : AbstractBase
}
}
public static TSeries Calculate(TSeries source, int period, bool isPopulation = false)
public static TSeries Batch(TSeries source, int period, bool isPopulation = false)
{
var stdDev = new StdDev(period, isPopulation);
return stdDev.Update(source);
@@ -127,6 +127,13 @@ public sealed class StdDev : AbstractBase
SqrtSpan(output);
}
public static (TSeries Results, StdDev Indicator) Calculate(TSeries source, int period, bool isPopulation = false)
{
var indicator = new StdDev(period, isPopulation);
TSeries results = indicator.Update(source);
return (results, indicator);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void SqrtSpan(Span<double> data)
{
@@ -192,4 +199,4 @@ public sealed class StdDev : AbstractBase
data[i] = (val > 0) ? Math.Sqrt(val) : 0.0;
}
}
}
}