java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.bzdev.math.MathException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
LMA.ConvergenceException
,RootFinder.ConvergenceException
Exception for errors in computing mathematical functions.
A MathException should be used in cases where a user supplies
a function and an error occurs in evaluating it. For example,
the class
RootFinder.Newton
is
abstract because the user must supply a function and its first
derivative. A MathException will occur if there is an error in
evaluating these, with the exception that caused the failure provided
as a cause.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.MathException
(String msg) Constructs a new math exception with the specified detailed message.MathException
(String msg, Throwable cause) Constructs a new math exception with the specified detailed message and cause.MathException
(Throwable cause) Constructs a new math exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MathException
public MathException()Constructor. Constructs a new math exception. The cause is not initialized, and may subsequently be initialized by a call toinitCause
. -
MathException
Constructs a new math exception with the specified detailed message. The cause is not initialized, and may subsequently be initialized by a call toinitCause
.- Parameters:
msg
- the detail message; the detail message is saved for later retrieval by a call toThrowable.getMessage()
-
MathException
Constructs a new math exception with the specified detailed message and cause. The cause is not initialized, and may subsequently be initialized by a call toinitCause
.- Parameters:
msg
- the detail message; the detail message is saved for later retrieval by a call toThrowable.getMessage()
cause
- the cause
-
MathException
Constructs a new math exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for math exceptions that are little more than wrappers for other throwables.- Parameters:
cause
- the cause; null if the cause is nonexistent or unknown
-