Refactor code formatting and improve consistency across various test files

- Removed unnecessary blank lines in multiple test files to enhance readability.
- Ensured consistent spacing and formatting in the `Trima`, `Usf`, `Vidya`, `Wma`, and `Atr` test classes.
- Updated comments for clarity and consistency in the `Atr` and `Adl` classes.
- Adjusted project files for better structure and maintainability.
This commit is contained in:
Miha Kralj
2025-12-28 17:44:08 -08:00
parent ad6eebf812
commit 13d7c1215d
169 changed files with 10815 additions and 10814 deletions
@@ -29,7 +29,7 @@ public sealed class LinRegValidationTests : IDisposable
{
var period = 14;
var skender = _data.SkenderQuotes.GetSlope(period).ToList();
var linreg = new LinReg(period);
var slopeSeries = new TSeries();
foreach (var item in _data.Data)
@@ -47,7 +47,7 @@ public sealed class LinRegValidationTests : IDisposable
{
var period = 14;
var skender = _data.SkenderQuotes.GetSlope(period).ToList();
var linreg = new LinReg(period);
var r2Series = new TSeries();
foreach (var item in _data.Data)
+2 -2
View File
@@ -166,7 +166,7 @@ public sealed class LinReg : AbstractBase
_state.SumY = _buffer.Sum;
_state.SumXY = 0;
var span = _buffer.GetSpan();
// Vectorized SumY2
_state.SumY2 = span.DotProduct(span);
@@ -248,7 +248,7 @@ public sealed class LinReg : AbstractBase
// R2 = (n * sum_xy - sum_x * sum_y)^2 / ( (n * sum_x2 - sum_x^2) * (n * sum_y2 - sum_y^2) )
double numerator = Math.FusedMultiplyAdd(n, _state.SumXY, -sx * _state.SumY);
double term2 = Math.FusedMultiplyAdd(n, _state.SumY2, -_state.SumY * _state.SumY);
RSquared = Math.Abs(term2) < MinDenominator
? 1.0 // All y are same
: numerator * numerator / (denom * term2);