\doxysubsection{Function\+Container\texorpdfstring{$<$}{<} TIN, TOUT \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classfunc_1_1FunctionContainer}{}\label{classfunc_1_1FunctionContainer}\index{FunctionContainer$<$ TIN, TOUT $>$@{FunctionContainer$<$ TIN, TOUT $>$}}


Wrapper for {\ttfamily std\+::function\texorpdfstring{$<$}{<}TOUT(\+TIN)\texorpdfstring{$>$}{>}} and some optional {\ttfamily std\+::function}s of Boost\textquotesingle{}s automatic differentiation type.  




{\ttfamily \#include $<$Function\+Container.\+hpp$>$}

\doxysubsubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$unsigned int N$>$ }\\\mbox{\hyperlink{structfunc_1_1nth__differentiable}{fun\+\_\+type}}$<$ N $>$\+::type \mbox{\hyperlink{classfunc_1_1FunctionContainer_a78b8b2dbf65d8099cca8fd326e992fab}{get\+\_\+nth\+\_\+func}} () const
\begin{DoxyCompactList}\small\item\em return the Boost autodiff function that automatically differentiates the user\textquotesingle{}s function N times. \end{DoxyCompactList}\item 
\Hypertarget{classfunc_1_1FunctionContainer_ad654ad841a5be9ac3a2e2e7bdef2e477}\label{classfunc_1_1FunctionContainer_ad654ad841a5be9ac3a2e2e7bdef2e477} 
{\bfseries Function\+Container} (std\+::function$<$ TOUT(TIN)$>$ fun)
\item 
\Hypertarget{classfunc_1_1FunctionContainer_ab0fc32d7590727fcf175bae6d47b70da}\label{classfunc_1_1FunctionContainer_ab0fc32d7590727fcf175bae6d47b70da} 
{\bfseries Function\+Container} (std\+::function$<$ TOUT(TIN)$>$ fun, std\+::function$<$ ad\+Var$<$ TOUT, 1 $>$(ad\+Var$<$ TIN, 1 $>$)$>$ fun1, std\+::function$<$ ad\+Var$<$ TOUT, 2 $>$(ad\+Var$<$ TIN, 2 $>$)$>$ fun2, std\+::function$<$ ad\+Var$<$ TOUT, 3 $>$(ad\+Var$<$ TIN, 3 $>$)$>$ fun3, std\+::function$<$ ad\+Var$<$ TOUT, 4 $>$(ad\+Var$<$ TIN, 4 $>$)$>$ fun4, std\+::function$<$ ad\+Var$<$ TOUT, 5 $>$(ad\+Var$<$ TIN, 5 $>$)$>$ fun5, std\+::function$<$ ad\+Var$<$ TOUT, 6 $>$(ad\+Var$<$ TIN, 6 $>$)$>$ fun6, std\+::function$<$ ad\+Var$<$ TOUT, 7 $>$(ad\+Var$<$ TIN, 7 $>$)$>$ fun7)
\begin{DoxyCompactList}\small\item\em Users should not call this constructor without wrapping their argument with the macro {\ttfamily \doxylink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\+\_\+\+SET\+\_\+\+F(...)}}. See the example usage for \doxylink{classfunc_1_1FunctionContainer}{Function\+Container}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classfunc_1_1FunctionContainer_a1ea7aa1307e98820c25024de5a365a0e}\label{classfunc_1_1FunctionContainer_a1ea7aa1307e98820c25024de5a365a0e} 
std\+::function$<$ TOUT(TIN)$>$ {\bfseries standard\+\_\+fun}
\item 
\Hypertarget{classfunc_1_1FunctionContainer_ab8ddff122d3b88019433dbf2e88f885b}\label{classfunc_1_1FunctionContainer_ab8ddff122d3b88019433dbf2e88f885b} 
std\+::function$<$ ad\+Var$<$ TOUT, 1 $>$(ad\+Var$<$ TIN, 1 $>$)$>$ {\bfseries autodiff1\+\_\+fun}
\item 
\Hypertarget{classfunc_1_1FunctionContainer_a3f68d3a18516d02e9130eef3db4bb4a2}\label{classfunc_1_1FunctionContainer_a3f68d3a18516d02e9130eef3db4bb4a2} 
std\+::function$<$ ad\+Var$<$ TOUT, 2 $>$(ad\+Var$<$ TIN, 2 $>$)$>$ {\bfseries autodiff2\+\_\+fun}
\item 
\Hypertarget{classfunc_1_1FunctionContainer_a91786160fde46a1f0dac2c44ddffc265}\label{classfunc_1_1FunctionContainer_a91786160fde46a1f0dac2c44ddffc265} 
std\+::function$<$ ad\+Var$<$ TOUT, 3 $>$(ad\+Var$<$ TIN, 3 $>$)$>$ {\bfseries autodiff3\+\_\+fun}
\item 
\Hypertarget{classfunc_1_1FunctionContainer_ad21664d154785ac35e715b58e5a8117c}\label{classfunc_1_1FunctionContainer_ad21664d154785ac35e715b58e5a8117c} 
std\+::function$<$ ad\+Var$<$ TOUT, 4 $>$(ad\+Var$<$ TIN, 4 $>$)$>$ {\bfseries autodiff4\+\_\+fun}
\item 
\Hypertarget{classfunc_1_1FunctionContainer_af224640470ed0f48f01e196084bdf54d}\label{classfunc_1_1FunctionContainer_af224640470ed0f48f01e196084bdf54d} 
std\+::function$<$ ad\+Var$<$ TOUT, 5 $>$(ad\+Var$<$ TIN, 5 $>$)$>$ {\bfseries autodiff5\+\_\+fun}
\item 
\Hypertarget{classfunc_1_1FunctionContainer_a51c788e50268ad28880a883c56c1db4e}\label{classfunc_1_1FunctionContainer_a51c788e50268ad28880a883c56c1db4e} 
std\+::function$<$ ad\+Var$<$ TOUT, 6 $>$(ad\+Var$<$ TIN, 6 $>$)$>$ {\bfseries autodiff6\+\_\+fun}
\item 
\Hypertarget{classfunc_1_1FunctionContainer_a4d51fd4de19a649afeb4d5a0812143fa}\label{classfunc_1_1FunctionContainer_a4d51fd4de19a649afeb4d5a0812143fa} 
std\+::function$<$ ad\+Var$<$ TOUT, 7 $>$(ad\+Var$<$ TIN, 7 $>$)$>$ {\bfseries autodiff7\+\_\+fun}
\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
\subsubsection*{template$<$typename TIN, typename TOUT = TIN$>$\newline
class func\+::\+Function\+Container$<$ TIN, TOUT $>$}
Wrapper for {\ttfamily std\+::function\texorpdfstring{$<$}{<}TOUT(\+TIN)\texorpdfstring{$>$}{>}} and some optional {\ttfamily std\+::function}s of Boost\textquotesingle{}s automatic differentiation type. 

