<commit_before>/**
 * Copyright (C) 2009 - 2009 by OpenGamma Inc.
 *
 * Please see distribution for license.
 */
package com.opengamma.financial.analytics;

import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import javax.time.calendar.Clock;
import javax.time.calendar.TimeZone;
import javax.time.calendar.ZonedDateTime;

import org.fudgemsg.FudgeFieldContainer;

import com.opengamma.engine.ComputationTarget;
import com.opengamma.engine.ComputationTargetType;
import com.opengamma.engine.function.AbstractFunction;
import com.opengamma.engine.function.FunctionCompilationContext;
import com.opengamma.engine.function.FunctionExecutionContext;
import com.opengamma.engine.function.FunctionInputs;
import com.opengamma.engine.function.FunctionInvoker;
import com.opengamma.engine.value.ComputedValue;
import com.opengamma.engine.value.MarketDataFieldNames;
import com.opengamma.engine.value.ValueRequirement;
import com.opengamma.engine.value.ValueRequirementNames;
import com.opengamma.engine.value.ValueSpecification;
import com.opengamma.financial.greeks.Greek;
import com.opengamma.financial.greeks.GreekResult;
import com.opengamma.financial.greeks.GreekResultCollection;
import com.opengamma.financial.model.interestrate.curve.DiscountCurve;
import com.opengamma.financial.model.option.definition.EuropeanVanillaOptionDefinition;
import com.opengamma.financial.model.option.definition.OptionDefinition;
import com.opengamma.financial.model.option.definition.StandardOptionDataBundle;
import com.opengamma.financial.model.option.pricing.analytic.AnalyticOptionModel;
import com.opengamma.financial.model.option.pricing.analytic.BlackScholesMertonModel;
import com.opengamma.financial.model.volatility.surface.VolatilitySurface;
import com.opengamma.financial.security.AmericanVanillaOption;
import com.opengamma.financial.security.EquityOptionSecurity;
import com.opengamma.financial.security.EuropeanVanillaOption;
import com.opengamma.financial.security.OptionType;
import com.opengamma.financial.security.OptionVisitor;
import com.opengamma.financial.security.PoweredOption;
import com.opengamma.util.time.DateUtil;
import com.opengamma.util.time.Expiry;

/**
 * 
 *
 * @author jim
 */
