Scrigroup - Documente si articole

     

HomeDocumenteUploadResurseAlte limbi doc
AccessAdobe photoshopAlgoritmiAutocadBaze de dateCC sharp
CalculatoareCorel drawDot netExcelFox proFrontpageHardware
HtmlInternetJavaLinuxMatlabMs dosPascal
PhpPower pointRetele calculatoareSqlTutorialsWebdesignWindows
WordXml

AspAutocadCDot netExcelFox proHtmlJava
LinuxMathcadPhotoshopPhpSqlVisual studioWindowsXml

Exception Handling

c



+ Font mai mare | - Font mai mic



Exception Handling

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



DISTRIBUIE DOCUMENTUL

Comentarii


Vizualizari: 573
Importanta: rank

Comenteaza documentul:

Te rugam sa te autentifici sau sa iti faci cont pentru a putea comenta

Creaza cont nou

Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved