From 366d796c364714567c114bff27547bd8560bd487 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Wed, 5 Sep 2012 18:30:28 +0000 Subject: [PATCH] Added throw declarations for package dfp. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1381285 13f79535-47bb-0310-9956-ffa450edef68 --- .../dfp/BracketingNthOrderBrentSolverDFP.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/math3/dfp/BracketingNthOrderBrentSolverDFP.java b/src/main/java/org/apache/commons/math3/dfp/BracketingNthOrderBrentSolverDFP.java index 7eb2e91af..372c699c7 100644 --- a/src/main/java/org/apache/commons/math3/dfp/BracketingNthOrderBrentSolverDFP.java +++ b/src/main/java/org/apache/commons/math3/dfp/BracketingNthOrderBrentSolverDFP.java @@ -20,6 +20,7 @@ package org.apache.commons.math3.dfp; import org.apache.commons.math3.analysis.solvers.AllowedSolution; import org.apache.commons.math3.exception.MathInternalError; import org.apache.commons.math3.exception.NoBracketingException; +import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.util.Incrementor; import org.apache.commons.math3.util.MathUtils; @@ -148,13 +149,12 @@ public class BracketingNthOrderBrentSolverDFP { * @param allowedSolution The kind of solutions that the root-finding algorithm may * accept as solutions. * @return a value where the function is zero. - * @throws org.apache.commons.math3.exception.MathIllegalArgumentException - * if the arguments do not satisfy the requirements specified by the solver. - * @throws org.apache.commons.math3.exception.TooManyEvaluationsException if - * the allowed number of evaluations is exceeded. + * @exception NullArgumentException if f is null. + * @exception NoBracketingException if root cannot be bracketed */ public Dfp solve(final int maxEval, final UnivariateDfpFunction f, - final Dfp min, final Dfp max, final AllowedSolution allowedSolution) { + final Dfp min, final Dfp max, final AllowedSolution allowedSolution) + throws NullArgumentException, NoBracketingException { return solve(maxEval, f, min, max, min.add(max).divide(2), allowedSolution); } @@ -172,14 +172,13 @@ public class BracketingNthOrderBrentSolverDFP { * @param allowedSolution The kind of solutions that the root-finding algorithm may * accept as solutions. * @return a value where the function is zero. - * @throws org.apache.commons.math3.exception.MathIllegalArgumentException - * if the arguments do not satisfy the requirements specified by the solver. - * @throws org.apache.commons.math3.exception.TooManyEvaluationsException if - * the allowed number of evaluations is exceeded. + * @exception NullArgumentException if f is null. + * @exception NoBracketingException if root cannot be bracketed */ public Dfp solve(final int maxEval, final UnivariateDfpFunction f, final Dfp min, final Dfp max, final Dfp startValue, - final AllowedSolution allowedSolution) { + final AllowedSolution allowedSolution) + throws NullArgumentException, NoBracketingException { // Checks. MathUtils.checkNotNull(f);