\doxysubsection{Pade\+Table\texorpdfstring{$<$}{<} M, N, TIN, TOUT, GT \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classfunc_1_1PadeTable}{}\label{classfunc_1_1PadeTable}\index{PadeTable$<$ M, N, TIN, TOUT, GT $>$@{PadeTable$<$ M, N, TIN, TOUT, GT $>$}}


LUT using \mbox{[}M/N\mbox{]} pade approximants.  




{\ttfamily \#include $<$Pade\+Table.\+hpp$>$}

Inheritance diagram for Pade\+Table\texorpdfstring{$<$}{<} M, N, TIN, TOUT, GT \texorpdfstring{$>$}{>}\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classfunc_1_1PadeTable}
\end{center}
\end{figure}
\doxysubsubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classfunc_1_1PadeTable_ad2adcedacf944dbc611257b3a92acd7e}\label{classfunc_1_1PadeTable_ad2adcedacf944dbc611257b3a92acd7e} 
{\bfseries Pade\+Table} (const \mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ M+N+1, TIN, TOUT, GT $>$ \&L)
\item 
\Hypertarget{classfunc_1_1PadeTable_a0319b70bdc429dcbd8d65c89cdff94c3}\label{classfunc_1_1PadeTable_a0319b70bdc429dcbd8d65c89cdff94c3} 
{\bfseries Pade\+Table} (const \mbox{\hyperlink{classfunc_1_1FunctionContainer}{Function\+Container}}$<$ TIN, TOUT $>$ \&func\+\_\+container, const \mbox{\hyperlink{structfunc_1_1LookupTableParameters}{Lookup\+Table\+Parameters}}$<$ TIN $>$ \&par, const nlohmann\+::json \&json\+Stats=nlohmann\+::json())
\item 
TOUT \mbox{\hyperlink{classfunc_1_1PadeTable_a10047eb2c0e68f488037419e770084e6}{operator()}} (TIN x) const final
\end{DoxyCompactItemize}
\doxyparagraph*{Public Member Functions inherited from \mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table$<$ M+\+N+1, TIN, TIN, Grid\+Types\+::\+UNIFORM $>$}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classfunc_1_1MetaTable_a4b85e9ba4451023fa921e2be31acfbc1}{Meta\+Table}} ()=default
\item 
\mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ \& \mbox{\hyperlink{classfunc_1_1MetaTable_a097a4e8415badeb0468a7b432e3d2741}{operator=}} (\mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ L)
\item 
std\+::string \mbox{\hyperlink{classfunc_1_1MetaTable_accba19b44801ed79bb97513319885f31}{name}} () const final
\item 
TIN \mbox{\hyperlink{classfunc_1_1MetaTable_a0476b531891a0e1e33696d1a737661d0}{min\+\_\+arg}} () const final
\item 
TIN \mbox{\hyperlink{classfunc_1_1MetaTable_a546555a620601a06a71c12a15f7a2769}{max\+\_\+arg}} () const final
\item 
TIN {\bfseries tablemax\+\_\+arg} () const
\item 
unsigned int \mbox{\hyperlink{classfunc_1_1MetaTable_a001c4e4c752e91195b970be3edee0b6d}{order}} () const final
\item 
std\+::size\+\_\+t \mbox{\hyperlink{classfunc_1_1MetaTable_a5e82e200bee26238c342218d6d4f7042}{size}} () const final
\item 
unsigned int \mbox{\hyperlink{classfunc_1_1MetaTable_a269a97d89895944456f32f2be1d37109}{num\+\_\+subintervals}} () const final
\item 
TIN \mbox{\hyperlink{classfunc_1_1MetaTable_a0b483cc80497aa809bead8161f14a284}{step\+\_\+size}} () const final
\item 
std\+::pair$<$ TIN, TIN $>$ \mbox{\hyperlink{classfunc_1_1MetaTable_aea8465ad30b6260a0948d4305d984d9d}{bounds\+\_\+of\+\_\+subinterval}} (unsigned int interval\+Number) const final
\item 
void \mbox{\hyperlink{classfunc_1_1MetaTable_a16138bbe5fe761854a353362ba7d9b2f}{print\+\_\+json}} (std\+::ostream \&out) const final
\item 
unsigned int {\bfseries num\+\_\+table\+\_\+entries} () const
\item 
unsigned int {\bfseries ncoefs\+\_\+per\+\_\+entry} () const
\item 
TIN {\bfseries table\+\_\+entry} (unsigned int i, unsigned int j) const
\item 
std\+::array$<$ TIN, 4 $>$ {\bfseries transfer\+\_\+function\+\_\+coefs} () const
\item 
\mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ \& \mbox{\hyperlink{classfunc_1_1MetaTable_a9b1baea31c64bd1a64a89343eb41f909}{operator+=}} (const \mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ \&other)
\item 
\mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ \& {\bfseries operator-\/=} (const \mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ \&other)
\item 
\mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ \& {\bfseries operator\texorpdfstring{$\ast$}{*}=} (const TIN \&a)
\item 
\mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ \& {\bfseries operator/=} (const TIN \&a)
\item 
std\+::pair$<$ unsigned int, TIN $>$ \mbox{\hyperlink{classfunc_1_1MetaTable_aea0019b0ae25e0e8d8530ebc28002cf1}{hash}} (TIN x) const
\item 
TIN \mbox{\hyperlink{classfunc_1_1MetaTable_ad6406f15f1b656dcde38acd434d0d3ce}{diff}} (unsigned int s, TIN x) const
\begin{DoxyCompactList}\small\item\em Return the $s$th derivative of $L$ at $x$\+: ie return $p_k^{(s)}(x)$. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxyparagraph*{Public Member Functions inherited from \mbox{\hyperlink{classfunc_1_1LookupTable}{Lookup\+Table$<$ TIN, TIN $>$}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classfunc_1_1LookupTable_acd94ebee613378fb31e86a83d34eaf4c}{Lookup\+Table}} ()=default
\end{DoxyCompactItemize}
\doxysubsubsubsection*{Additional Inherited Members}
\doxyparagraph*{Public Types inherited from \mbox{\hyperlink{classfunc_1_1LookupTable}{Lookup\+Table$<$ TIN, TIN $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries input\+\_\+type}
\item 
using {\bfseries output\+\_\+type}
\end{DoxyCompactItemize}
\doxyparagraph*{Protected Member Functions inherited from \mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table$<$ M+\+N+1, TIN, TIN, Grid\+Types\+::\+UNIFORM $>$}}}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{classfunc_1_1MetaTable_a06026ce7da697d94db6418e29fb1ef87}{swap}} (\mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table}}$<$ N, TIN, TIN, GT $>$ \&L) noexcept
\begin{DoxyCompactList}\small\item\em Copy-\/swap pattern, necessary for {\ttfamily operator=} \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxyparagraph*{Protected Attributes inherited from \mbox{\hyperlink{classfunc_1_1MetaTable}{Meta\+Table$<$ M+\+N+1, TIN, TIN, Grid\+Types\+::\+UNIFORM $>$}}}
\begin{DoxyCompactItemize}
\item 
std\+::string {\bfseries m\+\_\+name}
\begin{DoxyCompactList}\small\item\em name of implementation type \end{DoxyCompactList}\item 
TIN {\bfseries m\+\_\+min\+Arg}
\item 
TIN {\bfseries m\+\_\+max\+Arg}
\begin{DoxyCompactList}\small\item\em bounds of evaluation \end{DoxyCompactList}\item 
TIN {\bfseries m\+\_\+step\+Size}
\item 
TIN {\bfseries m\+\_\+step\+Size\+\_\+inv}
\begin{DoxyCompactList}\small\item\em fixed grid spacing (and its inverse) \end{DoxyCompactList}\item 
TIN {\bfseries m\+\_\+table\+Max\+Arg}
\begin{DoxyCompactList}\small\item\em \texorpdfstring{$>$}{>} m\+\_\+max\+Arg if (m\+\_\+max\+Arg-\/m\+\_\+min\+Arg)/m\+\_\+step\+Size is non-\/integer \end{DoxyCompactList}\item 
unsigned int {\bfseries m\+\_\+order}
\begin{DoxyCompactList}\small\item\em order of accuracy of implementation \end{DoxyCompactList}\item 
std\+::size\+\_\+t {\bfseries m\+\_\+data\+Size}
\begin{DoxyCompactList}\small\item\em size of relevant data for impl evaluation \end{DoxyCompactList}\item 
unsigned int {\bfseries m\+\_\+num\+Intervals}
\begin{DoxyCompactList}\small\item\em = (m\+\_\+table\+Max\+Arg -\/ m\+\_\+min\+Arg)/m\+\_\+step\+Size; \end{DoxyCompactList}\item 
unsigned int {\bfseries m\+\_\+num\+Table\+Entries}
\begin{DoxyCompactList}\small\item\em length of m\+\_\+table (usually = m\+\_\+num\+Intervals + 1) \end{DoxyCompactList}\item 
\+\_\+\+\_\+attribute\+\_\+\+\_\+((aligned)) std \mbox{\hyperlink{classfunc_1_1TransferFunction}{Transfer\+Function}}$<$ TIN $>$ \mbox{\hyperlink{classfunc_1_1MetaTable_aa1f66ead8e037b26b9e72a47dd7d7c3f}{m\+\_\+transfer\+Function}}
\begin{DoxyCompactList}\small\item\em \texorpdfstring{$<$}{<} holds polynomials coefficients \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
\subsubsection*{template$<$unsigned int M, unsigned int N, typename TIN, typename TOUT = TIN, Grid\+Types GT = Grid\+Types\+::\+UNIFORM$>$\newline
class func\+::\+Pade\+Table$<$ M, N, TIN, TOUT, GT $>$}
LUT using \mbox{[}M/N\mbox{]} pade approximants. 