Used to pass mathematical functions to FunC\textquotesingle{}s LUTs.

\begin{DoxyNote}{Note}
Only the LUTs that need derivatives (Taylor, Hermite, Pade, and every Non\+Uniform\+LUT) need Boost\textquotesingle{}s ad\+Var\mbox{[}1-\/7\mbox{]} functions. 

The automatic differentiation requires the mathematical function is templated on some abstract type 

Autodiff was introduced in Boost 1.\+71. This class reduces to a simple std\+::function wrapper if Boost is not available or is too old. 

Most of the machinery is necessary to use {\ttfamily get\+\_\+nth\+\_\+func\texorpdfstring{$<$}{<}N\texorpdfstring{$>$}{>}} which returns the ith order autodiff functions based on an index
\end{DoxyNote}
Copy and paste the following example code into a new file and rename the example to your own function with {\ttfamily \+:s/foo/new\+\_\+name/g} in Vim


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ FunctionContainer.hpp}}
\DoxyCodeLine{\textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{T\ foo(T\ x)\{\ \textcolor{keywordflow}{return}\ x;\ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ TYPE\ double}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}\ main()\{}
\DoxyCodeLine{\ \ FunctionContainer<TYPE>\ foo\_container\ \{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,TYPE)\};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \textcolor{comment}{//\ Use\ this\ version\ if\ it's\ inconvenient\ to\ template\ your\ function:}}
\DoxyCodeLine{\ \ FunctionContainer<TYPE>\ foo\_container2\ \{foo<TYPE>\};}
\DoxyCodeLine{\ \ \textcolor{comment}{//\ The\ only\ downside\ is\ that\ you\ can't\ generate\ LUTs\ that\ need}}
\DoxyCodeLine{\ \ \textcolor{comment}{//\ automatic\ differentiation.\ There\ will\ be\ a\ runtime\ exception\ if\ you\ try}}
\DoxyCodeLine{\ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}

\end{DoxyCode}
 

\label{doc-func-members}
\Hypertarget{classfunc_1_1FunctionContainer_doc-func-members}
\doxysubsubsection{Member Function Documentation}
\Hypertarget{classfunc_1_1FunctionContainer_a78b8b2dbf65d8099cca8fd326e992fab}\index{FunctionContainer$<$ TIN, TOUT $>$@{FunctionContainer$<$ TIN, TOUT $>$}!get\_nth\_func@{get\_nth\_func}}
\index{get\_nth\_func@{get\_nth\_func}!FunctionContainer$<$ TIN, TOUT $>$@{FunctionContainer$<$ TIN, TOUT $>$}}
\doxyparagraph{\texorpdfstring{get\_nth\_func()}{get\_nth\_func()}}
{\footnotesize\ttfamily \label{classfunc_1_1FunctionContainer_a78b8b2dbf65d8099cca8fd326e992fab} 
template$<$typename TIN, typename TOUT = TIN$>$ \\
template$<$unsigned int N$>$ \\
\mbox{\hyperlink{structfunc_1_1nth__differentiable}{fun\+\_\+type}}$<$ N $>$\+::type get\+\_\+nth\+\_\+func (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



return the Boost autodiff function that automatically differentiates the user\textquotesingle{}s function N times. 

\begin{DoxyNote}{Note}
Get the nth differentiable template instantiation of the given function by calling the function container as {\ttfamily func\+\_\+container-\/\texorpdfstring{$>$}{>}template get\+\_\+nth\+\_\+func\texorpdfstring{$<$}{<}N\texorpdfstring{$>$}{>}()} 

Only supports 7 or fewer derivatives. 

Implemented with 9 different overloads of {\ttfamily fun\+\_\+type\texorpdfstring{$<$}{<}N\texorpdfstring{$>$}{>}} 
\end{DoxyNote}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{FunctionContainer_8hpp}{Function\+Container.\+hpp}}\end{DoxyCompactItemize}
