docs: update category index files and fix indicator implementations (#58)

This commit is contained in:
Miha Kralj
2026-01-19 18:25:48 -08:00
committed by GitHub
parent e966000d48
commit b2c1787782
29 changed files with 566 additions and 1667 deletions
+4 -18
View File
@@ -74,14 +74,7 @@ public sealed class Slope : AbstractBase
_p_state = _state;
double val = GetValidValue(input.Value);
if (_state.Count >= 1)
{
result = val - _state.PrevValue;
}
else
{
result = 0.0;
}
result = _state.Count >= 1 ? val - _state.PrevValue : 0.0;
_state.PrevValue = val;
_state.Count = Math.Min(_state.Count + 1, 2);
@@ -92,14 +85,7 @@ public sealed class Slope : AbstractBase
_state.LastValidValue = _p_state.LastValidValue;
double val = GetValidValue(input.Value);
if (_p_state.Count >= 1)
{
result = val - _p_state.PrevValue;
}
else
{
result = 0.0;
}
result = _p_state.Count >= 1 ? val - _p_state.PrevValue : 0.0;
_state.PrevValue = val;
_state.Count = Math.Max(_p_state.Count, 1);
@@ -238,7 +224,7 @@ public sealed class Slope : AbstractBase
}
// Scalar fallback for remaining elements
// Track last valid value forward to avoid O(n²) backward scanning
// Track last valid value forward to avoid O(n²) backward scanning
double lastValid = 0.0;
// Find first valid value if we're starting from the beginning
if (i == 1)
@@ -293,4 +279,4 @@ public sealed class Slope : AbstractBase
output[i] = curr - prev;
}
}
}
}