diff options
Diffstat (limited to 'doc/UsersGuide/Notes.tex')
-rw-r--r-- | doc/UsersGuide/Notes.tex | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/doc/UsersGuide/Notes.tex b/doc/UsersGuide/Notes.tex index b2393291..ff0a6f42 100644 --- a/doc/UsersGuide/Notes.tex +++ b/doc/UsersGuide/Notes.tex @@ -1313,6 +1313,58 @@ consists of one or more parameter names, followed by an `\texttt{=}', followed by the value(s) for this (these) parameter(s). Note that all string parameters are case insensitive. +Parameters statements of numeric or boolean type can use arithmetic +expressions in place of explicit values. The usual arithmetic operations +as well as C-like transcendental functions and relational operations are +supported. Integer division is handled as in C, and any non-null value is +interpreted as logical true, which the relational operators return as unity. +Table~\ref{tab:expression_functions} lists the supported functions. +Expressions can refer to already set parameters by using the fully qualified +name \texttt{thorn::parameter} as described below. +\begin{table} + \begin{tabular}{|ll@{\hspace{.5cm}}|ll|} + \hline + \multicolumn{2}{|c|}{Relational operators} & \multicolumn{2}{c|}{Mathematical functions} \\ + \hline + \verb|=| & tests for equality & \verb|!| & logical not\\ + \hline + \verb|<| & tests for less than & \verb|acos| & inverse cosine\\ + \hline + \verb|>| & tests for greater than & \verb|asin| & inverse sine\\ + \hline + \verb|<=| & tests for less or equal & \verb|atan| & inverse tangent \\ + \hline + \verb|>=| & tests for greater or equal & \verb|ceil| & round up to nearest integer \\ + \hline + \verb|&&| & logical and & \verb|cos| & cosine \\ + \hline + \verb%||% & logical or & \verb|cosh| & hyperbolic cosine \\ + \hline + \multicolumn{2}{|c|}{Unary operators} & \verb|exp| & exponentiation $e^x$\\ + \hline + \verb|-| & negate sign & \verb|fabs| & absolute value $|x|$\\ + \hline + \verb|+| & no-op & \verb|floor| & round down to nearest integer \\ + \hline + \multicolumn{2}{|c|}{Binary operators} & \verb|log| & natural logarithm \\ + \hline + \verb|+| & addition & \verb|log10| & base-10 logarithm \\ + \hline + \verb|-| & subtraction & \verb|sin| & sine \\ + \hline + \verb|/| & C-like division & \verb|sinh| & hyperbolic sine \\ + \hline + \verb|*| & multiplication & \verb|sqrt| & square root \\ + \hline + \verb|^| & exponentiation $x^y$ & \verb|tan| & tangent \\ + \hline + & & \verb|tanh| & hyperbolic tangent \\ + \hline + \end{tabular} + \caption{Supported functions inside of expressions, in increasing order of + precedence.} +\end{table} + The first parameter statement in any parameter file should set \texttt{ActiveThorns}, which is a special parameter that tells the program which \textit{thorns} are to be activated. Only parameters from active |