当前位置: 首页>>代码示例>>Java>>正文


Java UnivariateSolver类代码示例

本文整理汇总了Java中org.apache.commons.math3.analysis.solvers.UnivariateSolver的典型用法代码示例。如果您正苦于以下问题:Java UnivariateSolver类的具体用法?Java UnivariateSolver怎么用?Java UnivariateSolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UnivariateSolver类属于org.apache.commons.math3.analysis.solvers包,在下文中一共展示了UnivariateSolver类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EventState

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/** Simple constructor.
 * @param handler event handler
 * @param maxCheckInterval maximal time interval between switching
 * function checks (this interval prevents missing sign changes in
 * case the integration steps becomes very large)
 * @param convergence convergence threshold in the event time search
 * @param maxIterationCount upper limit of the iteration count in
 * the event time search
 * @param solver Root-finding algorithm to use to detect state events
 */
public EventState(final EventHandler handler, final double maxCheckInterval,
                  final double convergence, final int maxIterationCount,
                  final UnivariateSolver solver) {
    this.handler           = handler;
    this.maxCheckInterval  = maxCheckInterval;
    this.convergence       = FastMath.abs(convergence);
    this.maxIterationCount = maxIterationCount;
    this.solver            = solver;

    // some dummy values ...
    expandable        = null;
    t0                = Double.NaN;
    g0                = Double.NaN;
    g0Positive        = true;
    pendingEvent      = false;
    pendingEventTime  = Double.NaN;
    previousEventTime = Double.NaN;
    increasing        = true;
    nextAction        = EventHandler.Action.CONTINUE;

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:32,代码来源:EventState.java

示例2: EventState

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/** Simple constructor.
 * @param handler event handler
 * @param maxCheckInterval maximal time interval between switching
 * function checks (this interval prevents missing sign changes in
 * case the integration steps becomes very large)
 * @param convergence convergence threshold in the event time search
 * @param maxIterationCount upper limit of the iteration count in
 * the event time search
 * @param solver Root-finding algorithm to use to detect state events
 */
public EventState(final EventHandler handler, final double maxCheckInterval,
                  final double convergence, final int maxIterationCount,
                  final UnivariateSolver solver) {
    this.handler           = handler;
    this.maxCheckInterval  = maxCheckInterval;
    this.convergence       = FastMath.abs(convergence);
    this.maxIterationCount = maxIterationCount;
    this.solver            = solver;

    // some dummy values ...
    t0                = Double.NaN;
    g0                = Double.NaN;
    g0Positive        = true;
    pendingEvent      = false;
    pendingEventTime  = Double.NaN;
    previousEventTime = Double.NaN;
    increasing        = true;
    nextAction        = EventHandler.Action.CONTINUE;

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:31,代码来源:EventState.java

示例3: addEventHandler

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void addEventHandler(final EventHandler function,
                            final double maxCheckInterval,
                            final double convergence,
                            final int maxIterationCount,
                            final UnivariateSolver solver) {
  super.addEventHandler(function, maxCheckInterval, convergence,
                        maxIterationCount, solver);

  // reinitialize the arrays
  initializeArrays();

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:15,代码来源:GraggBulirschStoerIntegrator.java

示例4: addEventHandler

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/** {@inheritDoc} */
public void addEventHandler(final EventHandler handler,
                            final double maxCheckInterval,
                            final double convergence,
                            final int maxIterationCount,
                            final UnivariateSolver solver) {
    eventsStates.add(new EventState(handler, maxCheckInterval, convergence,
                                    maxIterationCount, solver));
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:10,代码来源:AbstractIntegrator.java

示例5: NonLinearConjugateGradientOptimizer

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/**
 * @param updateFormula formula to use for updating the β parameter,
 * must be one of {@link ConjugateGradientFormula#FLETCHER_REEVES} or {@link
 * ConjugateGradientFormula#POLAK_RIBIERE}.
 * @param checker Convergence checker.
 * @param lineSearchSolver Solver to use during line search.
 * @param preconditioner Preconditioner.
 */
public NonLinearConjugateGradientOptimizer(final ConjugateGradientFormula updateFormula,
                                           ConvergenceChecker<PointValuePair> checker,
                                           final UnivariateSolver lineSearchSolver,
                                           final Preconditioner preconditioner) {
    super(checker);

    this.updateFormula = updateFormula;
    solver = lineSearchSolver;
    this.preconditioner = preconditioner;
    initialStep = 1.0;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:20,代码来源:NonLinearConjugateGradientOptimizer.java

示例6: NonLinearConjugateGradientOptimizer

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/**
 * @param updateFormula formula to use for updating the &beta; parameter,
 * must be one of {@link Formula#FLETCHER_REEVES} or
 * {@link Formula#POLAK_RIBIERE}.
 * @param checker Convergence checker.
 * @param lineSearchSolver Solver to use during line search.
 * @param preconditioner Preconditioner.
 * @deprecated as of 3.3. Please use
 * {@link #NonLinearConjugateGradientOptimizer(Formula,ConvergenceChecker,double,double,double,Preconditioner)} instead.
 */
@Deprecated
public NonLinearConjugateGradientOptimizer(final Formula updateFormula,
                                           ConvergenceChecker<PointValuePair> checker,
                                           final UnivariateSolver lineSearchSolver,
                                           final Preconditioner preconditioner) {
    this(updateFormula,
         checker,
         lineSearchSolver.getRelativeAccuracy(),
         lineSearchSolver.getAbsoluteAccuracy(),
         lineSearchSolver.getAbsoluteAccuracy(),
         preconditioner);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:23,代码来源:NonLinearConjugateGradientOptimizer.java

示例7: locatePixel

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/** Locate pixel along sensor line.
 * @param date current date
 * @return pixel location ({@code Double.NaN} if the first and last
 * pixels of the line do not bracket a location)
 * @exception RuggedException if the maximum number of evaluations is exceeded
 */
public double locatePixel(final AbsoluteDate date) throws RuggedException {
    try {

        // set up function evaluating to 0.0 where target matches pixel
        final UnivariateFunction f = new UnivariateFunction() {
            /** {@inheritDoc} */
            @Override
            public double value(final double x) throws RuggedExceptionWrapper {
                try {
                    return Vector3D.angle(cross, getLOS(date, x)) - 0.5 * FastMath.PI;
                } catch (RuggedException re) {
                    throw new RuggedExceptionWrapper(re);
                }
            }
        };

        // find the root
        final UnivariateSolver solver =
                new BracketingNthOrderBrentSolver(0.0, accuracy, 5);
        return solver.solve(maxEval, f, -MARGIN, sensor.getNbPixels() - 1 + MARGIN);

    } catch (NoBracketingException nbe) {
        // there are no solutions in the search interval
        return Double.NaN;
    } catch (TooManyEvaluationsException tmee) {
        throw new RuggedException(tmee);
    } catch (RuggedExceptionWrapper rew) {
        throw rew.getException();
    }
}
 
开发者ID:CS-SI,项目名称:Rugged,代码行数:37,代码来源:SensorPixelCrossing.java

示例8: mleMu

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
private double mleMu(int[] cytosines, int[] depth, double theta) {
		final UnivariateFunction function = new UnivariateFunction() {
			private double muEst;

			{
				muEst = (double) sumArray(cytosines) / (double) sumArray(depth);
//				System.err.println("muEst "+ muEst);
			}

			@Override
			public double value(double mu) {

				return muDerivative(mu, cytosines, depth, theta, muEst);
			}
		};

		final double relativeAccuracy = 1.0e-12;
		final double absoluteAccuracy = 1.0e-8;
		final int maxOrder = 5;
		UnivariateSolver solver = new BracketingNthOrderBrentSolver(relativeAccuracy, absoluteAccuracy, maxOrder);
		if (ArrayUtils.sumArray(cytosines) == ArrayUtils.sumArray(depth)) {
			return 1.0d - 1e-10;
		} else if (ArrayUtils.sumArray(cytosines) == 0) {
			return 0.0d + 1e-10;
		} else return solver.solve(1000, function, 0.0d + 1e-10, 1.0d - 1e-10);

	}
 
开发者ID:sing-group,项目名称:bicycle,代码行数:28,代码来源:BetaBinomialDifferentialMethylationTest.java

示例9: mleTheta

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
private double mleTheta(int[] treatmentCytosines, int[] treatmentDepth, int[] controlCytosines, int[]
			controlDepth) {
		final UnivariateFunction function = new UnivariateFunction() {

			@Override
			public double value(double theta) {
				// TODO Auto-generated method stub
				return thetaDerivative(theta, treatmentCytosines, treatmentDepth, controlCytosines, controlDepth);
			}
		};

		final double relativeAccuracy = 1.0e-6;
		final double absoluteAccuracy = 1.0e-3;
		final int maxOrder = 5;
		UnivariateSolver solver = new BracketingNthOrderBrentSolver(relativeAccuracy, absoluteAccuracy, maxOrder);

		double[] interval = new double[]{0.001, 1e6};

		double estPhi = 0.0d;
//		System.err.println("thetaDerivative("+interval[0]+") = "+function.value(interval[0]));
//		System.err.println("thetaDerivative("+interval[1]+") = "+function.value(interval[1]));

		if (Double.isNaN(function.value(interval[1])) || function.value(interval[1]) >= 0) {
			estPhi = interval[1];

		} else if (function.value(interval[0]) <= 0) {
			estPhi = interval[0];
		} else {
			estPhi = solver.solve(1000, function, interval[0], interval[1]);
		}

		return estPhi;
	}
 
开发者ID:sing-group,项目名称:bicycle,代码行数:34,代码来源:BetaBinomialDifferentialMethylationTest.java

示例10: NonLinearConjugateGradientOptimizer

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/**
 * @param updateFormula formula to use for updating the &beta; parameter,
 * must be one of {@link Formula#FLETCHER_REEVES} or
 * {@link Formula#POLAK_RIBIERE}.
 * @param checker Convergence checker.
 * @param lineSearchSolver Solver to use during line search.
 * @param preconditioner Preconditioner.
 */
public NonLinearConjugateGradientOptimizer(final Formula updateFormula,
                                           ConvergenceChecker<PointValuePair> checker,
                                           final UnivariateSolver lineSearchSolver,
                                           final Preconditioner preconditioner) {
    super(checker);

    this.updateFormula = updateFormula;
    solver = lineSearchSolver;
    this.preconditioner = preconditioner;
    initialStep = 1;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:NonLinearConjugateGradientOptimizer.java

示例11: BoundedNonLinearConjugateGradientOptimizer

import org.apache.commons.math3.analysis.solvers.UnivariateSolver; //导入依赖的package包/类
/**
 * @param updateFormula
 *            formula to use for updating the &beta; parameter,
 *            must be one of {@link Formula#FLETCHER_REEVES} or {@link Formula#POLAK_RIBIERE}.
 * @param checker
 *            Convergence checker.
 * @param lineSearchSolver
 *            Solver to use during line search.
 * @param preconditioner
 *            Preconditioner.
 */
public BoundedNonLinearConjugateGradientOptimizer(final Formula updateFormula,
		ConvergenceChecker<PointValuePair> checker, final UnivariateSolver lineSearchSolver,
		final Preconditioner preconditioner)
{
	super(checker);

	this.updateFormula = updateFormula;
	solver = lineSearchSolver;
	this.preconditioner = preconditioner;
	initialStep = 1;
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:23,代码来源:BoundedNonLinearConjugateGradientOptimizer.java


注:本文中的org.apache.commons.math3.analysis.solvers.UnivariateSolver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。