Function Annotations

Two rather special annotations are defined for functions. These are the function
derivative annotation and the arrayLayout annotation. The function derivative annotation allows you to explicitly specify the computation of the derivatives of a function to any order, e.g. in order to gain performance and/or numerical accuracy. The external function annotation arrayLayout can be used to explicitly give the layout of arrays

1 Function Derivative Annotations

2 Calling functions h0, h1 and h2

Below are examples of calling the h0, h1, and h2 functions.

We could for example make a plot of the h0 function from x=4 to x=6:

3 External Function Annotations

Regarding specific annotations only for external function declarations there is an optional arrayLayout annotation, which can be either "rowMajor" or "columnMajor". This annotation causes additional information to be passed to the compiler when necessary. It is only needed when the array storage layout deviates from the default for the external language. This is the case for the function joinThreeVectors2 below where the C function uses column-major array representation which is different from the default row-major layout that normally is used for C.