Class MathException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LMA.ConvergenceException, RootFinder.ConvergenceException

public class MathException extends RuntimeException
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 Details

    • MathException

      public MathException()
      Constructor. Constructs a new math exception. The cause is not initialized, and may subsequently be initialized by a call to initCause.
    • MathException

      public MathException(String msg)
      Constructs a new math exception with the specified detailed message. The cause is not initialized, and may subsequently be initialized by a call to initCause.
      Parameters:
      msg - the detail message; the detail message is saved for later retrieval by a call to Throwable.getMessage()
    • MathException

      public MathException(String msg, Throwable cause)
      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 to initCause.
      Parameters:
      msg - the detail message; the detail message is saved for later retrieval by a call to Throwable.getMessage()
      cause - the cause
    • MathException

      public 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). 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