Polynomial coefficients are calculated using Armadillo.


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{//\ PadeTable\ requires\ the\ user's\ mathematical\ function\ is\ templated}}
\DoxyCodeLine{\textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{T\ foo(T\ x)\{\ \textcolor{keywordflow}{return}\ x;\ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}\ main()\{}
\DoxyCodeLine{\ \ \textcolor{keywordtype}{double}\ min\ =\ 0.0,\ max\ =\ 10.0,\ step\ =\ 0.0001;}
\DoxyCodeLine{\ \ \textcolor{comment}{//\ build\ every\ possible\ PadeTable}}
\DoxyCodeLine{\ \ UniformPadeTable<4,3,double>\ L1(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<3,3,double>\ L2(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<5,2,double>\ L3(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<4,2,double>\ L4(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<3,2,double>\ L5(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<2,2,double>\ L6(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<6,1,double>\ L7(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<5,1,double>\ L8(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<4,1,double>\ L9(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<3,1,double>\ L10(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<2,1,double>\ L11(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ UniformPadeTable<1,1,double>\ L12(\{\mbox{\hyperlink{FunctionContainer_8hpp_af3f31bcf88f2eb106cc78940a7282fd2}{FUNC\_SET\_F}}(foo,\textcolor{keywordtype}{double})\},\ \{min,\ max,\ step\});}
\DoxyCodeLine{\ \ \textcolor{keyword}{auto}\ val\ =\ L(0.87354);}
\DoxyCodeLine{\}}

\end{DoxyCode}


\begin{DoxyNote}{Note}
This class only works if TOUT and TIN can both be cast to double. Armadillo Mat$<$\+T$>$\textquotesingle{}s {\ttfamily is\+\_\+supported\+\_\+elem\+\_\+type\texorpdfstring{$<$}{<}T\texorpdfstring{$>$}{>}} will only let us do arithmetic with float or double (not even long double) and arma\+::field is useless. 

Evaluate by using parentheses, just like a function 

Each member function is marked const 

Available template values are all M,N such that 0 \texorpdfstring{$<$}{<} N \texorpdfstring{$<$}{<}= M and M+N\texorpdfstring{$<$}{<}=7 

Template values where M \texorpdfstring{$<$}{<} N are not supported 

Requires both Armadillo and Boost version 1.\+71.\+0 or newer to generate 
\end{DoxyNote}


\label{doc-func-members}
\Hypertarget{classfunc_1_1PadeTable_doc-func-members}
\doxysubsubsection{Member Function Documentation}
\Hypertarget{classfunc_1_1PadeTable_a10047eb2c0e68f488037419e770084e6}\index{PadeTable$<$ M, N, TIN, TOUT, GT $>$@{PadeTable$<$ M, N, TIN, TOUT, GT $>$}!operator()@{operator()}}
\index{operator()@{operator()}!PadeTable$<$ M, N, TIN, TOUT, GT $>$@{PadeTable$<$ M, N, TIN, TOUT, GT $>$}}
\doxyparagraph{\texorpdfstring{operator()()}{operator()()}}
{\footnotesize\ttfamily \label{classfunc_1_1PadeTable_a10047eb2c0e68f488037419e770084e6} 
template$<$unsigned int M, unsigned int N, typename TIN, typename TOUT = TIN, Grid\+Types GT = Grid\+Types\+::\+UNIFORM$>$ \\
TOUT operator() (\begin{DoxyParamCaption}\item[{TIN}]{x}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [final]}, {\ttfamily [virtual]}}

Find the subinterval $[x_k,x_{k+1})$ that $x$ belongs to, fetch the coefficients of the polynomial $p_k(x)$ from {\ttfamily m\+\_\+table\mbox{[}k\mbox{]}}, and use Horner\textquotesingle{}s method to compute $p_k(x)$.

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000003}{Todo}}]\doxylink{classfunc_1_1PadeTable}{Pade\+Table} \& \doxylink{classfunc_1_1LinearRawInterpTable}{Linear\+Raw\+Interp\+Table} must override this operator. Maybe operator() will be faster if each implementation provides their own operator() and \doxylink{classfunc_1_1MetaTable_ad6406f15f1b656dcde38acd434d0d3ce}{diff()}. If the vtable isn\textquotesingle{}t optimized out then perchance removing the use of virtual will remove that overhead. 

surely this could use openmp simd... \end{DoxyRefDesc}


Reimplemented from \mbox{\hyperlink{classfunc_1_1MetaTable_a19a1de294ffbb53d7d95c3044b220d1c}{Meta\+Table$<$ M+\+N+1, TIN, TIN, Grid\+Types\+::\+UNIFORM $>$}}.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Pade\+Table.\+hpp\end{DoxyCompactItemize}
