CATEGORII DOCUMENTE |
Asp | Autocad | C | Dot net | Excel | Fox pro | Html | Java |
Linux | Mathcad | Photoshop | Php | Sql | Visual studio | Windows | Xml |
Whenever an integration error occurs such that the integration cannot continue, an exception is thrown, to be caught and handled by your driver routine. There is a special purpose exception type defined in CNumericalIntegrator for this purpose. This type is defined to be:
class IntegratorError : public std::runtime_error
explicit IntegratorError(EErrorState what_val, const string& what_arg)
: val what_val), std::runtime_error(what_arg)
EErrorState val()
protected:
EErrorState val_;
In order to handle these exceptions, you should surround each call to one of the integrator functions with a try block. You need to catch exceptions of type CNumericalIntegrator::IntegratorError, e.g.:
try
catch (CNumericalIntegrator::IntegratorError theErr)
Note that the IntegratorError exception returns two values: the value of the error (see Table 16) and a string describing the error. You can access these using the functions IntegratorError::val() and IntegratorError::what() (inherited from std::runtime_error).
You can turn off the exception handling feature by defining the macro "_MSL_NO_EXCEPTIONS" in a global prefix file. In this case, the integrator error state will still be set, but graceful recovery may not be possible.
Politica de confidentialitate | Termeni si conditii de utilizare |
Vizualizari: 634
Importanta:
Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved