Examples of subtract()


Examples of org.apache.examples.Calculator.subtract()

       
        Calculator calculator = registry.getService(Calculator.class);

        System.out.println("Inputs:   " + arg0 + " and " + arg1);
        System.out.println("Add:      " + calculator.add(arg0, arg1));
        System.out.println("Subtract: " + calculator.subtract(arg0, arg1));
        System.out.println("Multiply: " + calculator.multiply(arg0, arg1));
        System.out.println("Divide:   " + calculator.divide(arg0, arg1));


        registry.shutdown();
View Full Code Here

Examples of org.apache.hama.commons.math.DenseDoubleVector.subtract()

   
    double errorInstance = 0;
    for (double[] instance : instanceList) {
      DoubleVector vector = new DenseDoubleVector(instance);
      DoubleVector decoded = encoder.getOutput(vector);
      DoubleVector diff = vector.subtract(decoded);
      double error = diff.dot(diff);
      if (error > 0.1) {
        ++errorInstance;
      }
    }
View Full Code Here

Examples of org.apache.hama.ml.math.DenseDoubleVector.subtract()

   
    double errorInstance = 0;
    for (double[] instance : instanceList) {
      DoubleVector vector = new DenseDoubleVector(instance);
      DoubleVector decoded = encoder.getOutput(vector);
      DoubleVector diff = vector.subtract(decoded);
      double error = diff.dot(diff);
      if (error > 0.1) {
        ++errorInstance;
      }
    }
View Full Code Here

Examples of org.apache.hama.ml.math.DoubleVector.subtract()

    // finally check for convergence by the absolute difference
    long convergedCounter = 0L;
    for (int i = 0; i < msgCenters.length; i++) {
      final DoubleVector oldCenter = centers[i];
      if (msgCenters[i] != null) {
        double calculateError = oldCenter.subtract(msgCenters[i]).abs().sum();
        if (calculateError > 0.0d) {
          centers[i] = msgCenters[i];
          convergedCounter++;
        }
      }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.drawing.Location.subtract()

    private void moveDragView() {
        if (dragView != null) {
            dragView.markDamaged();
            final Location newLocation = new Location(this.location);
            newLocation.subtract(offset);
            dragView.setLocation(newLocation);
            dragView.limitBoundsWithin(workspace.getSize());
            dragView.markDamaged();
        }
    }
View Full Code Here

Examples of org.apache.myfaces.tobago.layout.Measure.subtract()

          writer.writeClassAttribute(Classes.create(sheet, "headerCell"));
          writer.startElement(HtmlElements.SPAN, null);
          Style headerStyle = new Style();
          Measure headerHeight = Measure.valueOf(20).multiply(cell.getRowSpan());
          if (!pure) {
            headerHeight = headerHeight.subtract(6); // XXX todo
          }
          headerStyle.setHeight(headerHeight);
          writer.writeStyleAttribute(headerStyle);
          final AbstractUIColumn column = renderedColumnList.get(j);
          String sorterImage = null;
View Full Code Here

Examples of org.apache.pivot.util.Time.subtract()

        time = Time.decode(time.toString());
        System.out.println(time);

        time = new Time(0, 0, 0);
        System.out.println(time.subtract(new Time(0, 0, 1)));
        System.out.println(time.subtract(new Time(23, 59, 59, 999)));

        time = new Time(0, 0, 0);
        System.out.println(time.add(1));
        System.out.println(time.add(Time.MILLISECONDS_PER_DAY + 1));
View Full Code Here

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

                final int upRowOffset = j*innerSize;    // Offset of a row before (locate upper) the current row.
                acc.setFrom(LU, j*size + k, errorLU);   // Same column than the diagonal element, but in the upper row.
                for (int i=0; i<innerSize; i++) {       // Apply to all columns in the upper row.
                    rat.setFrom(elements, rowOffset + i, errorOffset);
                    rat.multiply(acc);
                    rat.subtract(elements, upRowOffset + i, errorOffset);
                    rat.negate();
                    rat.storeTo(elements, upRowOffset + i, errorOffset);
                }
            }
        }
View Full Code Here

Examples of org.broadleafcommerce.common.money.Money.subtract()

       
        setTaxSums(order);
       
        Money total = BroadleafCurrencyUtils.getMoney(BigDecimal.ZERO, order.getCurrency());
        total = total.add(order.getSubTotal());
        total = total.subtract(order.getOrderAdjustmentsValue());
        total = total.add(order.getTotalShipping());
        // There may not be any taxes on the order
        if (order.getTotalTax() != null) {
            total = total.add(order.getTotalTax());
        }
View Full Code Here

Examples of org.bukkit.Location.subtract()

    @Override
    public boolean generate() {
        Location l = loc.clone();
        while ((l.getBlock().getType() == Material.AIR || l.getBlock().getType() == Material.LEAVES) && l.getBlockY() > 0) {
            l.subtract(0, 1, 0);
        }

        // check only below block
        if (!canPlaceOn()) {
            return false;
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.