\doxysection{Matrix.\+h}
\hypertarget{_matrix_8h_source}{}\label{_matrix_8h_source}\index{src/Matrix.h@{src/Matrix.h}}
\mbox{\hyperlink{_matrix_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ <iostream>}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <sstream>}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <cstdlib>}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <ctime>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <iomanip>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <fstream>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <exception>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <initializer\_list>}}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00024\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00025\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_matrix}{Matrix}}\ \{}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \ \ \ \ \textcolor{keyword}{private}:}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{long}\ rows,\ cols;\ }
\DoxyCodeLine{00030\ \ \ \ \ \ \ \ \ T*\ data;\ }
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00032\ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00033\ }
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix}}();}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00047\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix}}(\textcolor{keywordtype}{long}\ dim\_x,\ \textcolor{keywordtype}{long}\ dim\_y);}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix}}(\textcolor{keywordtype}{long}\ dim\_x,\ \textcolor{keywordtype}{long}\ dim\_y,\ std::initializer\_list<T>\ l);}
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00065\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix_a91aa704de674203e96aece9e1955ccd3}{\string~Matrix}}();}
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00075\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00076\ }
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix}}(\mbox{\hyperlink{class_matrix}{Matrix}}\&\&\ other);}
\DoxyCodeLine{00087\ }
\DoxyCodeLine{00088\ \ \ \ \ \ \ \ \ T*\ getData()\ \{\textcolor{keywordflow}{return}\ this-\/>data;\}}
\DoxyCodeLine{00089\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{long}\ get\_rows()\textcolor{keyword}{\ const\ }\{\textcolor{keywordflow}{return}\ rows;\}}
\DoxyCodeLine{00090\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{long}\ get\_cols()\textcolor{keyword}{\ const\ }\{\textcolor{keywordflow}{return}\ cols;\}}
\DoxyCodeLine{00091\ }
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_acc03dae842897a0901936ce03f1b75fe}{operator=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_acc03dae842897a0901936ce03f1b75fe}{operator=}}(\mbox{\hyperlink{class_matrix}{Matrix}}\&\&\ other);}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00118\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_acc03dae842897a0901936ce03f1b75fe}{operator=}}(T\ constant);}
\DoxyCodeLine{00119\ }
\DoxyCodeLine{00129\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_a150c69d4533e93d4e8002fe5ac10200a}{operator+=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00130\ }
\DoxyCodeLine{00140\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_a2e80183992919a31dd9fe30916c5c82e}{operator-\/=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00152\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_a757ef8e7398cdf3aa97e6619e984f353}{operator*=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00164\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_ada301b25b3fd3063b1f0a8c834e687a3}{operator/=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00165\ }
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_a150c69d4533e93d4e8002fe5ac10200a}{operator+=}}(T\ other);}
\DoxyCodeLine{00176\ }
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_a2e80183992919a31dd9fe30916c5c82e}{operator-\/=}}(T\ other);}
\DoxyCodeLine{00187\ }
\DoxyCodeLine{00197\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_a757ef8e7398cdf3aa97e6619e984f353}{operator*=}}(T\ other);}
\DoxyCodeLine{00198\ }
\DoxyCodeLine{00209\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ \mbox{\hyperlink{class_matrix_ada301b25b3fd3063b1f0a8c834e687a3}{operator/=}}(T\ other);}
\DoxyCodeLine{00210\ }
\DoxyCodeLine{00211\ }
\DoxyCodeLine{00222\ \ \ \ \ \ \ \ \ T\&\ \mbox{\hyperlink{class_matrix_a107c742879efe5ac59daa485dd1f99ca}{operator()}}(\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{long}\ i,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{long}\ j\ )\ \{\ \textcolor{keywordflow}{return}\ data[i*cols\ +\ j];\ \}}
\DoxyCodeLine{00223\ }
\DoxyCodeLine{00234\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ T\&\ \mbox{\hyperlink{class_matrix_aade66eb55a53e09ae6b2cfa2ccd3b7cb}{operator()}}(\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{long}\ i,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{long}\ j\ )\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ data[i*cols\ +\ j];\ \}}
\DoxyCodeLine{00235\ }
\DoxyCodeLine{00245\ \ \ \ \ \ \ \ \ T\&\ \mbox{\hyperlink{class_matrix_a0a5bec6cf9d67d215259590192b1d6a9}{operator()}}(\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{long}\ n\ )\ \{\ \textcolor{keywordflow}{return}\ data[n];\ \}}
\DoxyCodeLine{00246\ }
\DoxyCodeLine{00256\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ T\&\ \mbox{\hyperlink{class_matrix_a60f642f8f5eadf4ae99695be0c7409ec}{operator()}}(\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{long}\ n\ )\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ data[n];\ \}}
\DoxyCodeLine{00257\ }
\DoxyCodeLine{00258\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator+(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00259\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator-\/(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00260\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator*(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00261\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator/(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00262\ }
\DoxyCodeLine{00263\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator*(T\ constant);}
\DoxyCodeLine{00264\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator/(T\ constant);}
\DoxyCodeLine{00265\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator\string^(T\ constant);}
\DoxyCodeLine{00266\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator+(T\ constant);}
\DoxyCodeLine{00267\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ operator-\/(T\ constant);}
\DoxyCodeLine{00268\ }
\DoxyCodeLine{00278\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ \mbox{\hyperlink{class_matrix_a33b9a1b469adfb4f002564ba874f41c9}{dot}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00279\ }
\DoxyCodeLine{00289\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ \mbox{\hyperlink{class_matrix_a03b588592a081b3bcba0e121ca0164b1}{cross}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00290\ }
\DoxyCodeLine{00300\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ \mbox{\hyperlink{class_matrix_a93a24d7519f7158d4c6b50c92c6c2a0d}{outer}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00301\ }
\DoxyCodeLine{00311\ \ \ \ \ \ \ \ \ std::tuple<Matrix<T>,\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}>\ \mbox{\hyperlink{class_matrix_a2e570e590ed9c4cc887041d3b83363ce}{meshgrid}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix}}\&\ other);}
\DoxyCodeLine{00312\ }
\DoxyCodeLine{00320\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix}}\ \mbox{\hyperlink{class_matrix_afcee4f858a2f7dfde3dc28e6d1d32c59}{tr}}();}
\DoxyCodeLine{00321\ }
\DoxyCodeLine{00329\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_matrix_a7ef7109486e3ba18eced478f5cc568cc}{norm}}();}
\DoxyCodeLine{00330\ }
\DoxyCodeLine{00338\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_matrix_a3291a8c2e19645eec06c8e2d724f4772}{max}}();}
\DoxyCodeLine{00339\ }
\DoxyCodeLine{00347\ \ \ \ \ \ \ \ \ T\ \mbox{\hyperlink{class_matrix_a9301529aec40e450ba77a50afab48646}{min}}();}
\DoxyCodeLine{00348\ }
\DoxyCodeLine{00355\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_matrix_ad13471b4c864eec5335ad1eb70cb85f4}{print}}();}
\DoxyCodeLine{00356\ }
\DoxyCodeLine{00357\ \};}
\DoxyCodeLine{00358\ }
\DoxyCodeLine{00359\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00360\ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix<T>::Matrix}}()\ :\ rows(0),\ cols(0),\ data(nullptr)\ \{\}}
\DoxyCodeLine{00361\ }
\DoxyCodeLine{00362\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00363\ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix<T>::Matrix}}(\textcolor{keywordtype}{long}\ dim\_x,\ \textcolor{keywordtype}{long}\ dim\_y)\ :\ rows(dim\_x),\ cols(dim\_y),\ data(new\ T[rows\ *\ cols])\ \{}
\DoxyCodeLine{00364\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\ \{}
\DoxyCodeLine{00365\ \ \ \ \ \ \ \ \ data[i]\ =\ 0.0;}
\DoxyCodeLine{00366\ \ \ \ \ \}}
\DoxyCodeLine{00367\ \}}
\DoxyCodeLine{00368\ }
\DoxyCodeLine{00369\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00370\ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix<T>::Matrix}}(\textcolor{keywordtype}{long}\ dim\_x,\ \textcolor{keywordtype}{long}\ dim\_y,\ std::initializer\_list<T>\ l)\ :\ rows(dim\_x),\ cols(dim\_y),\ data(new\ T[rows\ *\ cols])\ \{}
\DoxyCodeLine{00371\ \ \ \ \ }
\DoxyCodeLine{00372\ \ \ \ \ \textcolor{keywordflow}{if}(rows\ *\ cols\ !=\ l.size())\ \{}
\DoxyCodeLine{00373\ \ \ \ \ \ \ \ \ std::cout<<\textcolor{stringliteral}{"{}The\ size\ of\ the\ list\ ("{}}<<l.size()<<\textcolor{stringliteral}{"{})\ does\ not\ match\ the\ matrix\ shape\ ("{}}<<dim\_x<<\textcolor{stringliteral}{"{},\ "{}}<<dim\_y<<\textcolor{stringliteral}{"{})\(\backslash\)n"{}};}
\DoxyCodeLine{00374\ \ \ \ \ \}}
\DoxyCodeLine{00375\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00376\ \ \ \ \ \ \ \ \ std::uninitialized\_copy(l.begin(),\ l.end(),\ data);}
\DoxyCodeLine{00377\ \ \ \ \ \}}
\DoxyCodeLine{00378\ \}}
\DoxyCodeLine{00379\ }
\DoxyCodeLine{00380\ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00381\ \mbox{\hyperlink{class_matrix_a91aa704de674203e96aece9e1955ccd3}{Matrix<T>::\string~Matrix}}()\ \{}
\DoxyCodeLine{00382\ \ \ \ \ this-\/>rows\ =\ 0;}
\DoxyCodeLine{00383\ \ \ \ \ this-\/>cols\ =\ 0;}
\DoxyCodeLine{00384\ \ \ \ \ \textcolor{keyword}{delete}[]\ data;}
\DoxyCodeLine{00385\ \ \ \ \ data\ =\ \textcolor{keyword}{nullptr};}
\DoxyCodeLine{00386\ \}}
\DoxyCodeLine{00387\ }
\DoxyCodeLine{00388\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00389\ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix<T>::Matrix}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00390\ \ \ \ \ \textcolor{keywordflow}{if}(\textcolor{keyword}{this}\ !=\ \&other)\ \{}
\DoxyCodeLine{00391\ \ \ \ \ \ \ \ \ this-\/>rows\ =\ other.rows;}
\DoxyCodeLine{00392\ \ \ \ \ \ \ \ \ this-\/>cols\ =\ other.cols;}
\DoxyCodeLine{00393\ \ \ \ \ \ \ \ \ this-\/>data\ =\ \textcolor{keyword}{new}\ T[rows\ *\ cols];}
\DoxyCodeLine{00394\ }
\DoxyCodeLine{00395\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00396\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>data[i]\ =\ other.data[i];}
\DoxyCodeLine{00397\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00398\ \ \ \ \ \}}
\DoxyCodeLine{00399\ \}}
\DoxyCodeLine{00400\ }
\DoxyCodeLine{00401\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00402\ \mbox{\hyperlink{class_matrix_a9d567e3a121b1be0c3f9c461cab524fe}{Matrix<T>::Matrix}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\&\ other)\ \{}
\DoxyCodeLine{00403\ \ \ \ \ \textcolor{keywordflow}{if}(\textcolor{keyword}{this}\ !=\ \&other)\ \{\ }
\DoxyCodeLine{00404\ \ \ \ \ \ \ \ \ this-\/>rows\ =\ other.rows;}
\DoxyCodeLine{00405\ \ \ \ \ \ \ \ \ this-\/>cols\ =\ other.cols;}
\DoxyCodeLine{00406\ \ \ \ \ \ \ \ \ other.rows\ =\ 0;}
\DoxyCodeLine{00407\ \ \ \ \ \ \ \ \ other.cols\ =\ 0;}
\DoxyCodeLine{00408\ }
\DoxyCodeLine{00409\ \ \ \ \ \ \ \ \ this-\/>data\ =\ other.data;}
\DoxyCodeLine{00410\ \ \ \ \ \ \ \ \ other.data\ =\ \textcolor{keyword}{nullptr};}
\DoxyCodeLine{00411\ \ \ \ \ \}}
\DoxyCodeLine{00412\ \ \ \ \ }
\DoxyCodeLine{00413\ \}}
\DoxyCodeLine{00414\ }
\DoxyCodeLine{00415\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00416\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_acc03dae842897a0901936ce03f1b75fe}{Matrix<T>::operator=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00417\ \ \ \ \ \textcolor{keywordflow}{if}(\textcolor{keyword}{this}\ !=\ \&other)\ \{}
\DoxyCodeLine{00418\ \ \ \ \ \ \ \ \ \textcolor{keyword}{delete}[]\ data;}
\DoxyCodeLine{00419\ \ \ \ \ \ \ \ \ this-\/>rows\ =\ other.rows;}
\DoxyCodeLine{00420\ \ \ \ \ \ \ \ \ this-\/>cols\ =\ other.cols;}
\DoxyCodeLine{00421\ \ \ \ \ \ \ \ \ data\ =\ \textcolor{keyword}{new}\ T[rows\ *\ cols];}
\DoxyCodeLine{00422\ }
\DoxyCodeLine{00423\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\ \{}
\DoxyCodeLine{00424\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>data[i]\ =\ other.data[i];}
\DoxyCodeLine{00425\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00426\ \ \ \ \ \}}
\DoxyCodeLine{00427\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00428\ \}}
\DoxyCodeLine{00429\ }
\DoxyCodeLine{00430\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00431\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_acc03dae842897a0901936ce03f1b75fe}{Matrix<T>::operator=}}(\mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\&\ other)\ \{}
\DoxyCodeLine{00432\ \ \ \ \ \textcolor{keywordflow}{if}(\textcolor{keyword}{this}\ !=\ \&other)\ \{}
\DoxyCodeLine{00433\ \ \ \ \ \ \ \ \ \textcolor{keyword}{delete}[]\ data;}
\DoxyCodeLine{00434\ \ \ \ \ \ \ \ \ this-\/>rows\ =\ other.rows;}
\DoxyCodeLine{00435\ \ \ \ \ \ \ \ \ this-\/>cols\ =\ other.cols;}
\DoxyCodeLine{00436\ \ \ \ \ \ \ \ \ this-\/>data\ =\ other.data;}
\DoxyCodeLine{00437\ \ \ \ \ \ \ \ \ other.rows\ =\ 0;}
\DoxyCodeLine{00438\ \ \ \ \ \ \ \ \ other.cols\ =\ 0;}
\DoxyCodeLine{00439\ \ \ \ \ \ \ \ \ other.data\ =\ \textcolor{keyword}{nullptr};}
\DoxyCodeLine{00440\ \ \ \ \ \}}
\DoxyCodeLine{00441\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00442\ \}}
\DoxyCodeLine{00443\ }
\DoxyCodeLine{00444\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00445\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_acc03dae842897a0901936ce03f1b75fe}{Matrix<T>::operator=}}(T\ constant)\ \{}
\DoxyCodeLine{00446\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\ \{}
\DoxyCodeLine{00447\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>data[i]\ =\ constant;}
\DoxyCodeLine{00448\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00449\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00450\ \}}
\DoxyCodeLine{00451\ }
\DoxyCodeLine{00452\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00453\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_a150c69d4533e93d4e8002fe5ac10200a}{Matrix<T>::operator+=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00454\ \ \ \ \ \ \textcolor{keywordflow}{if}(this-\/>rows\ !=\ other.rows\ ||\ this-\/>cols\ !=\ other.cols)\ \{}
\DoxyCodeLine{00455\ \ \ \ \ \ \ \ \ std::cout<<\textcolor{stringliteral}{"{}Matrix\ dimensions\ do\ not\ match!\(\backslash\)n"{}};}
\DoxyCodeLine{00456\ \ \ \ \ \}}
\DoxyCodeLine{00457\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00458\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00459\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>data[i]\ +=\ other.data[i];}
\DoxyCodeLine{00460\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00461\ \ \ \ \ \}}
\DoxyCodeLine{00462\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00463\ \}}
\DoxyCodeLine{00464\ }
\DoxyCodeLine{00465\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00466\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_a2e80183992919a31dd9fe30916c5c82e}{Matrix<T>::operator-\/=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00467\ \ \ \ \ \ \textcolor{keywordflow}{if}(this-\/>rows\ !=\ other.rows\ ||\ this-\/>cols\ !=\ other.cols)\ \{}
\DoxyCodeLine{00468\ \ \ \ \ \ \ \ \ std::cout<<\textcolor{stringliteral}{"{}Matrix\ dimensions\ do\ not\ match!\(\backslash\)n"{}};}
\DoxyCodeLine{00469\ \ \ \ \ \}}
\DoxyCodeLine{00470\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00471\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00472\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>data[i]\ -\/=\ other.data[i];}
\DoxyCodeLine{00473\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00474\ \ \ \ \ \}}
\DoxyCodeLine{00475\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00476\ \}}
\DoxyCodeLine{00477\ }
\DoxyCodeLine{00478\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00479\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_a757ef8e7398cdf3aa97e6619e984f353}{Matrix<T>::operator*=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00480\ \ \ \ \ \ \textcolor{keywordflow}{if}(this-\/>rows\ !=\ other.rows\ ||\ this-\/>cols\ !=\ other.cols)\ \{}
\DoxyCodeLine{00481\ \ \ \ \ \ \ \ \ std::cout<<\textcolor{stringliteral}{"{}Matrix\ dimensions\ do\ not\ match!\(\backslash\)n"{}};}
\DoxyCodeLine{00482\ \ \ \ \ \}}
\DoxyCodeLine{00483\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00484\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00485\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>data[i]\ *=\ other.data[i];}
\DoxyCodeLine{00486\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00487\ \ \ \ \ \}}
\DoxyCodeLine{00488\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00489\ \}}
\DoxyCodeLine{00490\ }
\DoxyCodeLine{00491\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00492\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_ada301b25b3fd3063b1f0a8c834e687a3}{Matrix<T>::operator/=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00493\ \ \ \ \ \ \textcolor{keywordflow}{if}(this-\/>rows\ !=\ other.rows\ ||\ this-\/>cols\ !=\ other.cols)\ \{}
\DoxyCodeLine{00494\ \ \ \ \ \ \ \ \ std::cout<<\textcolor{stringliteral}{"{}Matrix\ dimensions\ do\ not\ match!\(\backslash\)n"{}};}
\DoxyCodeLine{00495\ \ \ \ \ \}}
\DoxyCodeLine{00496\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00497\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00498\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>data[i]\ /=\ other.data[i];}
\DoxyCodeLine{00499\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00500\ \ \ \ \ \}}
\DoxyCodeLine{00501\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00502\ \}}
\DoxyCodeLine{00503\ }
\DoxyCodeLine{00504\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00505\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_a757ef8e7398cdf3aa97e6619e984f353}{Matrix<T>::operator*=}}(T\ other)\ \{}
\DoxyCodeLine{00506\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00507\ \ \ \ \ \ \ \ \ data[i]\ *=\ other;}
\DoxyCodeLine{00508\ \ \ \ \ \}}
\DoxyCodeLine{00509\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00510\ \}}
\DoxyCodeLine{00511\ }
\DoxyCodeLine{00512\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00513\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_ada301b25b3fd3063b1f0a8c834e687a3}{Matrix<T>::operator/=}}(T\ other)\ \{}
\DoxyCodeLine{00514\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00515\ \ \ \ \ \ \ \ \ data[i]\ /=\ other;}
\DoxyCodeLine{00516\ \ \ \ \ \}}
\DoxyCodeLine{00517\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00518\ \}}
\DoxyCodeLine{00519\ }
\DoxyCodeLine{00520\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00521\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_a150c69d4533e93d4e8002fe5ac10200a}{Matrix<T>::operator+=}}(T\ other)\ \{}
\DoxyCodeLine{00522\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00523\ \ \ \ \ \ \ \ \ data[i]\ +=\ other;}
\DoxyCodeLine{00524\ \ \ \ \ \}}
\DoxyCodeLine{00525\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00526\ \}}
\DoxyCodeLine{00527\ }
\DoxyCodeLine{00528\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00529\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ \mbox{\hyperlink{class_matrix_a2e80183992919a31dd9fe30916c5c82e}{Matrix<T>::operator-\/=}}(T\ other)\ \{}
\DoxyCodeLine{00530\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\{}
\DoxyCodeLine{00531\ \ \ \ \ \ \ \ \ data[i]\ -\/=\ other;}
\DoxyCodeLine{00532\ \ \ \ \ \}}
\DoxyCodeLine{00533\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00534\ \}}
\DoxyCodeLine{00535\ }
\DoxyCodeLine{00536\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00537\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator+}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00538\ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00539\ \ \ \ res\ +=\ other;}
\DoxyCodeLine{00540\ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00541\ \}}
\DoxyCodeLine{00542\ }
\DoxyCodeLine{00543\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00544\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator+}}(T\ other)\ \{}
\DoxyCodeLine{00545\ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00546\ \ \ \ res\ +=\ other;}
\DoxyCodeLine{00547\ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00548\ \}}
\DoxyCodeLine{00549\ }
\DoxyCodeLine{00550\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00551\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator-\/}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00552\ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00553\ \ \ \ res\ -\/=\ other;}
\DoxyCodeLine{00554\ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00555\ \}}
\DoxyCodeLine{00556\ }
\DoxyCodeLine{00557\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00558\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator-\/}}(T\ other)\ \{}
\DoxyCodeLine{00559\ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00560\ \ \ \ res\ -\/=\ other;}
\DoxyCodeLine{00561\ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00562\ \}}
\DoxyCodeLine{00563\ }
\DoxyCodeLine{00564\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00565\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator*}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00566\ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00567\ \ \ \ res\ *=\ other;}
\DoxyCodeLine{00568\ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00569\ \}}
\DoxyCodeLine{00570\ }
\DoxyCodeLine{00571\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00572\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator*}}(T\ other)\ \{}
\DoxyCodeLine{00573\ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00574\ \ \ \ res\ *=\ other;}
\DoxyCodeLine{00575\ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00576\ \}}
\DoxyCodeLine{00577\ }
\DoxyCodeLine{00578\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00579\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator/}}(T\ other)\ \{}
\DoxyCodeLine{00580\ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00581\ \ \ \ res\ /=\ other;}
\DoxyCodeLine{00582\ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00583\ \}}
\DoxyCodeLine{00584\ }
\DoxyCodeLine{00585\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00586\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator/}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00587\ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00588\ \ \ \ res\ /=\ other;}
\DoxyCodeLine{00589\ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00590\ \}}
\DoxyCodeLine{00591\ }
\DoxyCodeLine{00592\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00593\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix}{Matrix<T>::operator\string^}}(T\ constant)\ \{}
\DoxyCodeLine{00594\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(*\textcolor{keyword}{this});}
\DoxyCodeLine{00595\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows;\ i\ ++)\{}
\DoxyCodeLine{00596\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ j\ =\ 0;\ j\ <\ cols;\ j\ ++)\ \{}
\DoxyCodeLine{00597\ \ \ \ \ \ \ \ \ \ \ \ \ res(i,\ j)\ =\ pow(this-\/>data[i\ *\ cols\ +\ j],\ constant);}
\DoxyCodeLine{00598\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00599\ \ \ \ \ \}}
\DoxyCodeLine{00600\ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00601\ \}}
\DoxyCodeLine{00602\ }
\DoxyCodeLine{00603\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00604\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix_a33b9a1b469adfb4f002564ba874f41c9}{Matrix<T>::dot}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00605\ }
\DoxyCodeLine{00606\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ res(this-\/>rows,\ other.cols);}
\DoxyCodeLine{00607\ }
\DoxyCodeLine{00608\ \ \ \ \ \textcolor{keywordflow}{if}(this-\/>cols\ !=\ other.rows)\ \{}
\DoxyCodeLine{00609\ \ \ \ \ \ \ \ \ std::cout<<\textcolor{stringliteral}{"{}Matrix\ dimensions\ of\ ("{}}<<this-\/>rows<<\textcolor{stringliteral}{"{},\ "{}}<<this-\/>cols<<\textcolor{stringliteral}{"{})\ and\ ("{}}<<other.rows<<\textcolor{stringliteral}{"{},\ "{}}<<other.cols<<\textcolor{stringliteral}{"{})\ are\ not\ compatible!\(\backslash\)n"{}};}
\DoxyCodeLine{00610\ \ \ \ \ \}}
\DoxyCodeLine{00611\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00612\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ this-\/>rows;\ i\ ++)\ \{}
\DoxyCodeLine{00613\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ j\ =\ 0;\ j\ <\ other.cols;\ j\ ++)\ \{}
\DoxyCodeLine{00614\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ k\ =\ 0;\ k\ <\ this-\/>cols;\ k\ ++)\ \{}
\DoxyCodeLine{00615\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ res.data[i\ *\ other.cols\ +\ j]\ +=\ this-\/>data[i\ *\ this-\/>cols\ +\ k]\ *\ other.data[k\ *\ other.cols\ +\ j];}
\DoxyCodeLine{00616\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00617\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00618\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00619\ \ \ \ \ \}}
\DoxyCodeLine{00620\ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00621\ \}}
\DoxyCodeLine{00622\ }
\DoxyCodeLine{00623\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>\ }
\DoxyCodeLine{00624\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix_a03b588592a081b3bcba0e121ca0164b1}{Matrix<T>::cross}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00625\ }
\DoxyCodeLine{00626\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ result(3,\ 1);}
\DoxyCodeLine{00627\ \ \ \ \ \textcolor{keywordflow}{if}(this-\/>rows\ !=\ 3\ ||\ this-\/>cols\ !=\ 1\ ||\ other.rows\ !=\ 3\ ||\ other.cols\ !=\ 1)\ \{}
\DoxyCodeLine{00628\ \ \ \ \ \ \ \ \ std::cerr<<\textcolor{stringliteral}{"{}Dimensions\ incompatible\ with\ the\ cross\ product\ operation!\(\backslash\)n"{}};}
\DoxyCodeLine{00629\ \ \ \ \ \}}
\DoxyCodeLine{00630\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00631\ \ \ \ \ \ \ \ \ result(0,\ 0)\ =\ this-\/>data[1\ *\ cols\ +\ 0]\ *\ other(2,\ 0)\ -\/\ this-\/>data[2\ *\ cols\ +\ 0]\ *\ other(1,\ 0);}
\DoxyCodeLine{00632\ \ \ \ \ \ \ \ \ result(1,\ 0)\ =\ this-\/>data[2\ *\ cols\ +\ 0]\ *\ other(0,\ 0)\ -\/\ this-\/>data[0\ *\ cols\ +\ 0]\ *\ other(2,\ 0);}
\DoxyCodeLine{00633\ \ \ \ \ \ \ \ \ result(2,\ 0)\ =\ this-\/>data[0\ *\ cols\ +\ 0]\ *\ other(1,\ 0)\ -\/\ this-\/>data[1\ *\ cols\ +\ 0]\ *\ other(0,\ 0);}
\DoxyCodeLine{00634\ \ \ \ \ \}}
\DoxyCodeLine{00635\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00636\ \}}
\DoxyCodeLine{00637\ }
\DoxyCodeLine{00638\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>\ }
\DoxyCodeLine{00639\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix_a93a24d7519f7158d4c6b50c92c6c2a0d}{Matrix<T>::outer}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00640\ }
\DoxyCodeLine{00641\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ result(this-\/>rows,\ other.rows);}
\DoxyCodeLine{00642\ \ \ \ \ \textcolor{keywordflow}{if}(this-\/>cols\ !=\ 1\ ||\ other.cols\ !=\ 1)\ \{}
\DoxyCodeLine{00643\ \ \ \ \ \ \ \ \ std::cerr<<\textcolor{stringliteral}{"{}Dimensions\ incompatible\ with\ the\ outer\ product\ operation!\(\backslash\)n"{}};}
\DoxyCodeLine{00644\ \ \ \ \ \}}
\DoxyCodeLine{00645\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00646\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ this-\/>rows;\ i\ ++)\ \{}
\DoxyCodeLine{00647\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ j\ =\ 0;\ j\ <\ other.rows;\ j\ ++)\ \{}
\DoxyCodeLine{00648\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ result(i,\ j)\ =\ this-\/>data[j]\ *\ other(i);}
\DoxyCodeLine{00649\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00650\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00651\ \ \ \ \ \}}
\DoxyCodeLine{00652\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00653\ \}}
\DoxyCodeLine{00654\ }
\DoxyCodeLine{00655\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>\ }
\DoxyCodeLine{00656\ std::tuple<Matrix<T>,\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}>\ \mbox{\hyperlink{class_matrix_a2e570e590ed9c4cc887041d3b83363ce}{Matrix<T>::meshgrid}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00657\ }
\DoxyCodeLine{00658\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ mat1(this-\/>rows,\ other.rows),\ mat2(this-\/>rows,\ other.rows);}
\DoxyCodeLine{00659\ \ \ \ \ \textcolor{keywordflow}{if}(this-\/>cols\ !=\ 1\ ||\ other.cols\ !=\ 1)\ \{}
\DoxyCodeLine{00660\ \ \ \ \ \ \ \ \ std::cerr<<\textcolor{stringliteral}{"{}Dimensions\ incompatible\ with\ the\ outer\ product\ operation!\(\backslash\)n"{}};}
\DoxyCodeLine{00661\ \ \ \ \ \}}
\DoxyCodeLine{00662\ \ \ \ \ \textcolor{keywordflow}{else}\{}
\DoxyCodeLine{00663\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ this-\/>rows;\ i\ ++)\ \{}
\DoxyCodeLine{00664\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ j\ =\ 0;\ j\ <\ other.rows;\ j\ ++)\ \{}
\DoxyCodeLine{00665\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mat1(i,\ j)\ =\ this-\/>data[i];}
\DoxyCodeLine{00666\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mat2(i,\ j)\ =\ other(j);}
\DoxyCodeLine{00667\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00668\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00669\ \ \ \ \ \}}
\DoxyCodeLine{00670\ \ \ \ \ \textcolor{keywordflow}{return}\ std::make\_tuple(mat1,\ mat2);}
\DoxyCodeLine{00671\ \}}
\DoxyCodeLine{00672\ }
\DoxyCodeLine{00673\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00674\ T\ \mbox{\hyperlink{class_matrix_a7ef7109486e3ba18eced478f5cc568cc}{Matrix<T>::norm}}()\ \{}
\DoxyCodeLine{00675\ \ \ \ \ T\ res\ =\ 0.0;}
\DoxyCodeLine{00676\ }
\DoxyCodeLine{00677\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\ \{}
\DoxyCodeLine{00678\ \ \ \ \ \ \ \ \ res\ +=\ this-\/>data[i]\ *\ this-\/>data[i];}
\DoxyCodeLine{00679\ \ \ \ \ \}}
\DoxyCodeLine{00680\ }
\DoxyCodeLine{00681\ \ \ \ \ \textcolor{keywordflow}{return}\ sqrt(res);}
\DoxyCodeLine{00682\ \}}
\DoxyCodeLine{00683\ }
\DoxyCodeLine{00684\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>\ }
\DoxyCodeLine{00685\ T\ \mbox{\hyperlink{class_matrix_a3291a8c2e19645eec06c8e2d724f4772}{Matrix<T>::max}}()\ \{}
\DoxyCodeLine{00686\ \ \ \ \ T\ max\_value\ =\ -\/1e13;}
\DoxyCodeLine{00687\ }
\DoxyCodeLine{00688\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\ \{}
\DoxyCodeLine{00689\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(max\_value\ <\ data[i])\ max\_value\ =\ data[i];}
\DoxyCodeLine{00690\ \ \ \ \ \}}
\DoxyCodeLine{00691\ \ \ \ \ \textcolor{keywordflow}{return}\ max\_value;}
\DoxyCodeLine{00692\ \}}
\DoxyCodeLine{00693\ }
\DoxyCodeLine{00694\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>\ }
\DoxyCodeLine{00695\ T\ \mbox{\hyperlink{class_matrix_a9301529aec40e450ba77a50afab48646}{Matrix<T>::min}}()\ \{}
\DoxyCodeLine{00696\ \ \ \ \ T\ min\_value\ =\ 1e13;}
\DoxyCodeLine{00697\ }
\DoxyCodeLine{00698\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ rows\ *\ cols;\ i\ ++)\ \{}
\DoxyCodeLine{00699\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(min\_value\ >\ data[i])\ min\_value\ =\ data[i];}
\DoxyCodeLine{00700\ \ \ \ \ \}}
\DoxyCodeLine{00701\ \ \ \ \ \textcolor{keywordflow}{return}\ min\_value;}
\DoxyCodeLine{00702\ \}}
\DoxyCodeLine{00703\ }
\DoxyCodeLine{00704\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00705\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ \mbox{\hyperlink{class_matrix_afcee4f858a2f7dfde3dc28e6d1d32c59}{Matrix<T>::tr}}()\ \{}
\DoxyCodeLine{00706\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ new\_matrix(cols,\ rows);}
\DoxyCodeLine{00707\ }
\DoxyCodeLine{00708\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ rows;\ i\ ++)\ \{}
\DoxyCodeLine{00709\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ j\ =\ 0;\ j\ <\ cols;\ j\ ++)\ \{}
\DoxyCodeLine{00710\ \ \ \ \ \ \ \ \ \ \ \ \ new\_matrix(j,\ i)\ =\ data[i\ *\ cols\ +\ j];}
\DoxyCodeLine{00711\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00712\ \ \ \ \ \}}
\DoxyCodeLine{00713\ }
\DoxyCodeLine{00714\ \ \ \ \ \textcolor{keywordflow}{return}\ new\_matrix;}
\DoxyCodeLine{00715\ \}}
\DoxyCodeLine{00716\ }
\DoxyCodeLine{00717\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00718\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ cos(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00719\ }
\DoxyCodeLine{00720\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ result(other.get\_rows(),\ other.get\_cols());}
\DoxyCodeLine{00721\ }
\DoxyCodeLine{00722\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ other.get\_rows()\ *\ other.get\_cols();\ i\ ++)\{}
\DoxyCodeLine{00723\ \ \ \ \ \ \ \ \ result(i)\ =\ std::cos(other(i));}
\DoxyCodeLine{00724\ \ \ \ \ \}}
\DoxyCodeLine{00725\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00726\ \}}
\DoxyCodeLine{00727\ }
\DoxyCodeLine{00728\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00729\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ sin(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00730\ }
\DoxyCodeLine{00731\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ result(other.get\_rows(),\ other.get\_cols());}
\DoxyCodeLine{00732\ }
\DoxyCodeLine{00733\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ other.get\_rows()\ *\ other.get\_cols();\ i\ ++)\{}
\DoxyCodeLine{00734\ \ \ \ \ \ \ \ \ result(i)\ =\ std::sin(other(i));}
\DoxyCodeLine{00735\ \ \ \ \ \}}
\DoxyCodeLine{00736\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00737\ \}}
\DoxyCodeLine{00738\ }
\DoxyCodeLine{00739\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00740\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ tan(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00741\ }
\DoxyCodeLine{00742\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ result(other.get\_rows(),\ other.get\_cols());}
\DoxyCodeLine{00743\ }
\DoxyCodeLine{00744\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ other.get\_rows()\ *\ other.get\_cols();\ i\ ++)\{}
\DoxyCodeLine{00745\ \ \ \ \ \ \ \ \ result(i)\ =\ std::tan(other(i));}
\DoxyCodeLine{00746\ \ \ \ \ \}}
\DoxyCodeLine{00747\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00748\ \}}
\DoxyCodeLine{00749\ }
\DoxyCodeLine{00750\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00751\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ exp(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00752\ }
\DoxyCodeLine{00753\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ result(other.get\_rows(),\ other.get\_cols());}
\DoxyCodeLine{00754\ }
\DoxyCodeLine{00755\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ other.get\_rows()\ *\ other.get\_cols();\ i\ ++)\{}
\DoxyCodeLine{00756\ \ \ \ \ \ \ \ \ result(i)\ =\ std::exp(other(i));}
\DoxyCodeLine{00757\ \ \ \ \ \}}
\DoxyCodeLine{00758\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00759\ \}}
\DoxyCodeLine{00760\ }
\DoxyCodeLine{00761\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00762\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ erf(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00763\ }
\DoxyCodeLine{00764\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ result(other.get\_rows(),\ other.get\_cols());}
\DoxyCodeLine{00765\ }
\DoxyCodeLine{00766\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ other.get\_rows()\ *\ other.get\_cols();\ i\ ++)\{}
\DoxyCodeLine{00767\ \ \ \ \ \ \ \ \ result(i)\ =\ std::erf(other(i));}
\DoxyCodeLine{00768\ \ \ \ \ \}}
\DoxyCodeLine{00769\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00770\ \}}
\DoxyCodeLine{00771\ }
\DoxyCodeLine{00772\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00773\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ erfc(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00774\ }
\DoxyCodeLine{00775\ \ \ \ \ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\ result(other.get\_rows(),\ other.get\_cols());}
\DoxyCodeLine{00776\ }
\DoxyCodeLine{00777\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ other.get\_rows()\ *\ other.get\_cols();\ i\ ++)\{}
\DoxyCodeLine{00778\ \ \ \ \ \ \ \ \ result(i)\ =\ std::erfc(other(i));}
\DoxyCodeLine{00779\ \ \ \ \ \}}
\DoxyCodeLine{00780\ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{00781\ \}}
\DoxyCodeLine{00782\ }
\DoxyCodeLine{00783\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00784\ T\ sum(\textcolor{keyword}{const}\ \mbox{\hyperlink{class_matrix}{Matrix<T>}}\&\ other)\ \{}
\DoxyCodeLine{00785\ \ \ \ \ T\ res\ =\ 0.0;}
\DoxyCodeLine{00786\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{long}\ i\ =\ 0;\ i\ <\ other.get\_rows()\ *\ other.get\_cols();\ i\ ++)\{}
\DoxyCodeLine{00787\ \ \ \ \ \ \ \ \ res\ +=\ other(i);}
\DoxyCodeLine{00788\ \ \ \ \ \}}
\DoxyCodeLine{00789\ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00790\ \}}
\DoxyCodeLine{00791\ }
\DoxyCodeLine{00792\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00793\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{class_matrix_ad13471b4c864eec5335ad1eb70cb85f4}{Matrix<T>::print}}()\ \{}
\DoxyCodeLine{00794\ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ i\ =\ 0;\ i\ <\ rows;\ i\ ++)\ \{}
\DoxyCodeLine{00795\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{auto}\ j\ =\ 0;\ j\ <\ cols;\ j\ ++)\ \{}
\DoxyCodeLine{00796\ \ \ \ \ \ \ \ \ \ \ \ \ std::cout<<data[i\ *\ cols\ +\ j]\ <<\textcolor{stringliteral}{"{}\ "{}};}
\DoxyCodeLine{00797\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00798\ \ \ \ \ \ \ \ \ std::cout<<\textcolor{stringliteral}{"{}\(\backslash\)n"{}};}
\DoxyCodeLine{00799\ \ \ \ \ \}}
\DoxyCodeLine{00800\ \}}

\end{DoxyCode}
