Examples of multiply()


Examples of com.opengamma.analytics.math.matrix.ColtMatrixAlgebra.multiply()

    ColtMatrixAlgebra colt = new ColtMatrixAlgebra();
    DoubleMatrix1D v = new DoubleMatrix1D(ARRAY_1D);
    DoubleMatrix2D m = new DoubleMatrix2D(ARRAY_2D);

    out.println(colt.getTranspose(m));
    out.println(colt.multiply(m, v));
  }

  public static void main(String[] args) {
    initMatrixDemo(System.out);
    matrixAlgebraDemo(System.out);
View Full Code Here

Examples of com.opengamma.analytics.math.matrix.CommonsMatrixAlgebra.multiply()

      dPvCaldRho[loopcal][loopcal] = dPvCaldSABR[loopcal].getRho().getMap().get(keys[0]);
      dPvCaldNu[loopcal][loopcal] = dPvCaldSABR[loopcal].getNu().getMap().get(keys[0]);
    }
    final DoubleMatrix1D dPvAmdLambdaMatrix = new DoubleMatrix1D(dPvAmdLambda);
    final DoubleMatrix2D dPvCaldAlphaMatrix = new DoubleMatrix2D(dPvCaldAlpha);
    final DoubleMatrix2D dLambdadAlphaMatrix = (DoubleMatrix2D) matrix.multiply(dPvCaldLambdaMatrixInverse, dPvCaldAlphaMatrix);
    final DoubleMatrix2D dPvAmdAlphaMatrix = (DoubleMatrix2D) matrix.multiply(matrix.getTranspose(dLambdadAlphaMatrix), dPvAmdLambdaMatrix);
    final DoubleMatrix2D dPvCaldRhoMatrix = new DoubleMatrix2D(dPvCaldRho);
    final DoubleMatrix2D dLambdadRhoMatrix = (DoubleMatrix2D) matrix.multiply(dPvCaldLambdaMatrixInverse, dPvCaldRhoMatrix);
    final DoubleMatrix2D dPvAmdRhoMatrix = (DoubleMatrix2D) matrix.multiply(matrix.getTranspose(dLambdadRhoMatrix), dPvAmdLambdaMatrix);
    final DoubleMatrix2D dPvCaldNuMatrix = new DoubleMatrix2D(dPvCaldNu);
View Full Code Here

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

    final double[] iborTime = lmm.getIborTime();
    final double[] almm = lmm.getDisplacement();
    final double[] deltalmm = lmm.getAccrualFactor();
    final DoubleMatrix2D gammaLMM = new DoubleMatrix2D(lmm.getVolatility());
    final MatrixAlgebra algebra = new CommonsMatrixAlgebra();
    final DoubleMatrix2D s = (DoubleMatrix2D) algebra.multiply(gammaLMM, algebra.getTranspose(gammaLMM));
    final int nbJump = jumpTime.length - 1;
    final int nbPath = initIbor[0].length;
    final int nbPeriodLMM = lmm.getNbPeriod();
    final int nbFactorLMM = lmm.getNbFactor();
    final double[] dt = new double[nbJump];
View Full Code Here

Examples of com.opengamma.analytics.math.matrix.OGMatrixAlgebra.multiply()

    final DoubleMatrix2D fDmatrix = new DoubleMatrix2D(fD);
    // Derivative of abc with respect to forward
    final ColtMatrixAlgebra algebra = new ColtMatrixAlgebra();
    final DoubleMatrix2D fDInverse = algebra.getInverse(fDmatrix);
    final OGMatrixAlgebra algebraOG = new OGMatrixAlgebra();
    final DoubleMatrix1D derivativeF = (DoubleMatrix1D) algebraOG.multiply(fDInverse, pDFvector);
    return derivativeF.getData();
  }

  /**
   * Computes the derivative of the three fitting parameters with respect to the SABR parameters.
View Full Code Here

Examples of com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeries.multiply()

    final Set<String> returnCalculatorNames = desiredValue.getConstraints().getValues(ValuePropertyNames.RETURN_CALCULATOR);
    final TimeSeriesReturnCalculator returnCalculator = getTimeSeriesReturnCalculator(returnCalculatorNames);
    final LocalDateDoubleTimeSeries returnSeries = (LocalDateDoubleTimeSeries) returnCalculator.evaluate((LocalDateDoubleTimeSeries) priceSeriesObj);
    final ValueSpecification resultSpec = new ValueSpecification(ValueRequirementNames.PNL_SERIES, target.toSpecification(), desiredValue.getConstraints());
    //final Object result = returnSeries.multiply(fairValue);
    final Object result = returnSeries.multiply(fairValue).multiply(target.getPosition().getQuantity().doubleValue());
    return Collections.singleton(new ComputedValue(resultSpec, result));
  }

  private TimeSeriesReturnCalculator getTimeSeriesReturnCalculator(final Set<String> calculatorNames) {
    if (calculatorNames == null || calculatorNames.isEmpty() || calculatorNames.size() != 1) {
View Full Code Here

Examples of com.sk89q.craftbook.util.Vector.multiply()

                    "The blocks for the door to the sides have to be the same.");
        }

        // Detect whether the door needs to be opened
        if (toOpen == null) {
            toOpen = !canPassThrough(world.getId(pt.add(vertDir.multiply(2))));
        }

        Vector cur = pt.add(vertDir.multiply(2));
        boolean found = false;
        int dist = 0;
View Full Code Here

Examples of com.sk89q.worldedit.Vector.multiply()

        final double remainder = position - index1;

        final Vector position1 = nodes.get(index1).getPosition();
        final Vector position2 = nodes.get(index1 + 1).getPosition();

        return position1.multiply(1.0 - remainder).add(position2.multiply(remainder));
    }

    /*
    Formula for position:
        p1*(1-t) + p2*t
 
View Full Code Here

Examples of com.sk89q.worldedit.Vector2D.multiply()

        final List<BlockVector2D> points = new ArrayList<BlockVector2D>(nPoints);
        for (int i = 0; i < nPoints; ++i) {
            double angle = i * (2.0 * Math.PI) / nPoints;
            final Vector2D pos = new Vector2D(Math.cos(angle), Math.sin(angle));
            final BlockVector2D blockVector2D = pos.multiply(radius).add(center).toBlockVector2D();
            points.add(blockVector2D);
        }

        return points;
    }
View Full Code Here

Examples of com.thecrouchmode.vector.Matrix4f.multiply()

          Matrix4f camRot = Quaternion.product(
              new Quaternion(-Mouse.getDX()/(600*Math.PI), Vector3f.yUnit),
              new Quaternion(Mouse.getDY()/(600*Math.PI), camSide)).normalize().rotationMatrix();
         
          view = Matrix4f.product();
          camForw = camRot.multiply(camForw, 1).xyz();
          camSide = camRot.multiply(camSide, 1).xyz();
         
          view = Matrix4f.view(
              trans,
              camForw,
View Full Code Here

Examples of com.thecrouchmode.vector.Quaternion.multiply()

    Quaternion p = new Quaternion(1, 2, 3, 4);
    Quaternion q = new Quaternion(3, 5, 6, 4);
   
    System.out.println(p.conjugate().conjugate());
    System.out.println(p.multiply(q));
    System.out.println(q.multiply(p));
    System.out.println(p.multiply(q).conjugate());
    System.out.println(q.conjugate().multiply(p.conjugate()));

    Quaternion r = p.normalize();
 
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.