public class EquityOptionGreeksFunction extends AbstractFunction
implements FunctionInvoker {
  private static final Map<String, Greek> s_greeksByValueName;
  
  static {
    Map<String, Greek> greeksMap = new TreeMap<String,Greek>();
    greeksMap.put(ValueRequirementNames.FAIR_VALUE, Greek.PRICE);
    greeksMap.put(ValueRequirementNames.DELTA, Greek.DELTA);
    greeksMap.put(ValueRequirementNames.DELTA_BLEED, Greek.DELTA_BLEED);
    greeksMap.put(ValueRequirementNames.STRIKE_DELTA, Greek.STRIKE_DELTA);
    greeksMap.put(ValueRequirementNames.DRIFTLESS_DELTA, Greek.DRIFTLESS_THETA);
    
    greeksMap.put(ValueRequirementNames.GAMMA, Greek.GAMMA);
    greeksMap.put(ValueRequirementNames.GAMMA_P, Greek.GAMMA_P);
    greeksMap.put(ValueRequirementNames.STRIKE_GAMMA, Greek.STRIKE_GAMMA);
    greeksMap.put(ValueRequirementNames.GAMMA_BLEED, Greek.GAMMA_BLEED);
    greeksMap.put(ValueRequirementNames.GAMMA_P_BLEED, Greek.GAMMA_P_BLEED);
    
    greeksMap.put(ValueRequirementNames.VEGA, Greek.VEGA);
    greeksMap.put(ValueRequirementNames.VEGA_P, Greek.VEGA_P);
    greeksMap.put(ValueRequirementNames.VARIANCE_VEGA, Greek.VARIANCE_VEGA);
    greeksMap.put(ValueRequirementNames.VEGA_BLEED, Greek.VEGA_BLEED);
    
    greeksMap.put(ValueRequirementNames.THETA, Greek.THETA);
    
    greeksMap.put(ValueRequirementNames.RHO, Greek.RHO);
    greeksMap.put(ValueRequirementNames.TIME_BUCKETED_RHO, Greek.TIME_BUCKETED_RHO);
    greeksMap.put(ValueRequirementNames.CARRY_RHO, Greek.CARRY_RHO);
    
    greeksMap.put(ValueRequirementNames.ZETA, Greek.ZETA);<commit_msg>Removed the time-bucketed rho as a greek definition because it's not.<commit_after>/**
 * Copyright (C) 2009 - 2009 by OpenGamma Inc.
 *
 * Please see distribution for license.
 */
package com.opengamma.financial.analytics;

import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import javax.time.calendar.Clock;
import javax.time.calendar.TimeZone;
import javax.time.calendar.ZonedDateTime;

import org.fudgemsg.FudgeFieldContainer;

import com.opengamma.engine.ComputationTarget;
import com.opengamma.engine.ComputationTargetType;
import com.opengamma.engine.function.AbstractFunction;
import com.opengamma.engine.function.FunctionCompilationContext;
import com.opengamma.engine.function.FunctionExecutionContext;
import com.opengamma.engine.function.FunctionInputs;
import com.opengamma.engine.function.FunctionInvoker;
import com.opengamma.engine.value.ComputedValue;
import com.opengamma.engine.value.MarketDataFieldNames;
import com.opengamma.engine.value.ValueRequirement;
import com.opengamma.engine.value.ValueRequirementNames;
import com.opengamma.engine.value.ValueSpecification;
import com.opengamma.financial.greeks.Greek;
import com.opengamma.financial.greeks.GreekResult;
import com.opengamma.financial.greeks.GreekResultCollection;
import com.opengamma.financial.model.interestrate.curve.DiscountCurve;
import com.opengamma.financial.model.option.definition.EuropeanVanillaOptionDefinition;
import com.opengamma.financial.model.option.definition.OptionDefinition;
import com.opengamma.financial.model.option.definition.StandardOptionDataBundle;
import com.opengamma.financial.model.option.pricing.analytic.AnalyticOptionModel;
import com.opengamma.financial.model.option.pricing.analytic.BlackScholesMertonModel;
import com.opengamma.financial.model.volatility.surface.VolatilitySurface;
import com.opengamma.financial.security.AmericanVanillaOption;
import com.opengamma.financial.security.EquityOptionSecurity;
import com.opengamma.financial.security.EuropeanVanillaOption;
import com.opengamma.financial.security.OptionType;
import com.opengamma.financial.security.OptionVisitor;
import com.opengamma.financial.security.PoweredOption;
import com.opengamma.util.time.DateUtil;
import com.opengamma.util.time.Expiry;

/**
 * 
 *
 * @author jim
 */
public class EquityOptionGreeksFunction extends AbstractFunction
implements FunctionInvoker {
  private static final Map<String, Greek> s_greeksByValueName;
  
  static {
    Map<String, Greek> greeksMap = new TreeMap<String,Greek>();
    greeksMap.put(ValueRequirementNames.FAIR_VALUE, Greek.PRICE);
    greeksMap.put(ValueRequirementNames.DELTA, Greek.DELTA);
    greeksMap.put(ValueRequirementNames.DELTA_BLEED, Greek.DELTA_BLEED);
    greeksMap.put(ValueRequirementNames.STRIKE_DELTA, Greek.STRIKE_DELTA);
    greeksMap.put(ValueRequirementNames.DRIFTLESS_DELTA, Greek.DRIFTLESS_THETA);
    
    greeksMap.put(ValueRequirementNames.GAMMA, Greek.GAMMA);
    greeksMap.put(ValueRequirementNames.GAMMA_P, Greek.GAMMA_P);
    greeksMap.put(ValueRequirementNames.STRIKE_GAMMA, Greek.STRIKE_GAMMA);
    greeksMap.put(ValueRequirementNames.GAMMA_BLEED, Greek.GAMMA_BLEED);
    greeksMap.put(ValueRequirementNames.GAMMA_P_BLEED, Greek.GAMMA_P_BLEED);
    
    greeksMap.put(ValueRequirementNames.VEGA, Greek.VEGA);
    greeksMap.put(ValueRequirementNames.VEGA_P, Greek.VEGA_P);
    greeksMap.put(ValueRequirementNames.VARIANCE_VEGA, Greek.VARIANCE_VEGA);
    greeksMap.put(ValueRequirementNames.VEGA_BLEED, Greek.VEGA_BLEED);
    
    greeksMap.put(ValueRequirementNames.THETA, Greek.THETA);
    
    greeksMap.put(ValueRequirementNames.RHO, Greek.RHO);
    greeksMap.put(ValueRequirementNames.CARRY_RHO, Greek.CARRY_RHO);
    
    greeksMap.put(ValueRequirementNames.ZETA, Greek.ZETA);
{'fraction_non_alphanumeric': 0.09649237188681706, 'fraction_numerical': 0.002086321554309558, 'mean_word_length': 6.461089494163424, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2654415', 'n_tokens_mistral': 2663, 'n_tokens_neox': 2534, 'n_words': 311}