Package com.opengamma.financial.analytics

Examples of com.opengamma.financial.analytics.StringLabelledMatrix1D


      }
      final String labelsTitle = message.getString(LABELS_TITLE_FIELD_NAME);
      final String valuesTitle = message.getString(VALUES_TITLE_FIELD_NAME);
      final String[] keysArray = keys.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
      final double[] valuesArray = Doubles.toArray(values);
      return new StringLabelledMatrix1D(keysArray, keysArray, labelsTitle, valuesArray, valuesTitle);
    }
View Full Code Here


  @Test
  public void testString() {
    final String[] keys = new String[] {"A", "B", "C", "D", "E"};
    final double[] values = new double[] {0.1, 0.2, 0.3, 0.4, 0.5};
    final StringLabelledMatrix1D m1 = new StringLabelledMatrix1D(keys, values);
    final StringLabelledMatrix1D m2 = cycleObject(StringLabelledMatrix1D.class, m1);
    assertEquals(m1, m2);
    final StringLabelledMatrix1D m3 = new StringLabelledMatrix1D(keys, "labels", values, "values");
    final StringLabelledMatrix1D m4 = cycleObject(StringLabelledMatrix1D.class, m3);
    assertEquals(m3, m4);
  }
View Full Code Here

        } else {
          s_logger.error("Value was null when getting required input data " + factor.getExposureExternalId());
        }
      }
    }
    final StringLabelledMatrix1D labelledMatrix = new StringLabelledMatrix1D(indices.toArray(new String[] {}), labels.toArray(), values.toDoubleArray());
    final ValueSpecification valueSpecification = new ValueSpecification(EXTERNAL_SENSITIVITIES_REQUIREMENT, target.toSpecification(), createCurrencyValueProperties(target).get());
    return Collections.singleton(new ComputedValue(valueSpecification, labelledMatrix));
  }
View Full Code Here

        } else {
          s_logger.error("Value was null when getting required input data " + factor.getExposureExternalId());
        }
      }
    }
    final StringLabelledMatrix1D labelledMatrix = new StringLabelledMatrix1D(indices.toArray(new String[] {}), labels.toArray(), values.toDoubleArray());
    final ValueSpecification valueSpecification = new ValueSpecification(CREDIT_SENSITIVITIES_REQUIREMENT, target.toSpecification(), createCurrencyValueProperties(target).get());
    return Collections.singleton(new ComputedValue(valueSpecification, labelledMatrix));
  }
View Full Code Here

    final ComputationTargetSpecification specification = target.toSpecification();
    final Object value = inputs.getValue(new ValueRequirement(CREDIT_REQUIREMENT, specification));
    if (!(value instanceof LabelledMatrix1D)) {
      throw new OpenGammaRuntimeException("Yield Curve Node Sensitivities result was not of type LabelledMatrix1D");
    }
    final StringLabelledMatrix1D ycns = (StringLabelledMatrix1D) value;
    final double result = sum(ycns.getValues());
    final ValueProperties properties = createCurrencyValueProperties(target).get();
    final ComputedValue computedValue = new ComputedValue(new ValueSpecification(CS01_REQUIREMENT, specification, properties), result);
    return Collections.singleton(computedValue);
  }
View Full Code Here

    }
    final String[] label = new String[n];
    for (int i = 0; i < n; i++) {
      label[i] = deliverables.get(i).getIdentifiers().getValue(ExternalSchemes.BLOOMBERG_BUID);
    }
    final StringLabelledMatrix1D result = new StringLabelledMatrix1D(label, netBasis);
    return Sets.newHashSet(new ComputedValue(getResultSpec(target), result));
  }
View Full Code Here

    }
    final String[] label = new String[n];
    for (int i = 0; i < n; i++) {
      label[i] = deliverables.get(i).getIdentifiers().getValue(ExternalSchemes.BLOOMBERG_BUID); //TODO get a better label
    }
    final StringLabelledMatrix1D result = new StringLabelledMatrix1D(label, grossBasis);
    return Sets.newHashSet(new ComputedValue(getResultSpec(target), result));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.analytics.StringLabelledMatrix1D

Copyright © 2018 www.massapicom. 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.