Examples of divide()


Examples of org.apache.mahout.matrix.DenseVector.divide()

   */
  public Vector computeBoundCentroid() {
    Vector result = new DenseVector(center.cardinality());
    for (Vector v : boundPoints)
      result.assign(v, new PlusFunction());
    return result.divide(boundPoints.size());
  }

  /**
   * Compute the centroid by normalizing the pointTotal
   *
 
View Full Code Here

Examples of org.apache.mahout.matrix.Vector.divide()

   */
  public Vector computeBoundCentroid() {
    Vector result = new DenseVector(center.cardinality());
    for (Vector v : boundPoints)
      result.assign(v, new PlusFunction());
    return result.divide(boundPoints.size());
  }

  /**
   * Compute the centroid by normalizing the pointTotal
   *
 
View Full Code Here

Examples of org.apache.sis.internal.util.DoubleDouble.divide()

    final DoubleDouble period(final Date time) {
        if (time != null) {
            final long millis = time.getTime() - timeReference;
            if (millis != 0) { // Returns null for 0 as an optimization.
                final DoubleDouble period = new DoubleDouble(millis, 0);
                period.divide(1000 * JULIAN_YEAR_LENGTH, 0);
                return period;
            }
        }
        return null;
    }
View Full Code Here

Examples of org.cmj.flowy.simulation.math.Vector2.divide()

    positionOld.y = origPosY;
   
    // calculate velocity
    // Velocity = (Position - PositionOld) / dt;
    temp = Vector2.Subtract(position, positionOld);
    temp.divide(timeStep);
    velocity.setFromVector(temp);
  }

}
View Full Code Here

Examples of org.drools.planner.benchmark.core.measurement.ScoreDifferencePercentage.divide()

                }
            }
        }
        if (!firstNonFailure) {
            int successCount = getSuccessCount();
            averageWorstScoreDifferencePercentage = totalWorstScoreDifferencePercentage.divide((double) successCount);
            averageAverageCalculateCountPerSecond = totalAverageCalculateCountPerSecond / (long) successCount;
        }
    }

    public int getSuccessCount() {
View Full Code Here

Examples of org.earth3d.jearth.math.Point3D.divide()

      TextureTreeNodeCore texcore = (TextureTreeNodeCore) getCore(0);
      Point3D center = new Point3D();
      for(int i=0; i<4; i++) {
        center.add(texcore.getVertex(i));
      }
      center = center.divide(4);

      double radius=0, newradius;
      for(int i=0; i<4; i++) {
        newradius = texcore.getVertex(i).sub(center).length();
        if (newradius>radius) radius = newradius;
View Full Code Here

Examples of org.ejml.simple.SimpleMatrix.divide()

            SimpleMatrix v = QR.extractMatrix(i, END,i,i+1);
            double max = v.elementMaxAbs();

            if( max > 0 && v.getNumElements() > 1 ) {
                // normalize to reduce overflow issues
                v = v.divide(max);

                // compute the magnitude of the vector
                double tau = v.normF();

                if( v.get(0) < 0 )
View Full Code Here

Examples of org.h2.value.ValueTime.divide()

        assertEquals(1, t1.getSignum());
        assertEquals(-1, t1.negate().getSignum());
        assertEquals(0, t1.multiply(ValueInt.get(0)).getSignum());
        assertEquals(0, t1.subtract(t1).getSignum());
        assertEquals("05:35:35.5", t1.multiply(ValueDouble.get(0.5)).getString());
        assertEquals("22:22:22", t1.divide(ValueDouble.get(0.5)).getString());
        assertEquals("-11:11:11", t1.negate().getString());
        assertEquals("11:11:11", t1.negate().negate().getString());
        assertEquals(Value.TIME, t1.getType());
        long nanos = t1.getNanos();
        assertEquals((int) ((nanos >>> 32) ^ nanos), t1.hashCode());
View Full Code Here

Examples of org.hsqldb.types.Type.divide()

                    temp   = opType.convertToType(session, temp, subType);
                    temp2  = opType.convertToType(session, temp2, subType);
                }

                temp = opType.multiply(temp, data[3]);
                temp = opType.divide(session, temp, temp2);
                temp = dataType.convertToDefaultType(session, temp);

                return dataType.add(session, temp, ValuePool.INTEGER_1,
                                    Type.SQL_INTEGER);
            }
View Full Code Here

Examples of org.jamesii.core.math.complex.ComplexArray1D.divide()

  public void testDivideExceptions() {
    ComplexArray1D a = new ComplexArray1D(new Complex[] { new Complex(1, 1) });

    // testing divide(int, double, double, double, double)
    try {
      a.divide(-1, 2d, 3d, 1d, 2d);
      fail();
    } catch (IndexOutOfBoundsException e) {
      assertTrue(true);
    } catch (Exception e) {
      fail();
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.