\hypertarget{return__mex__arguments_8cpp}{
\section{D:/Basile/Visual\-Cpp\-Projects/hydro\-MEX3/hydro\-MEX3/hydro\_\-source/return\_\-mex\_\-arguments.cpp File Reference}
\label{return__mex__arguments_8cpp}\index{D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/hydro_source/return_mex_arguments.cpp@{D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/hydro\_\-source/return\_\-mex\_\-arguments.cpp}}
}
{\tt \#include $<$vector$>$}\par
{\tt \#include \char`\"{}Datas.h\char`\"{}}\par
{\tt \#include \char`\"{}return\_\-mex\_\-arguments.h\char`\"{}}\par
{\tt \#include \char`\"{}../CVODEincludes.h\char`\"{}}\par


Include dependency graph for return\_\-mex\_\-arguments.cpp:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=396pt]{return__mex__arguments_8cpp__incl}
\end{center}
\end{figure}
\subsection*{Namespaces}
\begin{CompactItemize}
\item 
namespace \hyperlink{namespacestd}{std}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{return__mex__arguments_8cpp_1daf785e3f68d293c7caa1c756d5cb74}{pi}~3.141592653589793
\item 
\#define \hyperlink{return__mex__arguments_8cpp_598a3330b3c21701223ee0ca14316eca}{PI}~3.141592653589793
\item 
\#define \hyperlink{return__mex__arguments_8cpp_07521380e95cb0bd9c30b37bf54089eb}{Ith}(v, i)~NV\_\-Ith\_\-S(v,i)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{return__mex__arguments_8cpp_d2368af67b5d678064df80edc11257b2}{store\_\-state} (double time, N\_\-Vector state\_\-at\_\-t)
\begin{CompactList}\small\item\em Store state vector $ \vec{q}_i $ and time $ t_i $ at each integration step. \item\end{CompactList}\item 
void \hyperlink{return__mex__arguments_8cpp_5aded7adb5403b2287fd952357da3742}{return\_\-args} (int nlhs, mx\-Array $\ast$plhs\mbox{[}$\,$\mbox{]}, int nrhs, const mx\-Array $\ast$prhs\mbox{[}$\,$\mbox{]}, \hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$f\_\-dat)
\begin{CompactList}\small\item\em Return arguments to MATLAB. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_4e1a91233e835b33479dc328f89f1975}{sout00}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_67ec92c22b4cff098b52a8a66d1f5558}{sout01}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_6869a0e82689f86c8fcfa28e665301a7}{sout02}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_d792cf03b09ceab73a1ee75973ed485c}{sout03}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_3a6ade7359ab9e79b5356aa095f0c5e4}{sout04}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_2a885507676f94311f1b63dfcd5874b7}{sout05}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_4e26a8fbe732d7be4f3d576b98186360}{sout06}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_e6ab53ac05f43a798e08af450f27849b}{sout07}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_eb107442d4c3090afaaba1ff3bacd159}{sout08}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_f78590b7af9d94ec8eeb11c107f455ae}{sout09}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_2b5129a680ece4f402eb0bbdb6d15835}{sout10}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_07efe09485243d1474b01a74eb5702cf}{sout11}
\item 
vector$<$ double $>$ \hyperlink{return__mex__arguments_8cpp_bed414d237d66a8c197d1ef2db27a01a}{timev}
\end{CompactItemize}


\subsection{Detailed Description}
\begin{Desc}
\item[Author:]\href{mailto:basile.graf@epfl.ch}{\tt basile.graf@epfl.ch}\end{Desc}
This file contains functions for returning parameters to MATLAB 

Definition in file \hyperlink{return__mex__arguments_8cpp-source}{return\_\-mex\_\-arguments.cpp}.

