f51a3002f8b285765a5efebe94c73cbdca42673d
java/com.sap.sse.common/src/com/sap/sse/common/scalablevalue/KadaneExtremeSubsequenceFinder.java
| ... | ... | @@ -40,6 +40,8 @@ public interface KadaneExtremeSubsequenceFinder<ValueType, AveragesTo extends Co |
| 40 | 40 | void remove(int index); |
| 41 | 41 | |
| 42 | 42 | void remove(T t); |
| 43 | + |
|
| 44 | + // TODO bug6209: introduce remove(...) methods that allow "trimming" / "pruning" by removing elements from the first up to some specified element in one go |
|
| 43 | 45 | |
| 44 | 46 | ScalableValueWithDistance<ValueType, AveragesTo> getMinSum(); |
| 45 | 47 |
java/com.sap.sse.common/src/com/sap/sse/common/scalablevalue/KadaneExtremeSubsequenceFinderLinkedNodesImpl.java
| ... | ... | @@ -9,6 +9,17 @@ import java.util.function.Function; |
| 9 | 9 | |
| 10 | 10 | import com.sap.sse.common.Util; |
| 11 | 11 | |
| 12 | +/** |
|
| 13 | + * An implementation of Kadane's algorithm for "maximum sub-sequence sum" that works incrementally, |
|
| 14 | + * allows insertion and removal anywhere in the sequence, and maintains the start/end points of those |
|
| 15 | + * extreme sum sequences for both, the maximal and the minimal sum. It furthermore supports iteration, |
|
| 16 | + * also across sub-sequences such as those extreme sum sub-sequences, a {@link #size()} as well as an |
|
| 17 | + * {@link #isEmpty()} operation.<p> |
|
| 18 | + * |
|
| 19 | + * This implementation uses a doubly-linked sequence of {@link Node}s. |
|
| 20 | + * |
|
| 21 | + * @author Axel Uhl (D043530) |
|
| 22 | + */ |
|
| 12 | 23 | public class KadaneExtremeSubsequenceFinderLinkedNodesImpl<ValueType, AveragesTo extends Comparable<AveragesTo>, T extends ComparableScalableValueWithDistance<ValueType, AveragesTo>> |
| 13 | 24 | implements KadaneExtremeSubsequenceFinder<ValueType, AveragesTo, T> { |
| 14 | 25 |