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
@@ -68,9 +68,13 @@ public class MmaValidationTests
{
double val = source[i];
if (double.IsFinite(val))
{
lastValid = val;
}
else
{
val = lastValid;
}
if (double.IsNaN(val))
{
@@ -79,16 +83,22 @@ public class MmaValidationTests
}
if (count < window)
{
count++;
}
else
{
sum -= buffer[head];
}
buffer[head] = val;
sum += val;
head++;
if (head == window)
{
head = 0;
}
double sma = sum / count;
double weightedSum = ComputeWeightedSum(buffer, head, count);
@@ -101,7 +111,9 @@ public class MmaValidationTests
{
int idx = head - 1;
if (idx < 0)
{
idx = count - 1;
}
double weightedSum = 0.0;
for (int i = 0; i < count; i++)
@@ -111,7 +123,9 @@ public class MmaValidationTests
idx--;
if (idx < 0)
{
idx = count - 1;
}
}
return weightedSum;