Matlab is a language for technical-mathematical computing. The language has a huge number of syntactic constructs. Some are known from other languages like C, Fortran and so on, some are Matlab-specific. Due to the huge number of syntactic constructs implemented in Matlab and their sometimes slightly different meaning in a specific context, not all language features are completely implemented in ADiMat. That is, the syntactic constructs are parsed, but their meaning is only partially or not at all known to ADiMat. A warning message is printed, if ADiMat encounters an unknown construct, but the differentiation process continues. If a warning about unknown language features is printed, the differentiated code has to be checked. Below is a list of the most commonly used Matlab features that are supported, partially supported or not supported at all. The lists below is subject to change as development of ADiMat continues. These lists are set up at October 2011.
If you encounter a language construct or a builtin function that is not treated correctly by ADiMat or not implemented at all, please tell the author about it. This will help us to enhance and maintain ADiMat. Especially Matlab builtin functions may be missing their derivative information in our database.
These syntactic constructs are supported completely. Their differentiation is tested. If you encounter any problems, tell the author immediately.
Some features of Matlab are parsed by ADiMat, but they may not be treated correctly. That is, the differentiated code may be incorrect. Whenever such a feature is found, ADiMat issues a warning and continues its task. The features which are not completely implemented are listed below:
Some Matlab features are not supported at all. These are listed below:
if mistake
fprintf(2, 'error: a mistake occured')
return
end
more code
return
unused code
This should work if the mistake does not happen. The second return is
used to basically comment out the unused code, and this is supported.x =
y([1 1 2 2])
and x([1 1 2 2]) = y
are nto supported.The limitations listed here are in addition to the limitations of ADiMat in general.
Index operations are by default wrapped in calls to the runtime
functions
adimat_opdiff_subsref
and adimat_opdiff_subsasgn
. These are rather slow. However,
your code may not actually need these runtime functions. They can be
avoided if you set the following transformation options:
opts.paramaters.useSubsref = 0
opts.paramaters.useSubsasgn = 0
If you do this, the indexing into matrices in your code should be "correct". That means, that the indices used should reflect the shape of the resulting value:
The high-level user interface functions admDiffFor and admDiffRev have some limitations, which are listed here. In some cases there are workarounds, but in some other cases you may have to use the lower level interface, using the recipes explained in other sections of this manual.