Examples of multiply()


Examples of com.vividsolutions.jts.math.Vector2D.multiply()

  public void addSide(int level, Coordinate p0, Coordinate p1) {
    if (level == 0)
      addSegment(p0, p1);
    else {
      Vector2D base = Vector2D.create(p0, p1);
      Coordinate midPt = base.multiply(0.5).translate(p0);
     
      Vector2D heightVec = base.multiply(THIRD_HEIGHT);
      Vector2D offsetVec = heightVec.rotateByQuarterCircle(1);
      Coordinate offsetPt = offsetVec.translate(midPt);
     
View Full Code Here

Examples of com.zaranux.client.crypto.util.BigInteger.multiply()

        // m = m2 + q * h
        BigInteger m = h.multiply(q).add(m2);

        if (params != null) {
            m = m.multiply(params.rInv).mod(n);
        }

        return toByteArray(m, getByteLength(n));
    }

View Full Code Here

Examples of de.abg.jreichert.junit4runner.Multiplier.multiply()

public class MultiplierTest extends TestCase {

  public void testSum() {
    Multiplier multiplier = new Multiplier();
    BigDecimal product = multiplier.multiply(new BigDecimal(5), new BigDecimal(7));
    Assert.assertEquals("expected product", new BigDecimal(35), product);
  }
}
View Full Code Here

Examples of de.jungblut.math.DoubleMatrix.multiply()

        negativeAssociations).divide(data.getRowCount());

    // calculate the weight decay and apply it
    if (lambda != 0d) {
      DoubleVector bias = thetaGradient.getColumnVector(0);
      thetaGradient = thetaGradient.subtract(thetaGradient.multiply(lambda
          / data.getRowCount()));
      thetaGradient.setColumnVector(0, bias);
    }

    // transpose the gradient and negate it, because we transposed theta at the
View Full Code Here

Examples of de.jungblut.math.DoubleVector.multiply()

    DoubleVector df1 = evaluateCost.getGradient();
    i = i + (length < 0 ? 1 : 0);
    // search direction is steepest
    DoubleVector s = df1.multiply(-1.0d);

    double d1 = s.multiply(-1.0d).dot(s); // this is the slope
    double z1 = red / (1.0 - d1); // initial step is red/(|s|+1)

    while (i < Math.abs(length)) {// while not finished
      i = i + (length > 0 ? 1 : 0);// count iterations?!
      // make a copy of current values
View Full Code Here

Examples of de.tuhrig.thofu.types.LObject.multiply()

            n = token.run(environment, token);
          }
          else {

            n = n.multiply(token.run(environment, token));
          }
        }

        return n;
      }
View Full Code Here

Examples of engine.geometry.Vector.multiply()

           
            Vector normal = MagrayPhysics.computeNormal(other.getCircle(), centre, direction, time);
           
            double strength = timeToStrength(time, power);
            double accelOther = strength / (1 + other.getMass()/dynamic.getMass());
            other.addVelocity(normal.multiply(accelOther));
           
            double accelDynamic = strength / (1 + dynamic.getMass()/other.getMass());
            // TODO: find a better way of combining forces
            if (Math.abs(accelDynamic) > Math.abs(maxAccelDynamic)) {
                maxAccelDynamic = accelDynamic;
View Full Code Here

Examples of fj.data.Natural.multiply()

    Stream<Natural> ns = cons(p, ps);
    Stream<Natural> ret = nil();
    while (ns.isNotEmpty() && ret.isEmpty()) {
      final Natural h = ns.head();
      final P1<Stream<Natural>> t = ns.tail();
      if (naturalOrd.isGreaterThan(h.multiply(h), n))
        ret = single(n);
      else {
        final V2<Natural> dm = n.divmod(h);
        if (naturalOrd.eq(dm._2(), ZERO))
          ret = cons(h, new P1<Stream<Natural>>() {
View Full Code Here

Examples of java.math.BigDecimal.multiply()

          computedResult = new BigDecimal(n.toString());
        }
        else
        {
          //noinspection ObjectToString
          computedResult = computedResult.multiply(new BigDecimal(n.toString()));
        }
      }
    }

    if (computedResult != null)
View Full Code Here

Examples of java.math.BigInteger.multiply()

        }
        BigInteger x = new BigInteger("" + n);
        BigInteger result = x;
        for (int i = n - 1; i >= 2; i--) {
            x = x.subtract(BigInteger.ONE);
            result = result.multiply(x);
        }
        return result;
    }

}
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.