public class DoublesScheduleGenerator extends Object
This is a utility for combining and truncating ascending arrays of doubles.
The main application of this class is IsdaCdsProductPricer
.
Modifier and Type | Method and Description |
---|---|
static DoubleArray |
getIntegrationsPoints(double start,
double end,
DoubleArray discountCurveNodes,
DoubleArray creditCurveNodes)
Combines the discount curve nodes and credit curve nodes.
|
static DoubleArray |
truncateSetInclusive(double lower,
double upper,
DoubleArray set)
Truncates an array of doubles.
|
public static DoubleArray getIntegrationsPoints(double start, double end, DoubleArray discountCurveNodes, DoubleArray creditCurveNodes)
The combined numbers are returned only if the values strictly between the specified start and end.
The start and end values are added at the beginning and end of the list. If two times are very close (defined as less than half a day - 1/730 years different) only the smaller value is kept (with the exception of the end value which takes precedence).
start
- the first time in the listend
- the last time in the listdiscountCurveNodes
- the discount curve node setcreditCurveNodes
- the credit curve nodepublic static DoubleArray truncateSetInclusive(double lower, double upper, DoubleArray set)
The number set is truncated so that it contains only the values between lower and upper, plus the values of lower and higher (as the first and last entry respectively).
If no values met this criteria an array just containing lower and upper is returned. If the first (last) entry of set is too close to lower (upper), defined by TOL, the first (last) entry of set is replaced by lower (upper).
lower
- the lower valueupper
- the upper valueset
- the numbers must be sorted in ascending orderCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.