Appendix A.6 describes an MDL input deck which generates an ASCII file containing data samples of the complementary error function erfc (A.1). The format of this ASCII file is compatible with the gnuplot program which can be used for the visualization of the tinyapp results.
Since this function is not provided by the Algorithm Library standard distribution, it is required to define an MDL function extension library. Because the required erfc function is already contained in the standard C library for generating the erfc MDL function it is sufficient to supply the UNFUG tuple file TinyAppFuncLib.tup (Example A.4) and the VMAKE makefile in Example A.5. Both files are generated by replacing various place holders in the templates given in Example 2.6, respectively Example 2.8 as described in Section 2.8.
;; The internal name of the library
(defun LocalParamLibraryName () "TinyAppFuncLib")
(tuple
'(ModelLib-FunctionExpressions
( mdlExpr exprDesc cxxExpr parFkt
instTuple
errorMsg )
( "erfc" "ErfcExprDescr" "ErfcExpr" "parErfc"
ModelLib-Parameter::erfc-function
"The 'erfc' function is not defined for arguments of the type '%s'!" )
))
(tuple
'(ModelLib-Parameter::erfc-function
(resType op1Type valFkt resAlias op1Alias ( header ))
("double" "double" "erfc" "double" "double" ( "math.h" ))
))
Example A.4: UNFUG tuple file for a tiny MDL function extension library
;;- Symbolic VMAKE directory name
(Module-Directory TinyAppFuncLib-Directory)
(Name TinyAppFuncLib-Tuple :file "TinyAppFuncLib.tup")
;;-------------------------
;;- Objects for the MDL-Function-Extension-Library |
;;-------------------------
(Unfug-Target TinyAppFuncLib-Functions-Source
:template Vienna-Model-Library-ParamExtensionDefinition-Tpl
:tuple Vienna-Template-Instantiation-Tup
Vienna-Model-Library-Main-Tup
Vienna-Model-Library-ModelExtensionTuple
TinyAppFuncLib-Tuple
:target "TinyAppFuncLib.acc"
)
(Unfug-Target TinyAppFuncLib-Functions-Header
:template Vienna-Model-Library-ModelExtensionDeclaration-Tpl
:tuple Vienna-Template-Instantiation-Tup
Vienna-Model-Library-ModelExtensionTuple
TinyAppFuncLib-Tuple
:target "TinyAppFuncLib.ahh"
)
(C++-Target TinyAppFuncLib-Auto-Objs
:source TinyAppFuncLib-Functions-Source
:defines (LOCAL_FUNCS_LIBRARY_DEFINITION 1)
)
(C++-Target TinyAppFuncLib-User-Objs
:source :wildcard "*.cc"
)
;;----------------------
;; The local MDL-Function-Extension-Library |
;;----------------------
(Library-Target TinyAppFuncLib-Library
:libname "TinyAppFuncLib"
:objects TinyAppFuncLib-User-Objs
TinyAppFuncLib-Auto-Objs
:shared
:depends Vienna-Model-Library
)
(Include-Target :include TinyAppFuncLib-Functions-Header)
Example A.5: VMAKE makefile for a tiny MDL function extension library