Examples of ComputedValue


Examples of com.opengamma.engine.value.ComputedValue

        } else {
          cashFlows = NETTING_CASH_FLOW_CALCULATOR.getCashFlows(definition, fixingSeries.getTimeSeries(), date);
        }
      }
      final ValueProperties properties = createValueProperties().with(PROPERTY_DATE, dateString).get();
      return Collections.singleton(new ComputedValue(new ValueSpecification(ValueRequirementNames.NETTED_FIXED_CASH_FLOWS, target.toSpecification(), properties),
          new FixedPaymentMatrix(cashFlows)));
    }
View Full Code Here

Examples of com.opengamma.engine.value.ComputedValue

      final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
    final CurrencyPairs currencyPairs = OpenGammaExecutionContext.getCurrencyPairsSource(executionContext).getCurrencyPairs(CurrencyPairs.DEFAULT_CURRENCY_PAIRS);
    final Trade trade = target.getTrade();
    final CurrencyAmount ca = FinancialSecurityUtils.getNotional(trade.getSecurity(), currencyPairs, executionContext.getSecuritySource()).multipliedBy(trade.getQuantity().doubleValue());
    final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.NOTIONAL, target.toSpecification(), createValueProperties().get());
    return Collections.singleton(new ComputedValue(spec, ca));
  }
View Full Code Here

Examples of com.opengamma.engine.value.ComputedValue

    for (int i = 0; i < riskFactorReqs.length; i++) {
      timeSeries[i] = riskFactors.getDoubleTimeSeries(riskFactorReqs[i]);
    }
    final ValueRequirement desiredValueReq = desiredValues.iterator().next();
    final ValueSpecification desiredValueSpec = new ValueSpecification(ValueRequirementNames.COVARIANCE_MATRIX, target.toSpecification(), desiredValueReq.getConstraints());
    return Collections.singleton(new ComputedValue(desiredValueSpec, createCovarianceMatrix(timeSeries, riskFactorReqs)));
  }
View Full Code Here

Examples of com.opengamma.engine.value.ComputedValue

      } else {
        parentValue = (Double) c.getValue();
      }
    }
    final ValueRequirement desiredValue = desiredValues.iterator().next();
    return Collections.singleton(new ComputedValue(new ValueSpecification(ValueRequirementNames.WEIGHT, target.toSpecification(), desiredValue.getConstraints()),
        targetValue / parentValue));
  }
View Full Code Here

Examples of com.opengamma.engine.value.ComputedValue

            timeInYearsToRates.put(years, Math.exp(-price * years));
          }
        }
        final YieldAndDiscountCurve curve = _isYieldCurve ? YieldCurve.from(InterpolatedDoublesCurve.from(timeInYearsToRates, _interpolator)) : DiscountCurve.from(InterpolatedDoublesCurve.from(
            timeInYearsToRates, _interpolator));
        final ComputedValue resultValue = new ComputedValue(_result, curve);
        final ComputedValue specValue = new ComputedValue(_specResult, specWithSecurities);
        return Sets.newHashSet(resultValue, specValue);
      }

    };
  }
View Full Code Here

Examples of com.opengamma.engine.value.ComputedValue

      final double a = stddev[i];
      for (int j = 0; j < v.length; j++) {
        v[j] /= a * stddev[j];
      }
    }
    return Collections.singleton(new ComputedValue(new ValueSpecification(ValueRequirementNames.CORRELATION_MATRIX, target.toSpecification(), desiredValue.getConstraints()), output));
  }
View Full Code Here

Examples of com.opengamma.engine.value.ComputedValue

    }
    final ValueProperties properties = createValueProperties()
        .with(ValuePropertyNames.CURVE, _curveName)
        .get();
    final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.CURVE_DEFINITION, ComputationTargetSpecification.NULL, properties);
    final Set<ComputedValue> result = Collections.singleton(new ComputedValue(spec, curveDefinition));
    return new AbstractInvokingCompiledFunction(atZDT.with(LocalTime.MIDNIGHT), atZDT.plusDays(1).with(LocalTime.MIDNIGHT).minusNanos(1000000)) {

      @Override
      public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target,
          final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
View Full Code Here

Examples of com.opengamma.engine.value.ComputedValue

    return Collections.singleton(new ValueSpecification(input.getValueName(), input.getTargetSpecification(), properties));
  }

  @Override
  public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
    final ComputedValue input = inputs.getAllValues().iterator().next();
    final ValueSpecification inputSpec = input.getSpecification();
    final YieldAndDiscountCurve curve = (YieldAndDiscountCurve) input.getValue();
    final ValueRequirement desiredValue = desiredValues.iterator().next();
    final String shift = desiredValue.getConstraint(SHIFT);
    final ValueProperties.Builder properties = createValueProperties(inputSpec).with(SHIFT, shift);
    final OverrideOperationCompiler compiler = OpenGammaExecutionContext.getOverrideOperationCompiler(executionContext);
    if (compiler == null) {
      throw new IllegalStateException("No override operation compiler for " + shift + " in execution context");
    }
    s_logger.debug("Applying {} to yield curve {}", shift, curve);
    final Object result = compiler.compile(shift, executionContext.getComputationTargetResolver()).apply(desiredValue, curve);
    s_logger.debug("Got result {}", result);
    return Collections.singleton(new ComputedValue(new ValueSpecification(inputSpec.getValueName(), inputSpec.getTargetSpecification(), properties.get()), result));
  }
View Full Code Here

Examples of org.apache.batik.css.engine.value.ComputedValue

            }
            if (value == null) {
                sm.putValue(propidx, result);
                sm.putNullCascaded(propidx, true);
            } else if (result != value) {
                ComputedValue cv = new ComputedValue(value);
                cv.setComputedValue(result);
                sm.putValue(propidx, cv);
                result = cv;
            }
            sm.putComputed(propidx, true);
            value = result;
View Full Code Here

Examples of org.apache.batik.css.engine.value.ComputedValue

        if (style.isNullCascaded(n)) {
            style.putValue(n, null);
        } else {
            Value v = style.getValue(n);
            if (v instanceof ComputedValue) {
                ComputedValue cv = (ComputedValue)v;
                v = cv.getCascadedValue();
                style.putValue(n, v);
            }
        }
        style.putComputed(n, false);
    }
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.