/home/doxygen/libascend/compiler/extfunc.h File Reference


Detailed Description

External Functions Module.

This module implements the ExternalFunc structure referenced by black and glass box structures and external methods. The ExternalFunc structure stores the number of input and output parameters (formal) as well as 'help' string and 'name' string' for each of these 'calls'.

This header also provides functions for ExternalFunc library maintenance. This allows ASCEND to maintain a list of the ExternalFunc requests derived from statements in the model(s). When compilation completes, I suppose it should be possible to alert the user about any external functions that were not able to be resolved.

Todo:
Complete documentation of compiler/extfunc.h.
Requires: include "utilities/ascConfig.h" include "compiler/instance_enum.h" include "general/list.h" include "compiler/compiler.h"

#include <utilities/ascConfig.h>
#include "relation_util.h"

Include dependency graph for extfunc.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GlassBoxExternalFunc
struct  BBoxInterp
struct  BlackBoxExternalFunc
struct  MethodExternalFunc
struct  ExternalFunc

Typedefs

typedef int ExtEvalFunc (int *mode, int *m, int *n, double *x, double *u, double *f, double *g)
typedef int ExtBBoxInitFunc (struct BBoxInterp *interp, struct Instance *data, struct gl_list_t *arglist)
typedef void ExtBBoxFinalFunc (struct BBoxInterp *interp)
typedef int ExtBBoxFunc (struct BBoxInterp *interp, int ninputs, int noutputs, double *inputs, double *outputs, double *jacobian)
typedef int ExtMethodRun (struct Instance *context, struct gl_list_t *args, void *user_data)
typedef int ExtMethodInit (struct Instance *context)
typedef int ExtMethodDestroyFn (void *user_data)

Enumerations

enum  ExternalFuncType { efunc_ERR = 0, efunc_BlackBox = 10, efunc_GlassBox = 20, efunc_Method = 30 }
enum  Calc_status {
  calc_converged, calc_diverged, calc_fp_error, calc_incorrect_args,
  calc_error, calc_all_ok
}
enum  Request_type {
  bb_none, bb_first_call, bb_last_call, bb_check_args,
  bb_recalculate, bb_func_eval, bb_deriv_eval, bb_hess_eval,
  bb_single_step
}

Functions

void InitExternalFuncLibrary (void)
void DestroyExtFuncLibrary (void)
int AddExternalFunc (struct ExternalFunc *efunc, int force)
ASC_DLLSPEC struct ExternalFunc * LookupExtFunc (CONST char *funcname)
ExternalFunc * RemoveExternalFunc (char *name)
void DestroyExternalFunc (struct ExternalFunc *name)
void PrintExtFuncLibrary (FILE *f)
ASC_DLLSPEC char * WriteExtFuncLibraryString (void)
ASC_DLLSPEC void TraverseExtFuncLibrary (void(*)(void *, void *), void *secondparam)
ASC_DLLSPEC unsigned long NumberInputArgs (CONST struct ExternalFunc *efunc)
ASC_DLLSPEC unsigned long NumberOutputArgs (CONST struct ExternalFunc *efunc)
ASC_DLLSPEC CONST char * ExternalFuncName (CONST struct ExternalFunc *efunc)
ASC_DLLSPEC int CreateUserFunctionMethod (CONST char *name, ExtMethodRun *run, CONST long n_args, CONST char *help, void *user_data, ExtMethodDestroyFn *destroyfn)
ExtMethodRunGetExtMethodRun (struct ExternalFunc *efunc)
void * GetExtMethodUserData (struct ExternalFunc *efunc)
ExtBBoxInitFuncGetInitFunc (struct ExternalFunc *efunc)
ExtBBoxFuncGetValueFunc (struct ExternalFunc *efunc)
ExtBBoxFuncGetDerivFunc (struct ExternalFunc *efunc)
ExtBBoxFuncGetDeriv2Func (struct ExternalFunc *efunc)
ExtBBoxFinalFuncGetFinalFunc (struct ExternalFunc *efunc)
double GetValueFuncTolerance (struct ExternalFunc *efunc)
ASC_DLLSPEC int CreateUserFunctionBlackBox (CONST char *name, ExtBBoxInitFunc *init, ExtBBoxFunc *value, ExtBBoxFunc *deriv, ExtBBoxFunc *deriv2, ExtBBoxFinalFunc *final, CONST unsigned long n_inputs, CONST unsigned long n_outputs, CONST char *help, double inputTolerance)
ASC_DLLSPEC int DefaultExtBBoxInitFunc (struct BBoxInterp *interp, struct Instance *data, struct gl_list_t *arglist)
ASC_DLLSPEC int ErrorExtBBoxValueFunc (struct BBoxInterp *interp, int ninputs, int noutputs, double *inputs, double *outputs, double *jacobian)
ASC_DLLSPEC int DefaultExtBBoxFuncDerivFD (struct BBoxInterp *interp, int ninputs, int noutputs, double *inputs, double *outputs, double *jacobian)
ASC_DLLSPEC int DefaultExtBBoxFuncDeriv2FD (struct BBoxInterp *interp, int ninputs, int noutputs, double *inputs, double *outputs, double *jacobian)
ASC_DLLSPEC void DefaultExtBBoxFinalFunc (struct BBoxInterp *interp)
ASC_DLLSPEC int CreateUserFunctionGlassBox (CONST char *name, ExtEvalFunc *init, ExtEvalFunc **value, ExtEvalFunc **deriv, ExtEvalFunc **deriv2, ExtEvalFunc *final, CONST unsigned long n_inputs, CONST unsigned long n_outputs, CONST char *help)
ExtEvalFuncGetGlassBoxInit (struct ExternalFunc *efunc)
ExtEvalFunc ** GetValueJumpTable (struct ExternalFunc *efunc)
ExtEvalFunc ** GetDerivJumpTable (struct ExternalFunc *efunc)
ExtEvalFunc ** GetDeriv2JumpTable (struct ExternalFunc *efunc)
ExtEvalFuncGetGlassBoxFinal (struct ExternalFunc *efunc)


Generated on Thu Jul 17 04:00:24 2008 for libascend by  doxygen 1.5.1