\subsection{Integration}
This section decribes all the functions in the file ``ptwXY\_integration.c''.

\subsubsection{ptwXY\_f\_integrate}
This function returns the integral between two points using \highlight{interpolation}.
\setargumentNameLengths{interpolation}
\CallingC{nfu\_status ptwXY\_f\_integrate(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY,}
    \addArgument{ptwXY\_interpolation interpolation,}
    \addArgument{double x1,}
    \addArgument{double y1,}
    \addArgument{double x2,}
    \addArgument{double y2,}
    \addArgument{double *value );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to a \highlight{ptwXYPoints} object.}
    \argumentBox{interpolation}{The interpolation between the two points.}
    \argumentBox{x2}{The x-value of the lower point.}
    \argumentBox{y2}{The y-value of the lower point}
    \argumentBox{x2}{The x-value of the upper point.}
    \argumentBox{y2}{The y-value of the upper point}
    \argumentBox{value}{On return, the value of the integral.}
    \vskip 0.05 in \noindent

\subsubsection{ptwXY\_integrate}
This function returns the integral of \highlight{ptwXY} from \highlight{domainMin} to \highlight{domainMax}.
\setargumentNameLengths{domainMax}
\CallingC{nfu\_status ptwXY\_integrate(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY,}
    \addArgument{double domainMin,}
    \addArgument{double domainMax,}
    \addArgument{double *integral);}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{domainMin}{The lower limit of integration.}
    \argumentBox{domainMax}{The upperlimit of integration.}
    \argumentBox{integral}{On return, the value of the integral.}
    \vskip 0.05 in \noindent
The return value is $\int_{\rm domainMin}^{\rm domainMax} f(x) dx$.

