SDDS ToolKit Programs and Libraries for C and Python
All Classes Files Functions Variables Macros Pages
diffeqResDescrip.c File Reference

Detailed Description

Provides a description string corresponding to a given differential equation result code.

This file defines a function that, given a result code from a differential equation solver, returns a human-readable description of the result. The possible codes range from error conditions to successful completion indicators.

License
This file is distributed under the terms of the Software License Agreement found in the file LICENSE included with this distribution.
Author
M. Borland, C. Saunders, R. Soliday

Definition in file diffeqResDescrip.c.

#include "mdb.h"

Go to the source code of this file.

Functions

char * diffeq_result_description (long result_code)
 Return a descriptive string for a given differential equation result code.
 

Function Documentation

◆ diffeq_result_description()

char * diffeq_result_description ( long result_code)

Return a descriptive string for a given differential equation result code.

This function maps a numerical result code to a corresponding string describing the outcome of a differential equation integration procedure. If the code is not recognized, the function returns "unknown error".

Parameters
result_codeThe integer code representing the result of a differential equation solver.
Returns
A constant character pointer to a descriptive string for the given code.

Definition at line 47 of file diffeqResDescrip.c.

47 {
48 int i;
49 for (i = 0; i < N_DIFFEQ_RETURNS; i++) {
50 if (result_code == diffeq_return[i].code)
51 return (diffeq_return[i].description);
52 }
53 return unknown;
54}