\subsection{Define Documentation}
\hypertarget{return__mex__arguments_8cpp_07521380e95cb0bd9c30b37bf54089eb}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!Ith@{Ith}}
\index{Ith@{Ith}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[Ith]{\setlength{\rightskip}{0pt plus 5cm}\#define Ith(v, i)~NV\_\-Ith\_\-S(v,i)}}
\label{return__mex__arguments_8cpp_07521380e95cb0bd9c30b37bf54089eb}




Definition at line 24 of file return\_\-mex\_\-arguments.cpp.\hypertarget{return__mex__arguments_8cpp_598a3330b3c21701223ee0ca14316eca}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!PI@{PI}}
\index{PI@{PI}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[PI]{\setlength{\rightskip}{0pt plus 5cm}\#define PI~3.141592653589793}}
\label{return__mex__arguments_8cpp_598a3330b3c21701223ee0ca14316eca}




Definition at line 21 of file return\_\-mex\_\-arguments.cpp.\hypertarget{return__mex__arguments_8cpp_1daf785e3f68d293c7caa1c756d5cb74}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!pi@{pi}}
\index{pi@{pi}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[pi]{\setlength{\rightskip}{0pt plus 5cm}\#define pi~3.141592653589793}}
\label{return__mex__arguments_8cpp_1daf785e3f68d293c7caa1c756d5cb74}




Definition at line 20 of file return\_\-mex\_\-arguments.cpp.

\subsection{Function Documentation}
\hypertarget{return__mex__arguments_8cpp_5aded7adb5403b2287fd952357da3742}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!return_args@{return\_\-args}}
\index{return_args@{return\_\-args}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[return\_\-args]{\setlength{\rightskip}{0pt plus 5cm}void return\_\-args (int {\em nlhs}, mx\-Array $\ast$ {\em plhs}\mbox{[}$\,$\mbox{]}, int {\em nrhs}, const mx\-Array $\ast$ {\em prhs}\mbox{[}$\,$\mbox{]}, \hyperlink{struct_o_d_e__data}{ODE\_\-data} $\ast$ {\em f\_\-dat})}}
\label{return__mex__arguments_8cpp_5aded7adb5403b2287fd952357da3742}


Return arguments to MATLAB. 

Return the simulation results and simulation times (if asked for, see \hyperlink{get__mex__arguments_8cpp_78bf47f99d3da4252677a9587f93cc39}{get\_\-time()}) and the cumulative number of integration steps performed (generally bigger than number of output points) \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em nlhs}]Number of left hand side arguments in the MATLAB prompt \item[{\em $\ast$plhs\mbox{[}$\,$\mbox{]}}]Array of pointers to the left hand side arguments from MATLAB prompt \item[{\em nrhs}]Number of right hand side arguments in the MATLAB prompt \item[{\em $\ast$prhs\mbox{[}$\,$\mbox{]}}]Array of pointers to the right hand side arguments from MATLAB prompt \item[{\em $\ast$f\_\-dat}]ODE solver data struct \end{description}
\end{Desc}


Definition at line 60 of file return\_\-mex\_\-arguments.cpp.

References sout00, sout01, sout02, sout03, sout04, sout05, sout06, sout07, sout08, sout09, sout10, and sout11.

Referenced by mex\-Function().\hypertarget{return__mex__arguments_8cpp_d2368af67b5d678064df80edc11257b2}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!store_state@{store\_\-state}}
\index{store_state@{store\_\-state}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[store\_\-state]{\setlength{\rightskip}{0pt plus 5cm}void store\_\-state (double {\em time}, N\_\-Vector {\em state\_\-at\_\-t})}}
\label{return__mex__arguments_8cpp_d2368af67b5d678064df80edc11257b2}


Store state vector $ \vec{q}_i $ and time $ t_i $ at each integration step. 

If the programm has to return simulation results to MATLAB (see \hyperlink{get__mex__arguments_8cpp_78bf47f99d3da4252677a9587f93cc39}{get\_\-time()}), the state vector $ \vec{q}_i $ and the time $ t_i $ has to be stored at each integration step. They are stored in dynamic C++ vectors of type vector. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em time}]$ t_i $ \item[{\em state\_\-at\_\-t}]$ \vec{q}_i $ in the data format used by the SUNDIALS ODE solver CVODE \end{description}
\end{Desc}


Definition at line 43 of file return\_\-mex\_\-arguments.cpp.

References Ith, sout00, sout01, sout02, sout03, sout04, sout05, sout06, sout07, sout08, sout09, sout10, sout11, and timev.

Referenced by solve\_\-ODE().

\subsection{Variable Documentation}
\hypertarget{return__mex__arguments_8cpp_4e1a91233e835b33479dc328f89f1975}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout00@{sout00}}
\index{sout00@{sout00}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout00]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_4e1a91233e835b33479dc328f89f1975}{sout00}}}
\label{return__mex__arguments_8cpp_4e1a91233e835b33479dc328f89f1975}




