Package com.opengamma.analytics.util.amount

Examples of com.opengamma.analytics.util.amount.SurfaceValue.toSingleValue()


    SurfaceValue surf1 = SurfaceValue.from(point1, value1);
    DoublesPair point2 = new DoublesPair(2.0, Math.PI);
    double value2 = 10 * Math.E;
    SurfaceValue surf2 = SurfaceValue.from(point2, value2);
    SurfaceValue surfPlus1 = SurfaceValue.plus(surf1, surf2);
    double amountComputed = surfPlus1.toSingleValue();
    assertEquals("Surface value - single value", amountComputed, value1 + value2, TOLERANCE);
  }

}
View Full Code Here


      protected Set<ComputedValue> getValues(final FunctionExecutionContext executionContext, final FunctionInputs inputs,
          final ComputationTarget target, final Set<ValueRequirement> desiredValues, final InstrumentDerivative derivative,
          final FXMatrix fxMatrix) {
        final BlackSTIRFuturesSmileProviderInterface blackData = getBlackSurface(executionContext, inputs, target, fxMatrix);
        final SurfaceValue sensitivities = derivative.accept(CALCULATOR, blackData);
        final double vega = sensitivities.toSingleValue();
        final ValueRequirement desiredValue = Iterables.getOnlyElement(desiredValues);
        final ValueProperties properties = desiredValue.getConstraints().copy().get();
        final ValueSpecification spec = new ValueSpecification(VALUE_VEGA, target.toSpecification(), properties);
        return Collections.singleton(new ComputedValue(spec, vega));
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.