\section{lib/neatogen/stress.c File Reference}
\label{stress_8c}\index{lib/neatogen/stress.\-c@{lib/neatogen/stress.\-c}}
{\ttfamily \#include \char`\"{}neato.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}dijkstra.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}bfs.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}pca.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}matrix\-\_\-ops.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}conjgrad.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}embed\-\_\-graph.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}kkutils.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}stress.\-h\char`\"{}}\\*
{\ttfamily \#include $<$math.\-h$>$}\\*
{\ttfamily \#include $<$stdlib.\-h$>$}\\*
{\ttfamily \#include $<$time.\-h$>$}\\*
Include dependency graph for stress.\-c\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{stress_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf dist\-\_\-data}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bf Dij2}
\item 
\#define {\bf smooth\-\_\-pivots}~true
\item 
\#define {\bf stress\-\_\-pca\-\_\-dim}~50
\item 
\#define {\bf max}(x, y)~((x)$>$(y)?(x)\-:(y))
\item 
\#define {\bf Deg\-Type}~long double
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
double {\bf drand48} (void)
\item 
{\bf int} {\bf init\-Layout} ({\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n, {\bf int} dim, double $\ast$$\ast$coords, {\bf node\-\_\-t} $\ast$$\ast$nodes)
\item 
float $\ast$ {\bf circuit\-Model} ({\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n\-G)
\item 
float $\ast$ {\bf mds\-Model} ({\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n\-G)
\item 
float $\ast$ {\bf compute\-\_\-apsp\-\_\-packed} ({\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n)
\item 
float $\ast$ {\bf compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed} ({\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n)
\item 
{\bf int} {\bf stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel} ({\bf vtx\-\_\-data} $\ast${\bf graph}, {\bf int} n, {\bf int} nedges\-\_\-graph, double $\ast$$\ast$d\-\_\-coords, {\bf node\-\_\-t} $\ast$$\ast$nodes, {\bf int} dim, {\bf int} opts, {\bf int} model, {\bf int} maxi)
\end{DoxyCompactItemize}


\subsection{Macro Definition Documentation}
\index{stress.\-c@{stress.\-c}!Deg\-Type@{Deg\-Type}}
\index{Deg\-Type@{Deg\-Type}!stress.c@{stress.\-c}}
\subsubsection[{Deg\-Type}]{\setlength{\rightskip}{0pt plus 5cm}\#define Deg\-Type~long double}\label{stress_8c_a57f758ec56d25d9f82141eb0f64b5f04}


Definition at line 884 of file stress.\-c.



Referenced by stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel().

\index{stress.\-c@{stress.\-c}!Dij2@{Dij2}}
\index{Dij2@{Dij2}!stress.c@{stress.\-c}}
\subsubsection[{Dij2}]{\setlength{\rightskip}{0pt plus 5cm}\#define Dij2}\label{stress_8c_a6b82deaec422fb5847202389cd514993}
{\bfseries Value\-:}
\begin{DoxyCode}
\textcolor{comment}{/* If defined, the terms in the stress energy are normalized }
\textcolor{comment}{                                   by d\_\{ij\}^\{-2\} otherwise, they are normalized by d\_\{ij\}^\{-1\}}
\textcolor{comment}{                                 */}
\end{DoxyCode}


Definition at line 33 of file stress.\-c.

\index{stress.\-c@{stress.\-c}!max@{max}}
\index{max@{max}!stress.c@{stress.\-c}}
\subsubsection[{max}]{\setlength{\rightskip}{0pt plus 5cm}\#define max(
\begin{DoxyParamCaption}
\item[{}]{x, }
\item[{}]{y}
\end{DoxyParamCaption}
)~((x)$>$(y)?(x)\-:(y))}\label{stress_8c_ac39d9cef6a5e030ba8d9e11121054268}


Definition at line 794 of file stress.\-c.



Referenced by choose\-\_\-node(), compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed(), get\-\_\-gradient\-\_\-points(), power\-\_\-law\-\_\-graph(), scale\-\_\-to\-\_\-box(), Sparse\-Matrix\-\_\-normalize\-\_\-by\-\_\-row(), and stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel().

\index{stress.\-c@{stress.\-c}!smooth\-\_\-pivots@{smooth\-\_\-pivots}}
\index{smooth\-\_\-pivots@{smooth\-\_\-pivots}!stress.c@{stress.\-c}}
\subsubsection[{smooth\-\_\-pivots}]{\setlength{\rightskip}{0pt plus 5cm}\#define smooth\-\_\-pivots~true}\label{stress_8c_a6ad09659899788db7a50e5ef5a5b19a4}


Definition at line 46 of file stress.\-c.

\index{stress.\-c@{stress.\-c}!stress\-\_\-pca\-\_\-dim@{stress\-\_\-pca\-\_\-dim}}
\index{stress\-\_\-pca\-\_\-dim@{stress\-\_\-pca\-\_\-dim}!stress.c@{stress.\-c}}
\subsubsection[{stress\-\_\-pca\-\_\-dim}]{\setlength{\rightskip}{0pt plus 5cm}\#define stress\-\_\-pca\-\_\-dim~50}\label{stress_8c_af1434ee9ead6d7a98bb4f4f17379d1b7}


Definition at line 51 of file stress.\-c.



\subsection{Function Documentation}
\index{stress.\-c@{stress.\-c}!circuit\-Model@{circuit\-Model}}
\index{circuit\-Model@{circuit\-Model}!stress.c@{stress.\-c}}
\subsubsection[{circuit\-Model}]{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ circuit\-Model (
\begin{DoxyParamCaption}
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n\-G}
\end{DoxyParamCaption}
)}\label{stress_8c_abb86a31f016d74557f2565a96bd1b523}


Definition at line 199 of file stress.\-c.



References vtx\-\_\-data\-::edges, vtx\-\_\-data\-::ewgts, free\-\_\-array(), N\-\_\-\-N\-E\-W, vtx\-\_\-data\-::nedges, new\-\_\-array(), N\-U\-L\-L, and solve\-Circuit().



Referenced by stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel().

\index{stress.\-c@{stress.\-c}!compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed@{compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed}}
\index{compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed@{compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed}!stress.c@{stress.\-c}}
\subsubsection[{compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed}]{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed (
\begin{DoxyParamCaption}
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n}
\end{DoxyParamCaption}
)}\label{stress_8c_a38dd145ef64ea5f6a55de84d2c6aafab}


Definition at line 796 of file stress.\-c.



References common\-\_\-neighbors(), compute\-\_\-apsp\-\_\-packed(), vtx\-\_\-data\-::edges, empty\-\_\-neighbors\-\_\-vec(), vtx\-\_\-data\-::ewgts, fill\-\_\-neighbors\-\_\-vec\-\_\-unweighted(), max, N\-\_\-\-N\-E\-W, vtx\-\_\-data\-::nedges, and N\-U\-L\-L.



Referenced by stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel().

\index{stress.\-c@{stress.\-c}!compute\-\_\-apsp\-\_\-packed@{compute\-\_\-apsp\-\_\-packed}}
\index{compute\-\_\-apsp\-\_\-packed@{compute\-\_\-apsp\-\_\-packed}!stress.c@{stress.\-c}}
\subsubsection[{compute\-\_\-apsp\-\_\-packed}]{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ compute\-\_\-apsp\-\_\-packed (
\begin{DoxyParamCaption}
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n}
\end{DoxyParamCaption}
)}\label{stress_8c_a3ba1beee8d14c113fd971d1e0babcc44}


Definition at line 772 of file stress.\-c.



References bfs(), free\-Queue(), mk\-Queue(), and N\-\_\-\-N\-E\-W.



Referenced by compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed(), and stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel().

\index{stress.\-c@{stress.\-c}!drand48@{drand48}}
\index{drand48@{drand48}!stress.c@{stress.\-c}}
\subsubsection[{drand48}]{\setlength{\rightskip}{0pt plus 5cm}double drand48 (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{stress_8c_af9329f9acef07ca14ea2256191c3ce74}


Definition at line 2005 of file utils.\-c.



Referenced by init\-Layout(), jitter\-\_\-d(), make\-Obstacle(), move\-\_\-node(), randompos(), and stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel().

\index{stress.\-c@{stress.\-c}!init\-Layout@{init\-Layout}}
\index{init\-Layout@{init\-Layout}!stress.c@{stress.\-c}}
\subsubsection[{init\-Layout}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} init\-Layout (
\begin{DoxyParamCaption}
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n, }
\item[{{\bf int}}]{dim, }
\item[{double $\ast$$\ast$}]{coords, }
\item[{{\bf node\-\_\-t} $\ast$$\ast$}]{nodes}
\end{DoxyParamCaption}
)}\label{stress_8c_acf99bfcd1afddf89d3ec77ca282ff41f}


Definition at line 159 of file stress.\-c.



References drand48(), has\-Pos, is\-Fixed, N\-D\-\_\-pos, and orthog1().



Referenced by circle\-Layout(), and stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel().

\index{stress.\-c@{stress.\-c}!mds\-Model@{mds\-Model}}
\index{mds\-Model@{mds\-Model}!stress.c@{stress.\-c}}
\subsubsection[{mds\-Model}]{\setlength{\rightskip}{0pt plus 5cm}float$\ast$ mds\-Model (
\begin{DoxyParamCaption}
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n\-G}
\end{DoxyParamCaption}
)}\label{stress_8c_a80253b774992589c41c6e3f97ab162bd}


Definition at line 739 of file stress.\-c.



References vtx\-\_\-data\-::edges, vtx\-\_\-data\-::ewgts, vtx\-\_\-data\-::nedges, N\-U\-L\-L, and Verbose.



Referenced by stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel().

\index{stress.\-c@{stress.\-c}!stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel@{stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel}}
\index{stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel@{stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel}!stress.c@{stress.\-c}}
\subsubsection[{stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} stress\-\_\-majorization\-\_\-k\-D\-\_\-mkernel (
\begin{DoxyParamCaption}
\item[{{\bf vtx\-\_\-data} $\ast$}]{graph, }
\item[{{\bf int}}]{n, }
\item[{{\bf int}}]{nedges\-\_\-graph, }
\item[{double $\ast$$\ast$}]{d\-\_\-coords, }
\item[{{\bf node\-\_\-t} $\ast$$\ast$}]{nodes, }
\item[{{\bf int}}]{dim, }
\item[{{\bf int}}]{opts, }
\item[{{\bf int}}]{model, }
\item[{{\bf int}}]{maxi}
\end{DoxyParamCaption}
)}\label{stress_8c_ab2f979b73159a64511e78f0ff3ac16a4}


Definition at line 889 of file stress.\-c.



References A\-B\-S, agerr(), A\-G\-P\-R\-E\-V, A\-G\-W\-A\-R\-N, circuit\-Model(), compute\-\_\-apsp\-\_\-artifical\-\_\-weights\-\_\-packed(), compute\-\_\-apsp\-\_\-packed(), conjugate\-\_\-gradient\-\_\-mkernel(), copy\-\_\-vectorf(), Deg\-Type, drand48(), elapsed\-\_\-sec(), Epsilon, vtx\-\_\-data\-::ewgts, F\-A\-L\-S\-E, init\-Layout(), invert\-\_\-sqrt\-\_\-vec(), invert\-\_\-vec(), is\-Fixed, max, M\-A\-X\-D\-O\-U\-B\-L\-E, M\-A\-X\-F\-L\-O\-A\-T, mds\-Model(), M\-O\-D\-E\-L\-\_\-\-C\-I\-R\-C\-U\-I\-T, M\-O\-D\-E\-L\-\_\-\-M\-D\-S, M\-O\-D\-E\-L\-\_\-\-S\-U\-B\-S\-E\-T, N\-\_\-\-N\-E\-W, neighborhood\-\_\-radius\-\_\-subspace, N\-U\-L\-L, num\-\_\-pivots\-\_\-stress, opt\-\_\-exp\-\_\-flag, opt\-\_\-smart\-\_\-init, orthog1(), right\-\_\-mult\-\_\-with\-\_\-vector\-\_\-ff(), set\-\_\-vector\-\_\-valf(), sqrt\-\_\-vec(), sqrt\-\_\-vecf(), square\-\_\-vec(), start\-\_\-timer(), tolerance\-\_\-cg, vectors\-\_\-additionf(), vectors\-\_\-inner\-\_\-productf(), vectors\-\_\-mult\-\_\-additionf(), and Verbose.