Definition at line 29 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_67ec92c22b4cff098b52a8a66d1f5558}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout01@{sout01}}
\index{sout01@{sout01}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout01]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_67ec92c22b4cff098b52a8a66d1f5558}{sout01}}}
\label{return__mex__arguments_8cpp_67ec92c22b4cff098b52a8a66d1f5558}




Definition at line 30 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_6869a0e82689f86c8fcfa28e665301a7}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout02@{sout02}}
\index{sout02@{sout02}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout02]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_6869a0e82689f86c8fcfa28e665301a7}{sout02}}}
\label{return__mex__arguments_8cpp_6869a0e82689f86c8fcfa28e665301a7}




Definition at line 31 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_d792cf03b09ceab73a1ee75973ed485c}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout03@{sout03}}
\index{sout03@{sout03}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout03]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_d792cf03b09ceab73a1ee75973ed485c}{sout03}}}
\label{return__mex__arguments_8cpp_d792cf03b09ceab73a1ee75973ed485c}




Definition at line 32 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_3a6ade7359ab9e79b5356aa095f0c5e4}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout04@{sout04}}
\index{sout04@{sout04}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout04]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_3a6ade7359ab9e79b5356aa095f0c5e4}{sout04}}}
\label{return__mex__arguments_8cpp_3a6ade7359ab9e79b5356aa095f0c5e4}




Definition at line 33 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_2a885507676f94311f1b63dfcd5874b7}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout05@{sout05}}
\index{sout05@{sout05}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout05]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_2a885507676f94311f1b63dfcd5874b7}{sout05}}}
\label{return__mex__arguments_8cpp_2a885507676f94311f1b63dfcd5874b7}




Definition at line 34 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_4e26a8fbe732d7be4f3d576b98186360}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout06@{sout06}}
\index{sout06@{sout06}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout06]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_4e26a8fbe732d7be4f3d576b98186360}{sout06}}}
\label{return__mex__arguments_8cpp_4e26a8fbe732d7be4f3d576b98186360}




Definition at line 35 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_e6ab53ac05f43a798e08af450f27849b}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout07@{sout07}}
\index{sout07@{sout07}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout07]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_e6ab53ac05f43a798e08af450f27849b}{sout07}}}
\label{return__mex__arguments_8cpp_e6ab53ac05f43a798e08af450f27849b}




Definition at line 36 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_eb107442d4c3090afaaba1ff3bacd159}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout08@{sout08}}
\index{sout08@{sout08}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout08]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_eb107442d4c3090afaaba1ff3bacd159}{sout08}}}
\label{return__mex__arguments_8cpp_eb107442d4c3090afaaba1ff3bacd159}




Definition at line 37 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_f78590b7af9d94ec8eeb11c107f455ae}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout09@{sout09}}
\index{sout09@{sout09}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout09]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_f78590b7af9d94ec8eeb11c107f455ae}{sout09}}}
\label{return__mex__arguments_8cpp_f78590b7af9d94ec8eeb11c107f455ae}




Definition at line 38 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_2b5129a680ece4f402eb0bbdb6d15835}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout10@{sout10}}
\index{sout10@{sout10}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout10]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_2b5129a680ece4f402eb0bbdb6d15835}{sout10}}}
\label{return__mex__arguments_8cpp_2b5129a680ece4f402eb0bbdb6d15835}




Definition at line 39 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_07efe09485243d1474b01a74eb5702cf}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!sout11@{sout11}}
\index{sout11@{sout11}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[sout11]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_07efe09485243d1474b01a74eb5702cf}{sout11}}}
\label{return__mex__arguments_8cpp_07efe09485243d1474b01a74eb5702cf}




Definition at line 40 of file return\_\-mex\_\-arguments.cpp.

Referenced by return\_\-args(), and store\_\-state().\hypertarget{return__mex__arguments_8cpp_bed414d237d66a8c197d1ef2db27a01a}{
\index{return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}!timev@{timev}}
\index{timev@{timev}!return_mex_arguments.cpp@{return\_\-mex\_\-arguments.cpp}}
\subsubsection[timev]{\setlength{\rightskip}{0pt plus 5cm}vector$<$double$>$ \hyperlink{return__mex__arguments_8cpp_bed414d237d66a8c197d1ef2db27a01a}{timev}}}
\label{return__mex__arguments_8cpp_bed414d237d66a8c197d1ef2db27a01a}




Definition at line 41 of file return\_\-mex\_\-arguments.cpp.

Referenced by store\_\-state().