Remove inner class MathUtil from class GeneralStatistics
Bug #1209810 reported by
Richard Gomes
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
JQuantLib |
New
|
Medium
|
Unassigned |
Bug Description
Class MathUtil has methods min and max which should ideally be merged to similar methods in class Std.
In class Std min and max should take advantage of types T which implement Comparable<T>. This would probably make the code more flexible and the merge should make more sense.
To post a comment you must log in.
I've migrated methods min() and max() from Std to Date.
The implementation in MathUtil remained as it is.
Class Std was removed as all its methods migrated to Array and/or Date.
In future, we need to study how these 'horizontal' methods should behave. I mean: there's a possibility that we find useful to define an interface Std which defines the behaviour of such methods min(), max(), lowerBound(), upperBound() and possibly others, pretty much like std:: library does. Then certain classes would ideally implement this interface.
At the moment, this need is not clear and, at the same time, a separate class Std does not look nice because break the encapsulation and responsibility chain of an OO design.