style patterns

This commit is contained in:
Miha Kralj
2026-01-25 16:01:45 -08:00
parent 2836f253c4
commit e59665c8f0
399 changed files with 6892 additions and 1323 deletions
+10 -7
View File
@@ -46,20 +46,20 @@ public class VarianceTests
{
// Use simple known values for easier debugging
var variance = new Variance(3);
// Add 3 values: 1, 2, 3
variance.Update(new TValue(DateTime.UtcNow, 1), isNew: true);
variance.Update(new TValue(DateTime.UtcNow, 2), isNew: true);
var originalResult = variance.Update(new TValue(DateTime.UtcNow, 3), isNew: true);
double expectedVariance = originalResult.Value; // Variance of [1,2,3]
// Now correct the 3rd value to 10 (isNew=false)
variance.Update(new TValue(DateTime.UtcNow, 10), isNew: false);
// Correct back to original value 3 (isNew=false)
var restoredResult = variance.Update(new TValue(DateTime.UtcNow, 3), isNew: false);
// Should match original variance
Assert.Equal(expectedVariance, restoredResult.Value, 1e-10);
}
@@ -351,7 +351,10 @@ public class VarianceTests
// Create large dataset to trigger SIMD path (>= 256)
const int count = 1000;
var data = new double[count];
for (int i = 0; i < count; i++) data[i] = (double)i;
for (int i = 0; i < count; i++)
{
data[i] = (double)i;
}
var series = new TSeries(new System.Collections.Generic.List<long>(new long[count]), new System.Collections.Generic.List<double>(data));
@@ -714,4 +717,4 @@ public class VarianceTests
Assert.Equal(0, output[0]); // N=1
Assert.Equal(50, output[1]); // Var([10,20]) = 50
}
}
}