mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 05:28:05 +00:00
style patterns
This commit is contained in:
@@ -291,4 +291,4 @@ public class NotchIndicatorTests
|
||||
$"Value at index {i} should be finite");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class NotchTests
|
||||
double output = 0;
|
||||
|
||||
// Warmup to stabilize (IIR transient)
|
||||
for(int i=0; i<100; i++)
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
output = notch.Update(new TValue(DateTime.UtcNow, input)).Value;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class NotchTests
|
||||
|
||||
if (i > 50) // ignore transient
|
||||
{
|
||||
maxAmp = Math.Max(maxAmp, Math.Abs(outVal));
|
||||
maxAmp = Math.Max(maxAmp, Math.Abs(outVal));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,4 +109,4 @@ public class NotchTests
|
||||
// With Q=5, it should be very small.
|
||||
Assert.True(maxAmp < 0.1, $"Amplitude {maxAmp} should be attenuated ( < 0.1 )");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ public class NotchValidationTests
|
||||
|
||||
double[] expected = { 0.5, 0.0, 0.0, 0.0, 0.0, 0.0 };
|
||||
|
||||
for(int i=0; i<input.Length; i++)
|
||||
for (int i = 0; i < input.Length; i++)
|
||||
{
|
||||
double val = notch.Update(input[i]).Value;
|
||||
Assert.Equal(expected[i], val, precision: 9);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user