T
- the type of data referred to by the identifierU
- the type of the multi-scenario datapublic interface ScenarioMarketDataId<T,U extends ScenarioArray<T>>
Many functions are written to calculate a single value at a time, for example a single present value for a trade. These functions need to consume single values of market data, for example a curve or a quoted price.
However, it may be more efficient in some cases to calculate values for all scenarios at the same time. To do this efficiently it may be helpful to package the market data into a structure that is suitable for bulk calculations. Implementations of this interface allow these values to be requested.
Modifier and Type | Method and Description |
---|---|
U |
createScenarioValue(MarketDataBox<T> marketDataBox,
int scenarioCount)
Creates an instance of the scenario market data object from a box containing data of the same underlying
type.
|
MarketDataId<T> |
getMarketDataId()
Gets the market data identifier of the market data value.
|
Class<U> |
getScenarioMarketDataType()
Gets the type of the object containing the market data for all scenarios.
|
MarketDataId<T> getMarketDataId()
Class<U> getScenarioMarketDataType()
U createScenarioValue(MarketDataBox<T> marketDataBox, int scenarioCount)
There are many possible ways to store scenario market data for a data type. For example, if the single
values are doubles, the scenario value might simply be a List<Double>
or it might be a wrapper
class that stores the values more efficiently in a double[]
.
This method allows a scenario value of the required type to be created from a different type of scenario value or from a single value.
Normally this method will not be used. It is assumed the required scenario values will be created by the perturbations that create scenario data. However there is no mechanism in the market data system to guarantee that scenario values of a particular type are available. If they are not, this method creates them on demand.
Values returned from this method might be cached in the market data containers for efficiency.
marketDataBox
- a market data box containing single market data values of the same type as the
scenario value identified by this keyscenarioCount
- the number of scenarios for which data is required in the returned valueCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.