Package com.opengamma.analytics.math.matrix

Examples of com.opengamma.analytics.math.matrix.MatrixAlgebra.scale()


   */
  public SimpleParameterSensitivity multipliedBy(final double factor) {
    final MatrixAlgebra algebra = MatrixAlgebraFactory.COMMONS_ALGEBRA;
    final LinkedHashMap<String, DoubleMatrix1D> result = new LinkedHashMap<>();
    for (final String nameCcy : _sensitivity.keySet()) {
      result.put(nameCcy, (DoubleMatrix1D) algebra.scale(_sensitivity.get(nameCcy), factor));
    }
    return new SimpleParameterSensitivity(result);
  }

  /**
 
View Full Code Here


   */
  public MultipleCurrencyParameterSensitivity multipliedBy(final double factor) {
    final MatrixAlgebra algebra = MatrixAlgebraFactory.COMMONS_ALGEBRA;
    final LinkedHashMap<Pair<String, Currency>, DoubleMatrix1D> result = new LinkedHashMap<>();
    for (final Pair<String, Currency> nameCcy : _sensitivity.keySet()) {
      result.put(nameCcy, (DoubleMatrix1D) algebra.scale(_sensitivity.get(nameCcy), factor));
    }
    return new MultipleCurrencyParameterSensitivity(result);
  }

  /**
 
View Full Code Here

    final MatrixAlgebra algebra = MatrixAlgebraFactory.COMMONS_ALGEBRA;
    for (final Map.Entry<Pair<String, Currency>, DoubleMatrix1D> entry : _sensitivity.entrySet()) {
      final Pair<String, Currency> nameCcy = entry.getKey();
      final double fxRate = fxMatrix.getFxRate(nameCcy.getSecond(), ccy);
      final Pair<String, Currency> nameCcyNew = Pair.of(nameCcy.getFirst(), ccy);
      final DoubleMatrix1D sensitivityNew = (DoubleMatrix1D) algebra.scale(entry.getValue(), fxRate);
      result = result.plus(nameCcyNew, sensitivityNew);
    }
    return result;
  }
View Full Code Here

      if (map2.get(nameCcy) == null) {
        if (algebra.getNormInfinity(entry.getValue()) > tolerance) {
          cmp = false;
        }
      } else {
        if (algebra.getNormInfinity(algebra.add(entry.getValue(), algebra.scale(map2.get(nameCcy), -1.0))) > tolerance) {
          cmp = false;
        }
      }
    }
    for (final Map.Entry<Pair<String, Currency>, DoubleMatrix1D> entry : map2.entrySet()) {
View Full Code Here

      if (map1.get(nameCcy) == null) {
        if (algebra.getNormInfinity(entry.getValue()) > tolerance) {
          cmp = false;
        }
      } else {
        if (algebra.getNormInfinity(algebra.add(entry.getValue(), algebra.scale(map1.get(nameCcy), -1.0))) > tolerance) {
          cmp = false;
        }
      }
    }
    if (opposite) {
View Full Code Here

      if (map2.get(name) == null) {
        if (algebra.getNormInfinity(entry.getValue()) > tolerance) {
          cmp = false;
        }
      } else {
        if (algebra.getNormInfinity(algebra.add(entry.getValue(), algebra.scale(map2.get(name), -1.0))) > tolerance) {
          cmp = false;
        }
      }
    }
    if (opposite) {
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.