T- the type of data referred to by the identifier
U- the type of the multi-scenario data
public 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|
Creates an instance of the scenario market data object from a box containing data of the same underlying type.
Gets the market data identifier of the market data value.
Gets the type of the object containing the market data for all scenarios.
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
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 key
scenarioCount- the number of scenarios for which data is required in the returned value
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.