\subsubsection{ptwXY\_integrateDomain}
This function returns the integral of \highlight{ptwXY} over its domain.
\setargumentNameLengths{integral}
\CallingC{nfu\_status ptwXY\_integrateDomain(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY,}
    \addArgument{double *value );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{integral}{On return, the value of the integral.}
    \vskip 0.05 in \noindent
The return value is $\int f(x) dx$ over the domain of \highlight{ptwXY}.

\subsubsection{ptwXY\_normalize}
This function multiplies each y-value of \highlight{ptwXY} by a constant so that its integral is then normalized to 1.
\setargumentNameLengths{ptwXY}
\CallingC{nfu\_status ptwXY\_normalize(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to the \highlight{ptwXYPoints} object.}
    \vskip 0.05 in \noindent

\subsubsection{ptwXY\_integrateDomainWithWeight\_x}
This function returns the integral of \highlight{ptwXY} weighted by x over its domain.
\setargumentNameLengths{integral}
\CallingC{nfu\_status ptwXY\_integrateDomainWithWeight\_x(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY,}
    \addArgument{double *integral );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{integral}{On return, the value of the integral.}
    \vskip 0.05 in \noindent
The return value is $\int x f(x) dx$ over the domain of \highlight{ptwXY}.

\subsubsection{ptwXY\_integrateWithWeight\_x}
This function returns the integral of \highlight{ptwXY} weighted by x from domainMin to domainMax.
\setargumentNameLengths{domainMax}
\CallingC{nfu\_status ptwXY\_integrateWithWeight\_x(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY,}
    \addArgument{double domainMin,}
    \addArgument{double domainMax,}
    \addArgument{double *integral );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{domainMin}{The lower limit of the integration.}
    \argumentBox{domainMax}{The upper limit of the integration.}
    \argumentBox{integral}{On return, the value of the integral.}
    \vskip 0.05 in \noindent
The return value is $\int_{\rm domainMin}^{\rm domainMax} x f(x) dx$ over the domain of \highlight{ptwXY}.

\subsubsection{ptwXY\_integrateDomainWithWeight\_sqrt\_x}
This function returns the integral of \highlight{ptwXY} weighted by $\sqrt{ x }$ over its domain.
\setargumentNameLengths{integral}
\CallingC{nfu\_status ptwXY\_integrateDomainWithWeight\_sqrt\_x(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY,}
    \addArgument{double *integral );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{integral}{On return, the value of the integral.}
    \vskip 0.05 in \noindent
The return value is $\int \sqrt{ x } f(x) dx$ over the domain of \highlight{ptwXY}.

\subsubsection{ptwXY\_integrateWithWeight\_sqrt\_x}
This function returns the integral of \highlight{ptwXY} weighted by x from domainMin to domainMax.
\setargumentNameLengths{domainMin}
\CallingC{nfu\_status ptwXY\_integrateWithWeight\_sqrt\_x(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY,}
    \addArgument{double domainMin,}
    \addArgument{double domainMax,}
    \addArgument{double *integral );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{domainMin}{The lower limit of the integration.}
    \argumentBox{domainMax}{The upper limit of the integration.}
    \argumentBox{integral}{On return, the value of the integral.}
    \vskip 0.05 in \noindent
The return value is $\int_{\rm domainMin}^{\rm domainMax} \sqrt{ x } f(x) dx$ over the domain of \highlight{ptwXY}.

\subsubsection{ptwXY\_groupOneFunction}
This function integrates \highlight{ptwXY} between each pair of consecutive points in \highlight{groupBoundaries} and
returns each integral's value as an element of the returned \highlight{ptwXPoints}.
\setargumentNameLengths{groupBoundaries}
\CallingC{ptwXPoints *ptwXY\_groupOneFunction(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY,}
    \addArgument{ptwXPoints *groupBoundaries,}
    \addArgument{ptwXY\_group\_normType normType,}
    \addArgument{ptwXPoints *norm );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{groupBoundaries}{A list of x-values.}
    \argumentBox{normType}{The type of normalization to apply to integration.}
    \argumentBox{norm}{A list of normalizations to be applied when normType is \highlight{ptwXY\-\_group\-\_normType\-\_norm}.}
    \vskip 0.05 in \noindent
Let \highlight{groupBoundaries} contain $n$ x-values with $x_i < x_{i+1}$. The returned \highlight{ptwXPoints} will contain $n-1$
values $I_i$ such that
\begin{equation}
    I_i = { 1 \over n_i } \int_{x_i}^{x_{i+1}} f(x) dx
\end{equation}
where $n_i$ is determined by \highlight{normType} as,
\begin{description}
    \item[ptwXY\_group\_normType\_none:] $n_i = 1$.
    \item[ptwXY\_group\_normType\_dx:] $n_i = x_{i+1} - x_i$.
    \item[ptwXY\_group\_normType\_norm:] $n_i = $ the $(i-1)^{th}$ element of norm.
\end{description}

\subsubsection{ptwXY\_groupTwoFunctions}
This function integrates the product of \highlight{ptwXY1} and \highlight{ptwXY2} between each pair of consecutive points in \highlight{groupBoundaries} and
returns each integral's value as an element of the returned \highlight{ptwXPoints}.
\setargumentNameLengths{groupBoundaries}
\CallingC{ptwXPoints *ptwXY\_groupTwoFunctions(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY1,}
    \addArgument{ptwXYPoints *ptwXY2,}
    \addArgument{ptwXPoints *groupBoundaries,}
    \addArgument{ptwXY\_group\_normType normType,}
    \addArgument{ptwXPoints *norm );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY1}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{ptwXY2}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{groupBoundaries}{A list of x-values.}
    \argumentBox{normType}{The type of normalization to apply to integration.}
    \argumentBox{norm}{A list of normalizations to be applied when normType is \highlight{ptwXY\-\_group\-\_normType\-\_norm}.}
    \vskip 0.05 in \noindent
Let \highlight{groupBoundaries} contain $n$ x-values with $x_i < x_{i+1}$. The returned \highlight{ptwXPoints} will contain $n-1$
values $I_i$ such that
\begin{equation}
    I_i = { 1 \over n_i } \int_{x_i}^{x_{i+1}} f(x) \; g(x) dx
\end{equation}
where $n_i$ is determined by \highlight{normType} as,
\begin{description}
    \item[ptwXY\_group\_normType\_none:] $n_i = 1$.
    \item[ptwXY\_group\_normType\_dx:] $n_i = x_{i+1} - x_i$.
    \item[ptwXY\_group\_normType\_norm:] $n_i = $ the $(i-1)^{th}$ element of norm.
\end{description}

\subsubsection{ptwXY\_groupThreeFunctions}
This function integrates the product \highlight{ptwXY1}, \highlight{ptwXY2} and \highlight{ptwXY3} between each pair of 
consecutive points in \highlight{groupBoundaries} and
returns each integral's value as an element of the returned \highlight{ptwXPoints}.
\setargumentNameLengths{groupBoundaries}
\CallingC{ptwXPoints *ptwXY\_groupThreeFunctions(}{statusMessageReporting *smr,
    \addArgument{ptwXYPoints *ptwXY1,}
    \addArgument{ptwXYPoints *ptwXY2,}
    \addArgument{ptwXYPoints *ptwXY3,}
    \addArgument{ptwXPoints *groupBoundaries,}
    \addArgument{ptwXY\_group\_normType normType,}
    \addArgument{ptwXPoints *norm );}}
    \argumentBox{smr}{The \highlight{statusMessageReporting} instance to record errors.}
    \argumentBox{ptwXY1}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{ptwXY2}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{ptwXY3}{A pointer to the \highlight{ptwXYPoints} object.}
    \argumentBox{groupBoundaries}{A list of x-values.}
    \argumentBox{normType}{The type of normalization to apply to integration.}
    \argumentBox{norm}{A list of normalizations to be applied when normType is \highlight{ptwXY\-\_group\-\_normType\-\_norm}.}
    \vskip 0.05 in \noindent
Let \highlight{groupBoundaries} contain $n$ x-values with $x_i < x_{i+1}$. The returned \highlight{ptwXPoints} will contain $n-1$
values $I_i$ such that
\begin{equation}
    I_i = { 1 \over n_i } \int_{x_i}^{x_{i+1}} f(x) g(x) h(x) dx
\end{equation}
where $n_i$ is determined by \highlight{normType} as,
\begin{description}
    \item[ptwXY\_group\_normType\_none:] $n_i = 1$.
    \item[ptwXY\_group\_normType\_dx:] $n_i = x_{i+1} - x_i$.
    \item[ptwXY\_group\_normType\_norm:] $n_i = $ the $(i-1)^{th}$ element of norm.
\end{description}
