本文整理汇总了Java中org.apache.commons.math3.analysis.solvers.BracketingNthOrderBrentSolver类的典型用法代码示例。如果您正苦于以下问题:Java BracketingNthOrderBrentSolver类的具体用法?Java BracketingNthOrderBrentSolver怎么用?Java BracketingNthOrderBrentSolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BracketingNthOrderBrentSolver类属于org.apache.commons.math3.analysis.solvers包,在下文中一共展示了BracketingNthOrderBrentSolver类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addEventHandler
import org.apache.commons.math3.analysis.solvers.BracketingNthOrderBrentSolver; //导入依赖的package包/类
/** {@inheritDoc} */
public void addEventHandler(final EventHandler handler,
final double maxCheckInterval,
final double convergence,
final int maxIterationCount) {
addEventHandler(handler, maxCheckInterval, convergence,
maxIterationCount,
new BracketingNthOrderBrentSolver(convergence, 5));
}
开发者ID:biocompibens,项目名称:SME,代码行数:10,代码来源:AbstractIntegrator.java
示例2: locatePixel
import org.apache.commons.math3.analysis.solvers.BracketingNthOrderBrentSolver; //导入依赖的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
示例3: mleMu
import org.apache.commons.math3.analysis.solvers.BracketingNthOrderBrentSolver; //导入依赖的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
示例4: mleTheta
import org.apache.commons.math3.analysis.solvers.BracketingNthOrderBrentSolver; //导入依赖的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
示例5: computeLimitVisibilityPoint
import org.apache.commons.math3.analysis.solvers.BracketingNthOrderBrentSolver; //导入依赖的package包/类
private static GeodeticPoint computeLimitVisibilityPoint(final ICentralBody centralBody,
final TopocentricFrame frame,
final double radius,
final double azimuth,
final double elevation) throws OrekitException
{
// based on orekit 6.1 TopocentricFrame.computeLimitVisibilityPoint()
// but with variable equatorial radius of the central body.
try {
// convergence threshold on point position: 1mm
final double deltaP = 0.001;
final UnivariateSolver solver =
new BracketingNthOrderBrentSolver(deltaP / centralBody.getEquatorialRadius(),
deltaP, deltaP, 5);
// find the distance such that a point in the specified direction and at the solved-for
// distance is exactly at the specified radius
final double distance = solver.solve(1000, new UnivariateFunction() {
/** {@inheritDoc} */
@Override
public double value(final double x) {
try {
final GeodeticPoint gp = frame.pointAtDistance(azimuth, elevation, x);
return frame.getParentShape().transform(gp).getNorm() - radius;
} catch (OrekitException oe) {
throw new OrekitExceptionWrapper(oe);
}
}
}, 0, 2 * radius);
// return the limit point
return frame.pointAtDistance(azimuth, elevation, distance);
} catch (TooManyEvaluationsException tmee) {
throw new OrekitException(tmee);
} catch (OrekitExceptionWrapper lwe) {
throw lwe.getException();
}
}
开发者ID:vobject,项目名称:maru,代码行数:41,代码来源:VisibilityUtils.java
注:本文中的org.apache.commons.math3.analysis.solvers.BracketingNthOrderBrentSolver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论