Download Merlin user`s manual

Transcript
Chapter 7
Extensions
7.1 Why extend
After working with Merlin for a while, one realizes the need for incorporating his own code
fragments into Merlin. For example one may want to write to a le the resulting minimization
parameters using a strange format, produce a graph for a plotter, or even add his own minimization
routine. The possibilities are innite. We decided to incorporate a mechanism for uniformly
extending Merlin, without having to modify the body of the program. Any extensions added, are
automatically recognized by Mcl programs as well. The procedure involves three steps:
The user has to provide a subroutine that performs the desired operations. A user subroutine,
that is used as a Merlin extension, is termed a plug{in module.
A unique name must be chosen for the plug{in. This name must be declared in the Merlin
conguration le.
In case the plug{in obtains its input using the panel mechanism, one must make the corresponding entries in the panel description le.
These steps are further explained in the following sections.
7.2 Writing the plug{in module
Let us assume that one wants to create an alternative to SHORTDIS: a plug{in module that will
print the value of the parameters, their names (if any) and their rst partial derivatives. A subroutine that performs the desired operation is shown in gure 7.1. Sample output (for the two
parameter Rosenbrock function) is demonstrated in gure 7.2. As is clear from the example, to
91