\hypertarget{matrixArrayCalcs_8cpp}{\section{matrix\-Array\-Calcs.\-cpp File Reference}
\label{matrixArrayCalcs_8cpp}\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}}
}
{\ttfamily \#include \char`\"{}matrix\-Array\-Calcs.\-h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{matrixArrayCalcs_8cpp_a8574a23272c4ff2f4619aa7f5ecd582f}{min\-Val} (const int $\ast$values, const int num\-Values)
\item 
int \hyperlink{matrixArrayCalcs_8cpp_a398283d9d4503959638b98170fbb371d}{max\-Val} (const int $\ast$values, const int num\-Values)
\item 
Matrix \hyperlink{matrixArrayCalcs_8cpp_ae03a1ac8b31ccbc99fafdcab5c9456f1}{conv2} (const Matrix \&A, const Matrix \&H)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_ad4b82b260bf9214941923697373e8ef6}{interp2} (double $\ast$xpts, double $\ast$ypts, const Matrix Z, double $\ast$xi, double $\ast$yi, double $\ast$zi, int num\-Pts)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_a079805b2e947b76cc45193b5dd5912eb}{interp2mat} (double $\ast$xpts, double $\ast$ypts, const Matrix Z, double $\ast$xi, double $\ast$yi, Matrix \&zi)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_a00e8a566ce6dc2f965abd44fa60ea1ff}{nearest\-Interp} (double $\ast$xpts, double $\ast$ypts, const Matrix \&zvals, double xi, double yi, double \&zi, int $\ast$x\-Indices, int $\ast$y\-Indices, Column\-Vector \&Weights)
\item 
bool \hyperlink{matrixArrayCalcs_8cpp_a0ab17298e31e8f2bd7d0afdf6dae026d}{find\-Nearest\-Valid} (const Matrix \&zvals, int \&x\-Index, int \&y\-Index)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_a93519b5f002077f800b29c4364d97a22}{bilinear\-Interp} (double $\ast$xpts, double $\ast$ypts, const Matrix \&zvals, double xi, double yi, double \&zi, int $\ast$x\-Indices, int $\ast$y\-Indices, Column\-Vector \&Weights)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_a10df3430b4f63339c501bc163da20ba0}{bicubic\-Interp} (double $\ast$xpts, double $\ast$ypts, const Matrix \&zvals, double xi, double yi, double \&zi, int $\ast$x\-Indices, int $\ast$y\-Indices, Column\-Vector \&Weights)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_a9314989341219da17fe3d49b13bbe6af}{spline\-Interp} (double $\ast$xpts, double $\ast$ypts, const Matrix \&zvals, double xi, double yi, double \&zi, int $\ast$x\-Indices, int $\ast$y\-Indices, Column\-Vector \&Weights)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_a97cd453dffc0b8c2c20878662f0f13f8}{nearest\-Interp\-\_\-mat} (double $\ast$xpts, double $\ast$ypts, const Matrix \&zvals, double $\ast$xi, double $\ast$yi, Matrix \&zi, Matrix \&var)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_ab94d2c887fa02b160734b5d772ba8a29}{bilinear\-Interp\-\_\-mat} (double $\ast$xpts, double $\ast$ypts, const Matrix \&zvals, double $\ast$xi, double $\ast$yi, Matrix \&zi, Matrix \&var)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_acd46a4cb72130c0a787036f930d64926}{bicubic\-Interp\-\_\-mat} (double $\ast$xpts, double $\ast$ypts, const Matrix \&zvals, double $\ast$xi, double $\ast$yi, Matrix \&zi, Matrix \&var)
\item 
void \hyperlink{matrixArrayCalcs_8cpp_ab14df0425ee1096bd119de1bd7bcdd82}{spline\-Interp\-\_\-mat} (double $\ast$xpts, double $\ast$ypts, const Matrix \&zvals, double $\ast$xi, double $\ast$yi, Matrix \&zi, Matrix \&var)
\item 
int \hyperlink{matrixArrayCalcs_8cpp_a54acc9e2e8c3d0cb9a9927928a5a6e26}{closest\-Pt} (double key, const double $\ast$base, size\-\_\-t nmemb)
\item 
int \hyperlink{matrixArrayCalcs_8cpp_a41c1ad23610100bab0a5df6ebe695a61}{lower\-Bound} (double val, const double $\ast$vec, int num\-Vals)
\item 
double \hyperlink{matrixArrayCalcs_8cpp_a8aa203e5ca4b0f35a929b1f7505ded4d}{randn} (double mean, double stddev)
\item 
char $\ast$ \hyperlink{matrixArrayCalcs_8cpp_a3fe6dafb2bfc452e6ea3c53cf339e1f4}{char\-Cat} (char $\ast$dest, const char $\ast$front, const char $\ast$back)
\item 
double \hyperlink{matrixArrayCalcs_8cpp_a28973f8157ce3c558bce24300c267c8b}{compute\-K\-Ldiv\-\_\-gaussian\-\_\-mat} (double $\ast$xpts, double $\ast$ypts, const Matrix \&ref\-P\-D\-F, double $\ast$mu, const Matrix \&Cov)
\item 
Symmetric\-Matrix \hyperlink{matrixArrayCalcs_8cpp_a93aa722740ea7234a661a9deb5580cca}{compute\-Matrix\-Sqrt} (const Symmetric\-Matrix \&A)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{matrixArrayCalcs_8cpp_a10df3430b4f63339c501bc163da20ba0}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!bicubic\-Interp@{bicubic\-Interp}}
\index{bicubic\-Interp@{bicubic\-Interp}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{bicubic\-Interp}]{\setlength{\rightskip}{0pt plus 5cm}void bicubic\-Interp (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{zvals, }
\item[{double}]{xi, }
\item[{double}]{yi, }
\item[{double \&}]{zi, }
\item[{int $\ast$}]{x\-Indices, }
\item[{int $\ast$}]{y\-Indices, }
\item[{Column\-Vector \&}]{Weights}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a10df3430b4f63339c501bc163da20ba0}
Uses bicubic interpolation to determine zi at the point (xi,yi) from the set of data xpts, ypts, and zvals. If zvals is size m x n, xpts is size m x 1 and ypts is size n x 1. The function modifies the the entries in x\-Indices, y\-Indices and W. x\-Indices and y\-Indices are px1 arrays containing the indices of xpts and ypts used to generate zi. The method used for bicubic interpolation is very similar to that described in Numerical Recipes in C++. If a 4x4 bounding box does not exist for the current (xi,yi) data point, O\-R the interpolated point is Na\-N, \hyperlink{matrixArrayCalcs_8h_a93519b5f002077f800b29c4364d97a22}{bilinear\-Interp()} is used. \hypertarget{matrixArrayCalcs_8cpp_acd46a4cb72130c0a787036f930d64926}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!bicubic\-Interp\-\_\-mat@{bicubic\-Interp\-\_\-mat}}
\index{bicubic\-Interp\-\_\-mat@{bicubic\-Interp\-\_\-mat}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{bicubic\-Interp\-\_\-mat}]{\setlength{\rightskip}{0pt plus 5cm}void bicubic\-Interp\-\_\-mat (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{zvals, }
\item[{double $\ast$}]{xi, }
\item[{double $\ast$}]{yi, }
\item[{Matrix \&}]{zi, }
\item[{Matrix \&}]{var}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_acd46a4cb72130c0a787036f930d64926}
Interpolates all points in the vectors xi, yi to fill the matrix zi using the data in xpts, ypts and Z. Calls \hyperlink{matrixArrayCalcs_8h_a10df3430b4f63339c501bc163da20ba0}{bicubic\-Interp()} for each point in the xi and yi arrays to perform this interpolation. \hypertarget{matrixArrayCalcs_8cpp_a93519b5f002077f800b29c4364d97a22}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!bilinear\-Interp@{bilinear\-Interp}}
\index{bilinear\-Interp@{bilinear\-Interp}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{bilinear\-Interp}]{\setlength{\rightskip}{0pt plus 5cm}void bilinear\-Interp (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{zvals, }
\item[{double}]{xi, }
\item[{double}]{yi, }
\item[{double \&}]{zi, }
\item[{int $\ast$}]{x\-Indices, }
\item[{int $\ast$}]{y\-Indices, }
\item[{Column\-Vector \&}]{Weights}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a93519b5f002077f800b29c4364d97a22}
Uses bilinear interpolation to determine zi at the point (xi,yi) from the set of data xpts, ypts, and zvals. If zvals is size m x n, xpts is size m x 1 and ypts is size n x 1. The function modifies the the entries in x\-Indices, y\-Indices and W. x\-Indices and y\-Indices are 4x1 arrays containing the indices of xpts and ypts used to generate zi. W is a 4x1 column vector of corresponding weights where\-: zi = sum\-\_\-i W(i,1)$\ast$zvals(x\-Indices\mbox{[}i\mbox{]}+1,y\-Indices\mbox{[}i\mbox{]}+1). If a 2x2 bounding box does not exist for the current (xi,yi) data point (i.\-e., it is out of the bounds of Z), O\-R the interpolated point is Na\-N, \hyperlink{matrixArrayCalcs_8h_a00e8a566ce6dc2f965abd44fa60ea1ff}{nearest\-Interp()} is used. \hypertarget{matrixArrayCalcs_8cpp_ab94d2c887fa02b160734b5d772ba8a29}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!bilinear\-Interp\-\_\-mat@{bilinear\-Interp\-\_\-mat}}
\index{bilinear\-Interp\-\_\-mat@{bilinear\-Interp\-\_\-mat}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{bilinear\-Interp\-\_\-mat}]{\setlength{\rightskip}{0pt plus 5cm}void bilinear\-Interp\-\_\-mat (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{zvals, }
\item[{double $\ast$}]{xi, }
\item[{double $\ast$}]{yi, }
\item[{Matrix \&}]{zi, }
\item[{Matrix \&}]{var}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_ab94d2c887fa02b160734b5d772ba8a29}
Interpolates all points in the vectors xi, yi to fill the matrix zi using the data in xpts, ypts and Z. Calls \hyperlink{matrixArrayCalcs_8h_a93519b5f002077f800b29c4364d97a22}{bilinear\-Interp()} for each point in the xi and yi arrays to perform this interpolation. \hypertarget{matrixArrayCalcs_8cpp_a3fe6dafb2bfc452e6ea3c53cf339e1f4}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!char\-Cat@{char\-Cat}}
\index{char\-Cat@{char\-Cat}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{char\-Cat}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ char\-Cat (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{dest, }
\item[{const char $\ast$}]{front, }
\item[{const char $\ast$}]{back}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a3fe6dafb2bfc452e6ea3c53cf339e1f4}
This function is used to concatenate two character arrays (front and back) into a new character array, dest. This differs from the C standard function strcat() in that the returned character array is an entirely new location in memory, separate from the front and back arrays. The length of the dest char array must be greater than or equal to the sum of the lengths of the front and back arrays. \hypertarget{matrixArrayCalcs_8cpp_a54acc9e2e8c3d0cb9a9927928a5a6e26}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!closest\-Pt@{closest\-Pt}}
\index{closest\-Pt@{closest\-Pt}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{closest\-Pt}]{\setlength{\rightskip}{0pt plus 5cm}int closest\-Pt (
\begin{DoxyParamCaption}
\item[{double}]{key, }
\item[{const double $\ast$}]{base, }
\item[{size\-\_\-t}]{nmemb}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a54acc9e2e8c3d0cb9a9927928a5a6e26}
Finds the index into the array \char`\"{}pts\char`\"{} which is closest to \char`\"{}value\char`\"{}. This function is copied from the function \hyperlink{mapio_8cpp_aaacac2d74bfa7f23515981dc04287568}{nearest()} in \hyperlink{mapio_8cpp}{mapio.\-cpp}. \hypertarget{matrixArrayCalcs_8cpp_a28973f8157ce3c558bce24300c267c8b}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!compute\-K\-Ldiv\-\_\-gaussian\-\_\-mat@{compute\-K\-Ldiv\-\_\-gaussian\-\_\-mat}}
\index{compute\-K\-Ldiv\-\_\-gaussian\-\_\-mat@{compute\-K\-Ldiv\-\_\-gaussian\-\_\-mat}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{compute\-K\-Ldiv\-\_\-gaussian\-\_\-mat}]{\setlength{\rightskip}{0pt plus 5cm}double compute\-K\-Ldiv\-\_\-gaussian\-\_\-mat (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{ref\-P\-D\-F, }
\item[{double $\ast$}]{mu, }
\item[{const Matrix \&}]{Cov}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a28973f8157ce3c558bce24300c267c8b}
This function computes the K\-L divergence between a proposal distribution and a Gaussian distribution with mean vector mu and covariance C. The proposal distribution is described by the matrix P, with corresponding (x,y) values given in the vectors xpts and ypts. \hypertarget{matrixArrayCalcs_8cpp_a93aa722740ea7234a661a9deb5580cca}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!compute\-Matrix\-Sqrt@{compute\-Matrix\-Sqrt}}
\index{compute\-Matrix\-Sqrt@{compute\-Matrix\-Sqrt}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{compute\-Matrix\-Sqrt}]{\setlength{\rightskip}{0pt plus 5cm}Symmetric\-Matrix compute\-Matrix\-Sqrt (
\begin{DoxyParamCaption}
\item[{const Symmetric\-Matrix \&}]{A}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a93aa722740ea7234a661a9deb5580cca}
This function computes the matrix square root of the given matrix, A. The given matrix and the returned matrix are both symmetric matrices. The sqrt is computed by first performing the eigenvalue decomposition of the matrix A, square rooting the resulting eigenvalues, and reconstructing the matrix to get Asqrt. \hypertarget{matrixArrayCalcs_8cpp_ae03a1ac8b31ccbc99fafdcab5c9456f1}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!conv2@{conv2}}
\index{conv2@{conv2}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{conv2}]{\setlength{\rightskip}{0pt plus 5cm}Matrix conv2 (
\begin{DoxyParamCaption}
\item[{const Matrix \&}]{A, }
\item[{const Matrix \&}]{H}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_ae03a1ac8b31ccbc99fafdcab5c9456f1}
Computes the 2\-D convolution of A with filter matrix H. The returned matrix B is the same size as A. H is assumed to be smaller than A. \hypertarget{matrixArrayCalcs_8cpp_a0ab17298e31e8f2bd7d0afdf6dae026d}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!find\-Nearest\-Valid@{find\-Nearest\-Valid}}
\index{find\-Nearest\-Valid@{find\-Nearest\-Valid}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{find\-Nearest\-Valid}]{\setlength{\rightskip}{0pt plus 5cm}bool find\-Nearest\-Valid (
\begin{DoxyParamCaption}
\item[{const Matrix \&}]{zvals, }
\item[{int \&}]{x\-Index, }
\item[{int \&}]{y\-Index}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a0ab17298e31e8f2bd7d0afdf6dae026d}
Finds the nearest valid (non-\/\-Na\-N) point in the grid zvals to the point (x\-Index, y\-Index). Replaces x\-Index and y\-Index with the indices corresponding to this found location. Returns a boolean indicating if a non-\/\-Na\-N point was successfully found. \hypertarget{matrixArrayCalcs_8cpp_ad4b82b260bf9214941923697373e8ef6}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!interp2@{interp2}}
\index{interp2@{interp2}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{interp2}]{\setlength{\rightskip}{0pt plus 5cm}void interp2 (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix}]{Z, }
\item[{double $\ast$}]{xi, }
\item[{double $\ast$}]{yi, }
\item[{double $\ast$}]{zi, }
\item[{int}]{num\-Pts}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_ad4b82b260bf9214941923697373e8ef6}
Interpolates the matrix Z to the (x,y) point pairs in arrays xi and yi. N indicates the number of point pairs to be interpolated. The arrays xpts and ypts contain the (x,y) values corresponding to entries in matrix Z. If Z is size m x n, xpts is size m x 1 and ypts is size n x 1. Bilinear interpolation is used for this function. \hypertarget{matrixArrayCalcs_8cpp_a079805b2e947b76cc45193b5dd5912eb}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!interp2mat@{interp2mat}}
\index{interp2mat@{interp2mat}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{interp2mat}]{\setlength{\rightskip}{0pt plus 5cm}void interp2mat (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix}]{Z, }
\item[{double $\ast$}]{xi, }
\item[{double $\ast$}]{yi, }
\item[{Matrix \&}]{zi}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a079805b2e947b76cc45193b5dd5912eb}
Interpolates the matrix Z to a new matrix zi over the (x,y) points in the arrays xi and yi. Nx and Ny indicates the length of these arrays. The arrays xpts and ypts contain the (x,y) values corresponding to entries in matrix Z. If Z is size m x n, xpts is size m x 1 and ypts is size n x 1. This function calls \hyperlink{matrixArrayCalcs_8h_ad4b82b260bf9214941923697373e8ef6}{interp2()} for performing interpolations. \hypertarget{matrixArrayCalcs_8cpp_a41c1ad23610100bab0a5df6ebe695a61}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!lower\-Bound@{lower\-Bound}}
\index{lower\-Bound@{lower\-Bound}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{lower\-Bound}]{\setlength{\rightskip}{0pt plus 5cm}int lower\-Bound (
\begin{DoxyParamCaption}
\item[{double}]{val, }
\item[{const double $\ast$}]{vec, }
\item[{int}]{num\-Vals}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a41c1ad23610100bab0a5df6ebe695a61}
Finds the lowest index into the array \char`\"{}vec\char`\"{} which bounds the value \char`\"{}val\char`\"{}. This function does N\-O\-T check that the returned index is a valid index into the array. \hypertarget{matrixArrayCalcs_8cpp_a398283d9d4503959638b98170fbb371d}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!max\-Val@{max\-Val}}
\index{max\-Val@{max\-Val}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{max\-Val}]{\setlength{\rightskip}{0pt plus 5cm}int max\-Val (
\begin{DoxyParamCaption}
\item[{const int $\ast$}]{values, }
\item[{const int}]{num\-Values}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a398283d9d4503959638b98170fbb371d}
Finds and returns the maximum number in the integer array values. \hypertarget{matrixArrayCalcs_8cpp_a8574a23272c4ff2f4619aa7f5ecd582f}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!min\-Val@{min\-Val}}
\index{min\-Val@{min\-Val}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{min\-Val}]{\setlength{\rightskip}{0pt plus 5cm}int min\-Val (
\begin{DoxyParamCaption}
\item[{const int $\ast$}]{values, }
\item[{const int}]{num\-Values}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a8574a23272c4ff2f4619aa7f5ecd582f}
Rounds the number given to the nearest integer and returns the integer.

Finds and returns the minimum number in the integer array values. \hypertarget{matrixArrayCalcs_8cpp_a00e8a566ce6dc2f965abd44fa60ea1ff}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!nearest\-Interp@{nearest\-Interp}}
\index{nearest\-Interp@{nearest\-Interp}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{nearest\-Interp}]{\setlength{\rightskip}{0pt plus 5cm}void nearest\-Interp (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{zvals, }
\item[{double}]{xi, }
\item[{double}]{yi, }
\item[{double \&}]{zi, }
\item[{int $\ast$}]{x\-Indices, }
\item[{int $\ast$}]{y\-Indices, }
\item[{Column\-Vector \&}]{Weights}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a00e8a566ce6dc2f965abd44fa60ea1ff}
Uses nearest-\/neighbor interpolation to determine zi at the point (xi,yi) from the set of data xpts, ypts, and zvals. If zvals is size m x n, xpts is size m x 1 and ypts is size n x 1. The function modifies the the entries in x\-Indices, y\-Indices and W. x\-Indices and y\-Indices are px1 arrays containing the indices of xpts and ypts used to generate zi. W is a px1 matrix of corresponding weights where\-: zi = sum\-\_\-i W(i,1)$\ast$zvals(x\-Indices\mbox{[}i\mbox{]}+1,y\-Indices\mbox{[}i\mbox{]}+1). If the nearest point is Na\-N, the closest non-\/\-Na\-N point is found. \hypertarget{matrixArrayCalcs_8cpp_a97cd453dffc0b8c2c20878662f0f13f8}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!nearest\-Interp\-\_\-mat@{nearest\-Interp\-\_\-mat}}
\index{nearest\-Interp\-\_\-mat@{nearest\-Interp\-\_\-mat}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{nearest\-Interp\-\_\-mat}]{\setlength{\rightskip}{0pt plus 5cm}void nearest\-Interp\-\_\-mat (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{zvals, }
\item[{double $\ast$}]{xi, }
\item[{double $\ast$}]{yi, }
\item[{Matrix \&}]{zi, }
\item[{Matrix \&}]{var}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a97cd453dffc0b8c2c20878662f0f13f8}
Interpolates all points in the vectors xi, yi to fill the matrix zi using the data in xpts, ypts and Z. Calls \hyperlink{matrixArrayCalcs_8h_a00e8a566ce6dc2f965abd44fa60ea1ff}{nearest\-Interp()} for each point in the xi and yi arrays to perform this interpolation. \hypertarget{matrixArrayCalcs_8cpp_a8aa203e5ca4b0f35a929b1f7505ded4d}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!randn@{randn}}
\index{randn@{randn}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{randn}]{\setlength{\rightskip}{0pt plus 5cm}double randn (
\begin{DoxyParamCaption}
\item[{double}]{mean, }
\item[{double}]{stddev}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a8aa203e5ca4b0f35a929b1f7505ded4d}
Uses a polar form Box-\/\-Muller Transform to generate a pseudorandom number from a gaussian distribution with specificied mean and standard deviation. Generates two random numbers for each call and stores the unused number for the next call to this function. \hypertarget{matrixArrayCalcs_8cpp_a9314989341219da17fe3d49b13bbe6af}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!spline\-Interp@{spline\-Interp}}
\index{spline\-Interp@{spline\-Interp}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{spline\-Interp}]{\setlength{\rightskip}{0pt plus 5cm}void spline\-Interp (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{zvals, }
\item[{double}]{xi, }
\item[{double}]{yi, }
\item[{double \&}]{zi, }
\item[{int $\ast$}]{x\-Indices, }
\item[{int $\ast$}]{y\-Indices, }
\item[{Column\-Vector \&}]{Weights}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_a9314989341219da17fe3d49b13bbe6af}
Uses spline interpolation to determine zi at the point (xi,yi) from the set of data xpts, ypts, and zvals. If zvals is size m x n, xvals is size m x 1 and ypts is size n x 1. The function modifies the the entries in x\-Indices, y\-Indices and W. x\-Indices and y\-Indices are px1 arrays containing the indices of xpts and ypts used to generate zi. Currently, this function is only implemented if a Matlab engine is running. Otherwise, this function calls \hyperlink{matrixArrayCalcs_8h_a00e8a566ce6dc2f965abd44fa60ea1ff}{nearest\-Interp()}. \hypertarget{matrixArrayCalcs_8cpp_ab14df0425ee1096bd119de1bd7bcdd82}{\index{matrix\-Array\-Calcs.\-cpp@{matrix\-Array\-Calcs.\-cpp}!spline\-Interp\-\_\-mat@{spline\-Interp\-\_\-mat}}
\index{spline\-Interp\-\_\-mat@{spline\-Interp\-\_\-mat}!matrixArrayCalcs.cpp@{matrix\-Array\-Calcs.\-cpp}}
\subsubsection[{spline\-Interp\-\_\-mat}]{\setlength{\rightskip}{0pt plus 5cm}void spline\-Interp\-\_\-mat (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{xpts, }
\item[{double $\ast$}]{ypts, }
\item[{const Matrix \&}]{zvals, }
\item[{double $\ast$}]{xi, }
\item[{double $\ast$}]{yi, }
\item[{Matrix \&}]{zi, }
\item[{Matrix \&}]{var}
\end{DoxyParamCaption}
)}}\label{matrixArrayCalcs_8cpp_ab14df0425ee1096bd119de1bd7bcdd82}
Interpolates all points in the vectors xi, yi to fill the matrix zi using the data in xpts, ypts and Z. Currently, this function is only implemented if a Matlab engine is running. Otherwise, this function calls \hyperlink{matrixArrayCalcs_8h_a97cd453dffc0b8c2c20878662f0f13f8}{nearest\-Interp\-\_\-mat()}. 