\hypertarget{return__mex__arguments_8h}{
\section{D:/Basile/Visual\-Cpp\-Projects/hydro\-MEX3/hydro\-MEX3/hydro\_\-source/return\_\-mex\_\-arguments.h File Reference}
\label{return__mex__arguments_8h}\index{D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/hydro_source/return_mex_arguments.h@{D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/hydro\_\-source/return\_\-mex\_\-arguments.h}}
}
{\tt \#include \char`\"{}math.h\char`\"{}}\par
{\tt \#include \char`\"{}mex.h\char`\"{}}\par
{\tt \#include \char`\"{}string.h\char`\"{}}\par


Include dependency graph for return\_\-mex\_\-arguments.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=280pt]{return__mex__arguments_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=420pt]{return__mex__arguments_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{return__mex__arguments_8h_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_8h_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{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_8h-source}{return\_\-mex\_\-arguments.h}.

\subsection{Function Documentation}
\hypertarget{return__mex__arguments_8h_5aded7adb5403b2287fd952357da3742}{
\index{return_mex_arguments.h@{return\_\-mex\_\-arguments.h}!return_args@{return\_\-args}}
\index{return_args@{return\_\-args}!return_mex_arguments.h@{return\_\-mex\_\-arguments.h}}
\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_8h_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_8h_d2368af67b5d678064df80edc11257b2}{
\index{return_mex_arguments.h@{return\_\-mex\_\-arguments.h}!store_state@{store\_\-state}}
\index{store_state@{store\_\-state}!return_mex_arguments.h@{return\_\-mex\_\-arguments.h}}
\subsubsection[store\_\-state]{\setlength{\rightskip}{0pt plus 5cm}void store\_\-state (double {\em time}, N\_\-Vector {\em state\_\-at\_\-t})}}
\label{return__mex__arguments_8h_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().