\doxysection{Hermite\+\_\+\+Tools.\+h}
\hypertarget{_hermite___tools_8h_source}{}\label{_hermite___tools_8h_source}\index{src/Hermite\_Tools.h@{src/Hermite\_Tools.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00010\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00011\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_hermite}{Hermite}}\ \{}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00014\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ roots;\ }
\DoxyCodeLine{00015\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ weights;\ }
\DoxyCodeLine{00016\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ max\_order\ =\ 100;\ }
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00025\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_hermite_aa15d4bc9a912e129f2efa8af77b1c350}{Hermite}}();}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00030\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_hermite_a71bcd75257c59f9da802b8e72980c178}{\string~Hermite}}();}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00039\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a0bc7a1db6552e72fbc54b07b1e1635cd}{evaluate}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients,\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ values);}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00048\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_hermite_a0bc7a1db6552e72fbc54b07b1e1635cd}{evaluate}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients,\ T\ value);}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a4ec149c17829e13e0534adb5a35c6106}{coefficients\_deriv}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients);}
\DoxyCodeLine{00057\ }
\DoxyCodeLine{00065\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_add73972f2cdeb4c1cb8f800978fe480c}{evaluate\_deriv}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients,\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ values);}
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_hermite_add73972f2cdeb4c1cb8f800978fe480c}{evaluate\_deriv}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients,\ T\ value);}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a1d2a6ef569a0ccd15cea95f1eb60605a}{import\_data}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ file);}
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00090\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a4cf467389e6bb8f605e6692e80c7799f}{get\_roots}}(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order);}
\DoxyCodeLine{00091\ }
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_ad31dd94ef63c00b04623f4efe224dac2}{get\_weights}}(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order);}
\DoxyCodeLine{00099\ }
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a36e11cfd1a5b900ee916481046555e92}{compute\_coefficients}}(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order,\ T\ (*func)(T));}
\DoxyCodeLine{00108\ \};}
\DoxyCodeLine{00109\ }
\DoxyCodeLine{00115\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00116\ \mbox{\hyperlink{class_hermite_aa15d4bc9a912e129f2efa8af77b1c350}{Hermite<T>::Hermite}}()\ \{}
\DoxyCodeLine{00117\ \ \ \ \ this-\/>roots\ =\ import\_data(\textcolor{stringliteral}{"{}code\_files/roots.txt"{}});}
\DoxyCodeLine{00118\ \ \ \ \ this-\/>weights\ =\ import\_data(\textcolor{stringliteral}{"{}code\_files/weights.txt"{}});}
\DoxyCodeLine{00119\ \ \ \ \ this-\/>weights\ /=\ exp((this-\/>roots\ \string^\ 2.0)\ *\ (-\/1.0));}
\DoxyCodeLine{00120\ \}}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00125\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00126\ \mbox{\hyperlink{class_hermite_a71bcd75257c59f9da802b8e72980c178}{Hermite<T>::\string~Hermite}}()\ \{\}}
\DoxyCodeLine{00127\ }
\DoxyCodeLine{00135\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00136\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a0bc7a1db6552e72fbc54b07b1e1635cd}{Hermite<T>::evaluate}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients,\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ values)\ \{}
\DoxyCodeLine{00137\ }
\DoxyCodeLine{00138\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order\ =\ coefficients.get\_rows();}
\DoxyCodeLine{00139\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ Hn\_0(values),\ Hn\_1(values),\ Hn(values),\ result(values);}
\DoxyCodeLine{00140\ }
\DoxyCodeLine{00141\ \ \ \ \ \textcolor{comment}{//\ Initialize\ the\ first\ two\ Hermite\ polynomials}}
\DoxyCodeLine{00142\ \ \ \ \ Hn\_0\ =\ 1.0;}
\DoxyCodeLine{00143\ \ \ \ \ Hn\_1\ =\ values\ *\ 2.0;}
\DoxyCodeLine{00144\ \ \ \ \ result\ =\ Hn\_0\ *\ coefficients(0,\ 0)\ +\ Hn\_1\ *\ coefficients(1,\ 0);}
\DoxyCodeLine{00145\ }
\DoxyCodeLine{00146\ \ \ \ \ \textcolor{comment}{//\ Compute\ higher\ order\ Hermite\ polynomials\ iteratively}}
\DoxyCodeLine{00147\ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 2;\ i\ <\ order;\ i++)\ \{}
\DoxyCodeLine{00148\ \ \ \ \ \ \ \ \ Hn\ =\ Hn\_1\ *\ values\ *\ 2.0\ -\/\ Hn\_0\ *\ 2.0\ *\ (i\ -\/\ 1.0);}
\DoxyCodeLine{00149\ \ \ \ \ \ \ \ \ Hn\_0\ =\ Hn\_1;}
\DoxyCodeLine{00150\ \ \ \ \ \ \ \ \ Hn\_1\ =\ Hn;}
\DoxyCodeLine{00151\ \ \ \ \ \ \ \ \ result\ +=\ (Hn\ *\ coefficients(i,\ 0));}
\DoxyCodeLine{00152\ \ \ \ \ \}}
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00154\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00155\ \}}
\DoxyCodeLine{00156\ }
\DoxyCodeLine{00164\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00165\ T\ \mbox{\hyperlink{class_hermite_a0bc7a1db6552e72fbc54b07b1e1635cd}{Hermite<T>::evaluate}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients,\ T\ value)\ \{}
\DoxyCodeLine{00166\ }
\DoxyCodeLine{00167\ \ \ \ \ T\ Hn\_0,\ Hn\_1,\ Hn,\ result;}
\DoxyCodeLine{00168\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order\ =\ coefficients.get\_rows();}
\DoxyCodeLine{00169\ \ \ \ \ Hn\_0\ =\ 1.0;}
\DoxyCodeLine{00170\ \ \ \ \ Hn\_1\ =\ value\ *\ 2.0;}
\DoxyCodeLine{00171\ \ \ \ \ result\ =\ Hn\_0\ *\ coefficients(0,\ 0)\ +\ Hn\_1\ *\ coefficients(1,\ 0);}
\DoxyCodeLine{00172\ }
\DoxyCodeLine{00173\ \ \ \ \ \textcolor{comment}{//\ Compute\ higher\ order\ Hermite\ polynomials\ iteratively}}
\DoxyCodeLine{00174\ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 2;\ i\ <\ order;\ i++)\ \{}
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ Hn\ =\ Hn\_1\ *\ value\ *\ 2.0\ -\/\ Hn\_0\ *\ 2.0\ *\ (i\ -\/\ 1.0);}
\DoxyCodeLine{00176\ \ \ \ \ \ \ \ \ Hn\_0\ =\ Hn\_1;}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ Hn\_1\ =\ Hn;}
\DoxyCodeLine{00178\ \ \ \ \ \ \ \ \ result\ +=\ Hn\ *\ coefficients(i,\ 0);}
\DoxyCodeLine{00179\ \ \ \ \ \}}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00181\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00182\ \}}
\DoxyCodeLine{00183\ }
\DoxyCodeLine{00190\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00191\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a4ec149c17829e13e0534adb5a35c6106}{Hermite<T>::coefficients\_deriv}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients)\ \{}
\DoxyCodeLine{00192\ }
\DoxyCodeLine{00193\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order\ =\ coefficients.get\_rows();}
\DoxyCodeLine{00194\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ new\_coefficients(order\ -\/\ 1,\ 1);}
\DoxyCodeLine{00195\ }
\DoxyCodeLine{00196\ \ \ \ \ \textcolor{comment}{//\ Compute\ the\ derivative\ of\ the\ polynomial\ coefficients}}
\DoxyCodeLine{00197\ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 1;\ i\ <\ order;\ i++)\ \{}
\DoxyCodeLine{00198\ \ \ \ \ \ \ \ \ new\_coefficients(i\ -\/\ 1,\ 0)\ =\ 2.0\ *\ i\ *\ coefficients(i,\ 0);}
\DoxyCodeLine{00199\ \ \ \ \ \}}
\DoxyCodeLine{00200\ }
\DoxyCodeLine{00201\ \ \ \ \ \textcolor{keywordflow}{return}\ new\_coefficients;}
\DoxyCodeLine{00202\ \}}
\DoxyCodeLine{00203\ }
\DoxyCodeLine{00214\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00215\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_add73972f2cdeb4c1cb8f800978fe480c}{Hermite<T>::evaluate\_deriv}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients,\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ values)\ \{}
\DoxyCodeLine{00216\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ deriv\_coefficients\ =\ coefficients\_deriv(coefficients);}
\DoxyCodeLine{00217\ \ \ \ \ \textcolor{keywordflow}{return}\ evaluate(deriv\_coefficients,\ values);}
\DoxyCodeLine{00218\ \}}
\DoxyCodeLine{00219\ }
\DoxyCodeLine{00230\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00231\ T\ \mbox{\hyperlink{class_hermite_add73972f2cdeb4c1cb8f800978fe480c}{Hermite<T>::evaluate\_deriv}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients,\ T\ value)\ \{}
\DoxyCodeLine{00232\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ deriv\_coefficients\ =\ coefficients\_deriv(coefficients);}
\DoxyCodeLine{00233\ \ \ \ \ \textcolor{keywordflow}{return}\ evaluate(deriv\_coefficients,\ value);}
\DoxyCodeLine{00234\ \}}
\DoxyCodeLine{00235\ }
\DoxyCodeLine{00245\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00246\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a1d2a6ef569a0ccd15cea95f1eb60605a}{Hermite<T>::import\_data}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ file)\ \{}
\DoxyCodeLine{00247\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ rows,\ cols;}
\DoxyCodeLine{00248\ \ \ \ \ T\ buffer;}
\DoxyCodeLine{00249\ \ \ \ \ std::ifstream\ myfile;}
\DoxyCodeLine{00250\ \ \ \ \ myfile.open(file);}
\DoxyCodeLine{00251\ \ \ \ \ myfile\ >>\ rows\ >>\ cols;}
\DoxyCodeLine{00252\ }
\DoxyCodeLine{00253\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ data(rows,\ cols);}
\DoxyCodeLine{00254\ }
\DoxyCodeLine{00255\ \ \ \ \ \textcolor{comment}{//\ Read\ data\ into\ the\ matrix}}
\DoxyCodeLine{00256\ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ rows;\ i++)\ \{}
\DoxyCodeLine{00257\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ j\ =\ 0;\ j\ <\ cols;\ j++)\ \{}
\DoxyCodeLine{00258\ \ \ \ \ \ \ \ \ \ \ \ \ myfile\ >>\ buffer;}
\DoxyCodeLine{00259\ \ \ \ \ \ \ \ \ \ \ \ \ data(i,\ j)\ =\ buffer;}
\DoxyCodeLine{00260\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00261\ \ \ \ \ \}}
\DoxyCodeLine{00262\ \ \ \ \ myfile.close();}
\DoxyCodeLine{00263\ \ \ \ \ \textcolor{keywordflow}{return}\ data;}
\DoxyCodeLine{00264\ \}}
\DoxyCodeLine{00265\ }
\DoxyCodeLine{00275\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00276\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a4cf467389e6bb8f605e6692e80c7799f}{Hermite<T>::get\_roots}}(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order)\ \{}
\DoxyCodeLine{00277\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ roots(order,\ 1);}
\DoxyCodeLine{00278\ \ \ \ \ \textcolor{keywordflow}{if}\ (order\ >=\ max\_order)\ \{}
\DoxyCodeLine{00279\ \ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Maximum\ order\ exceeded!\(\backslash\)n"{}};}
\DoxyCodeLine{00280\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ roots;}
\DoxyCodeLine{00281\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00282\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ order;\ i++)\ \{}
\DoxyCodeLine{00283\ \ \ \ \ \ \ \ \ \ \ \ \ roots(i,\ 0)\ =\ this-\/>roots(order\ -\/\ 1,\ i);}
\DoxyCodeLine{00284\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00285\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ roots;}
\DoxyCodeLine{00286\ \ \ \ \ \}}
\DoxyCodeLine{00287\ \}}
\DoxyCodeLine{00288\ }
\DoxyCodeLine{00298\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00299\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_ad31dd94ef63c00b04623f4efe224dac2}{Hermite<T>::get\_weights}}(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order)\ \{}
\DoxyCodeLine{00300\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ weights(order,\ 1);}
\DoxyCodeLine{00301\ \ \ \ \ \textcolor{keywordflow}{if}\ (order\ >=\ max\_order)\ \{}
\DoxyCodeLine{00302\ \ \ \ \ \ \ \ \ std::cerr\ <<\ \textcolor{stringliteral}{"{}Maximum\ order\ exceeded!\(\backslash\)n"{}};}
\DoxyCodeLine{00303\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ weights;}
\DoxyCodeLine{00304\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00305\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ order;\ i++)\ \{}
\DoxyCodeLine{00306\ \ \ \ \ \ \ \ \ \ \ \ \ weights(i,\ 0)\ =\ this-\/>weights(order\ -\/\ 1,\ i);}
\DoxyCodeLine{00307\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00308\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ weights;}
\DoxyCodeLine{00309\ \ \ \ \ \}}
\DoxyCodeLine{00310\ \}}
\DoxyCodeLine{00311\ }
\DoxyCodeLine{00323\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00324\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_hermite_a36e11cfd1a5b900ee916481046555e92}{Hermite<T>::compute\_coefficients}}(\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ order,\ T\ (*func)(T))\ \{}
\DoxyCodeLine{00325\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ weights\ =\ get\_weights(order);}
\DoxyCodeLine{00326\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ roots\ =\ get\_roots(order);}
\DoxyCodeLine{00327\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ func\_values(order,\ 1);}
\DoxyCodeLine{00328\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ coefficients(order,\ 1);}
\DoxyCodeLine{00329\ }
\DoxyCodeLine{00330\ \ \ \ \ T\ factorial\ =\ 1.0;}
\DoxyCodeLine{00331\ }
\DoxyCodeLine{00332\ \ \ \ \ \textcolor{comment}{//\ Evaluate\ the\ function\ at\ each\ root}}
\DoxyCodeLine{00333\ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ order;\ i++)\ \{}
\DoxyCodeLine{00334\ \ \ \ \ \ \ \ \ func\_values(i,\ 0)\ =\ *func(roots(i,\ 0));}
\DoxyCodeLine{00335\ \ \ \ \ \}}
\DoxyCodeLine{00336\ }
\DoxyCodeLine{00337\ \ \ \ \ \textcolor{comment}{//\ Compute\ the\ coefficients}}
\DoxyCodeLine{00338\ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ order;\ i++)\ \{}
\DoxyCodeLine{00339\ \ \ \ \ \ \ \ \ coefficients(i,\ 0)\ =\ weights.\mbox{\hyperlink{class_matrix_afcee4f858a2f7dfde3dc28e6d1d32c59}{tr}}().\mbox{\hyperlink{class_matrix_a33b9a1b469adfb4f002564ba874f41c9}{dot}}(func\_values)(0,\ 0)\ /\ std::pow(2,\ i)\ /\ factorial\ /\ std::sqrt(M\_PI);}
\DoxyCodeLine{00340\ \ \ \ \ \ \ \ \ factorial\ *=\ i;}
\DoxyCodeLine{00341\ \ \ \ \ \}}
\DoxyCodeLine{00342\ }
\DoxyCodeLine{00343\ \ \ \ \ \textcolor{keywordflow}{return}\ coefficients;}
\DoxyCodeLine{00344\ \}}

\end{DoxyCode}
