Examples of solve()


Examples of org.apache.commons.math.linear.DecompositionSolver.solve()

    direction.normalize();
    RealMatrix coefficients = new Array2DRowRealMatrix(new double[][] { { direction.getX(), -(sideVectX) },
        { direction.getY(), -(sideVectY) } }, false);
    DecompositionSolver solver = new LUDecompositionImpl(coefficients).getSolver();
    RealVector constants = new ArrayRealVector(new double[] { sideX - roboter1.getX(), sideY - roboter1.getY() }, false);
    RealVector solution = solver.solve(constants);

    double r = solution.getEntry(0);
    // double s = solution.getEntry(1);

    double res1 = roboter1.getX() + direction.getX() * r;
 
View Full Code Here

Examples of org.apache.commons.math.linear.RealMatrixImpl.solve()

            }

            try {

                // solve the linearized least squares problem
                RealMatrix dX = a.solve(b);

                // update the estimated parameters
                for (int i = 0; i < parameters.length; ++i) {
                    parameters[i].setEstimate(parameters[i].getEstimate() + dX.getEntry(i, 0));
                }
View Full Code Here

Examples of org.apache.mahout.math.QRDecomposition.solve()

    Matrix b = m.viewPart(0, rows, 0, 1);

    Matrix ata = a.transpose().times(a);
    Matrix atb = a.transpose().times(b);
    QRDecomposition s = new QRDecomposition(ata);
    Matrix r = s.solve(atb).transpose();
    assertEquals(expectedCoefficient, r.get(0, 0), 0.2);
    return r.times(new DenseVector(new double[]{Math.log(currentIndex), 1})).get(0);
  }

  private static int hapaxCount(ChineseRestaurant s) {
View Full Code Here

Examples of org.apache.mahout.math.als.AlternateLeastSquaresSolver.solve()

              List<Vector> featureVectors = new ArrayList<Vector>();
              while (itemIDsFromUser.hasNext()) {
                long itemID = itemIDsFromUser.nextLong();
                featureVectors.add(features.getItemFeatureColumn(itemIndex(itemID)));
              }
              Vector userFeatures = solver.solve(featureVectors, ratingVector(userPrefs), lambda, numFeatures);
              features.setFeatureColumnInU(userIndex(userID), userFeatures);
            }
          });
        }
      } finally {
View Full Code Here

Examples of org.apache.mahout.math.als.AlternatingLeastSquaresSolver.solve()

              List<Vector> featureVectors = Lists.newArrayList();
              while (itemIDsFromUser.hasNext()) {
                long itemID = itemIDsFromUser.nextLong();
                featureVectors.add(features.getItemFeatureColumn(itemIndex(itemID)));
              }
              Vector userFeatures = solver.solve(featureVectors, ratingVector(userPrefs), lambda, numFeatures);
              features.setFeatureColumnInU(userIndex(userID), userFeatures);
            }
          });
        }
      } finally {
View Full Code Here

Examples of org.apache.mahout.math.als.ImplicitFeedbackAlternatingLeastSquaresSolver.solve()

                long itemID = itemIDsFromUser.nextLong();
                featureVectors.add(features.getItemFeatureColumn(itemIndex(itemID)));
              }

              Vector userFeatures = usesImplicitFeedback
                  ? implicitFeedbackSolver.solve(sparseUserRatingVector(userPrefs))
                  : AlternatingLeastSquaresSolver.solve(featureVectors, ratingVector(userPrefs), lambda, numFeatures);

              features.setFeatureColumnInU(userIndex(userID), userFeatures);
            }
          });
View Full Code Here

Examples of org.apache.mahout.math.hadoop.stochasticsvd.qr.GivensThinSolver.solve()

    m.setQuick(2, 0, 7);
    m.setQuick(2, 1, 8);
    m.setQuick(2, 2, 9);

    GivensThinSolver qrSolver = new GivensThinSolver(m.rowSize(), m.columnSize());
    qrSolver.solve(m);

    Matrix qtm = new DenseMatrix(qrSolver.getThinQtTilde());

    assertOrthonormality(qtm.transpose(), false, SVD_EPSILON);
View Full Code Here

Examples of org.drools.planner.core.Solver.solve()

                        statistic = solverStatisticType.create();
                        unsolvedSolutionFileToStatisticMap.put(unsolvedSolutionFile, statistic);
                    }
                    statistic.addListener(solver, solverBenchmark.getName());
                }
                solver.solve();
                result.setTimeMillisSpend(solver.getTimeMillisSpend());
                Solution solvedSolution = solver.getBestSolution();
                result.setScore(solvedSolution.getScore());
                if (solverStatisticType != SolverStatisticType.NONE) {
                    SolverStatistic statistic = unsolvedSolutionFileToStatisticMap.get(unsolvedSolutionFile);
View Full Code Here

Examples of org.drools.planner.core.phase.SolverPhase.solve()

    protected void runSolverPhases() {
        Iterator<SolverPhase> it = solverPhaseList.iterator();
        while (!termination.isSolverTerminated(solverScope) && it.hasNext()) {
            SolverPhase solverPhase = it.next();
            solverPhase.solve(solverScope);
            if (it.hasNext()) {
                solverScope.setWorkingSolutionFromBestSolution();
            }
        }
        // TODO support doing round-robin of phases (only non-construction heuristics)
View Full Code Here

Examples of org.drools.solver.core.Solver.solve()

        configurer.configure(SOLVER_CONFIG);
        Solver solver = configurer.buildSolver();
        SolutionDao solutionDao = new XstreamSolutionDaoImpl();
        Solution startingSolution = solutionDao.readSolution(getClass().getResourceAsStream(UNSOLVED_DATA));
        solver.setStartingSolution(startingSolution);
        solver.solve();
        Solution bestSolution = solver.getBestSolution();
        assertNotNull(bestSolution);
        double bestScore = solver.getBestScore();
        assertEquals(0.0, bestScore);
    }
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.