With CUTEr, gateway interfaces to the CUTEr tools are provided in three files. The file utools.f interfaces the unconstrained optimization tools, ctools.f interfaces the constrained optimization tools and gtools.f contains general tools used by utools.f and ctools.f. These gateway files can be found in
$CUTER/common/src/tools/
while shortcut files to call the corresponding routines may be found in
$CUTER/common/src/matlab/
For example, $CUTER/common/src/matlab/ contains the file usetup.m which allows the user to simply call the usetup tools by typing
matlab% [x,bl,bu]=usetup;
at the Matlab prompt instead of
matlab% [x,bl,bu]=utools('usetup');
Note that the calling sequence from within Matlab may to some extent differ from the ``usual'' Fortran calling sequence.
Help is available from within Matlab the usual way, by typing
matlab% help toolname.
For example,
matlab% help usetup
briefly documents the usetup tool. Note that MEX-Files created from Fortran source code may only handle double precision data. As a general rule, a C or Fortran routine or function compiled and linked into a MEX-File is called using
matlab% [
] = function_name(
);
where is the output arguments list (specified within square brackets) and is the input arguments list.
The gateway interfaces use the mxCopy__ construct by default. If your C or Fortran compiler supports the %val construct, which implements calls by address instead of calls by value, it should be used so as to free memory used by (no longer necessary) temporary variables and to speed up execution. Besides being more intuitive, the %val construct also considerably eases the programming effort, shortens the code and makes better use of available memory.