Examples of multiply()


Examples of org.apache.commons.math3.analysis.polynomials.PolynomialFunction.multiply()

        // build the polynomials by iterating on the top diagonal of the divided differences array
        for (int i = 0; i < topDiagonal.size(); ++i) {
            double[] tdi = topDiagonal.get(i);
            for (int k = 0; k < polynomials.length; ++k) {
                polynomials[k] = polynomials[k].add(coeff.multiply(polynomial(tdi[k])));
            }
            coeff = coeff.multiply(polynomial(-abscissae.get(i), 1.0));
        }

        return polynomials;
View Full Code Here

Examples of org.apache.commons.math3.complex.Complex.multiply()

                for (int j = n-1; j >= 0; j--) {
                    d2v = dv.add(z.multiply(d2v));
                    dv = pv.add(z.multiply(dv));
                    pv = coefficients[j].add(z.multiply(pv));
                }
                d2v = d2v.multiply(new Complex(2.0, 0.0));

                // Check for convergence.
                final double tolerance = FastMath.max(relativeAccuracy * z.abs(),
                                                      absoluteAccuracy);
                if ((z.subtract(oldz)).abs() <= tolerance) {
View Full Code Here

Examples of org.apache.commons.math3.dfp.Dfp.multiply()

        Dfp baseDfp = field.newDfp(base);
        Dfp dfpPower = field.getOne();
        for (int i = 0; i < maxExp; i++) {
            Assert.assertEquals("exp=" + i, dfpPower.toDouble(), FastMath.pow(base, i),
                                0.6 * FastMath.ulp(dfpPower.toDouble()));
            dfpPower = dfpPower.multiply(baseDfp);
        }
    }

    @Test
    public void testIncrementExactInt() {
View Full Code Here

Examples of org.apache.commons.math3.fraction.BigFraction.multiply()

            BigFraction ck     = coefficients.get(startK);
            BigFraction ckm1   = coefficients.get(startKm1);

            // degree 0 coefficient
            coefficients.add(ck.multiply(ai[0]).subtract(ckm1.multiply(ai[2])));

            // degree 1 to degree k-1 coefficients
            for (int i = 1; i < k; ++i) {
                final BigFraction ckPrev = ck;
                ck     = coefficients.get(startK + i);
View Full Code Here

Examples of org.apache.commons.math3.linear.Array2DRowRealMatrix.multiply()

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < k; j++) {
                    final RealMatrix vec
                        = new Array2DRowRealMatrix(MathArrays.ebeSubtract(data[i], newMeans[j]));
                    final RealMatrix dataCov
                        = vec.multiply(vec.transpose()).scalarMultiply(gamma[i][j]);
                    newCovMats[j] = newCovMats[j].add(dataCov);
                }
            }

            // Converting to arrays for use by fitted model
View Full Code Here

Examples of org.apache.commons.math3.linear.RealMatrix.multiply()

            }
        }

        // Compute and return Hat matrix
        // No DME advertised - args valid if we get here
        return Q.multiply(augI).multiply(Q.transpose());
    }

    /**
     * <p>Returns the sum of squared deviations of Y from its mean.</p>
     *
 
View Full Code Here

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

        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.fop.area.CTM.multiply()

            if (bv.getPositioning() == Block.FIXED) {
                breakOutList = breakOutOfStateStack();
            }
           
            CTM tempctm = new CTM(containingIPPosition, containingBPPosition);
            ctm = tempctm.multiply(ctm);

            //Adjust for spaces (from margin or indirectly by start-indent etc.
            x += bv.getSpaceStart() / 1000f;
            currentIPPosition += bv.getSpaceStart();
           
View Full Code Here

Examples of org.apache.geronimo.calculator.Calculator.multiply()

        Document refParam = TestUtils.createDocument(REF_PARAM);
        builder.referenceParameter(refParam.getDocumentElement());
        EndpointReference epr = builder.build();
       
        Calculator calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(36, calc.multiply(6, 6));
    }
       
    public void testDispatch() throws Exception {
        Dispatch<SOAPMessage> dispatch = null;
        SOAPMessage request = null;
View Full Code Here

Examples of org.apache.hama.commons.math.DoubleMatrix.multiply()

      DoubleVector[] Mtransposed = new DenseDoubleVector[rank];
      for (int i = 0; i<rank; i++) {
        Mtransposed[i] = e.itemFeatureFactorized.getRowVector(i).multiply(aal_ml_xa.get(i));
      }
      tmp = new DenseDoubleMatrix(Mtransposed);
      tmp = tmp.multiply(2*TETTA*scoreDifference);
      res.itemFeatureFactorized = e.itemFeatureFactorized.add(tmp);
    }

    if (isAvailableUserFeature) {
      DoubleVector[] Mtransposed = new DenseDoubleVector[rank];
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.