\hypertarget{carto__base__graph_8c}{\section{opal/mca/carto/base/carto\+\_\+base\+\_\+graph.c File Reference}
\label{carto__base__graph_8c}\index{opal/mca/carto/base/carto\+\_\+base\+\_\+graph.\+c@{opal/mca/carto/base/carto\+\_\+base\+\_\+graph.\+c}}
}


This file is an implementation of the carto graph base on the graph class.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+graph.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/mca/carto/carto.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/mca/carto/base/carto\+\_\+base\+\_\+graph.\+h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{carto__base__graph_8c_a49557ce49f661a9e76caba9cf19a7798}{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node} (void $\ast$node)
\begin{DoxyCompactList}\small\item\em A function to free node. \end{DoxyCompactList}\item 
static void \hyperlink{carto__base__graph_8c_a9ce03b81a87ca46e6910e3fb3e9da2d6}{opal\+\_\+carto\+\_\+base\+\_\+copy\+\_\+nodes} (void $\ast$$\ast$dst, void $\ast$src)
\begin{DoxyCompactList}\small\item\em A function to copy a node. \end{DoxyCompactList}\item 
static void $\ast$ \hyperlink{carto__base__graph_8c_a6f9a294b0b7a73ae30cb2e03a5fbb961}{opal\+\_\+carto\+\_\+base\+\_\+alloc\+\_\+node} (void)
\begin{DoxyCompactList}\small\item\em Allocate memory for node. \end{DoxyCompactList}\item 
static int \hyperlink{carto__base__graph_8c_ad46f3e4511da13312e6d60240e43625e}{opal\+\_\+carto\+\_\+compare\+\_\+nodes} (void $\ast$node1, void $\ast$node2)
\begin{DoxyCompactList}\small\item\em Compare two nodes. \end{DoxyCompactList}\item 
static char $\ast$ \hyperlink{carto__base__graph_8c_ad489e7d8edf72739ea3b03b584bddd0e}{opal\+\_\+carto\+\_\+print\+\_\+node} (void $\ast$node)
\begin{DoxyCompactList}\small\item\em A function to print a node. \end{DoxyCompactList}\item 
void \hyperlink{carto__base__graph_8c_a775bd64aa9f708f2f75992e6d189e24e}{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+create\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$$\ast$graph)
\begin{DoxyCompactList}\small\item\em Create new carto graph. \end{DoxyCompactList}\item 
void \hyperlink{carto__base__graph_8c_a8f931d75406d8ff920c6c867b0e0d1cf}{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__carto__base__node__t}{opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$node)
\begin{DoxyCompactList}\small\item\em Add a node to carto graph. \end{DoxyCompactList}\item 
void \hyperlink{carto__base__graph_8c_a1887ee911e1ac58b190d31ea03d5c11b}{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$graph)
\begin{DoxyCompactList}\small\item\em Free a carto graph. \end{DoxyCompactList}\item 
int \hyperlink{carto__base__graph_8c_a3aac7d99851d1174c92db24feb1c6493}{opal\+\_\+carto\+\_\+base\+\_\+connect\+\_\+nodes\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__carto__base__node__t}{opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$start, \hyperlink{structopal__carto__base__node__t}{opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$end, uint32\+\_\+t weight)
\begin{DoxyCompactList}\small\item\em Connect two nodes by adding an edge to the graph. \end{DoxyCompactList}\item 
void \hyperlink{carto__base__graph_8c_ae245136cfa0cd86940b8b6b29328eff4}{opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$$\ast$destination, const \hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$source, const char $\ast$node\+\_\+type)
\begin{DoxyCompactList}\small\item\em Duplicate a carto graph and reduce the new graph to contain nodes from a ceratin type(s) \end{DoxyCompactList}\item 
int \hyperlink{carto__base__graph_8c_a7fd4d49449d8bb06caab2f6b689e53f7}{opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__carto__base__node__t}{opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$reference\+\_\+node, const char $\ast$node\+\_\+type, \hyperlink{structopal__value__array__t}{opal\+\_\+value\+\_\+array\+\_\+t} $\ast$dist\+\_\+array)
\begin{DoxyCompactList}\small\item\em opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance -\/ returns the distance of all the nodes from the reference node. \end{DoxyCompactList}\item 
uint32\+\_\+t \hyperlink{carto__base__graph_8c_afd1d2efba295e8b0ad74f236cd9ea03c}{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+spf\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$graph, \hyperlink{structopal__carto__base__node__t}{opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$node1, \hyperlink{structopal__carto__base__node__t}{opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$node2)
\begin{DoxyCompactList}\small\item\em Find the shortest path between two nodes in the graph. \end{DoxyCompactList}\item 
\hyperlink{structopal__carto__base__node__t}{opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$ \hyperlink{carto__base__graph_8c_ae398ec96f3f2ea18e586b99e2a7a8a9e}{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+find\+\_\+node\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$graph, const char $\ast$node\+\_\+name)
\begin{DoxyCompactList}\small\item\em Find a node in the graph according to its name. \end{DoxyCompactList}\item 
int \hyperlink{carto__base__graph_8c_a87c86274230b9c355488f7a0bddb1781}{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+get\+\_\+host\+\_\+graph\+\_\+fn} (\hyperlink{carto_8h_a42e29ece33c57c10126c847cbb8423b6}{opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$$\ast$graph, const char $\ast$graph\+\_\+type)
\begin{DoxyCompactList}\small\item\em Get the host cartography graph. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This file is an implementation of the carto graph base on the graph class. 

This file is common to all the carto components. 

\subsection{Function Documentation}
\hypertarget{carto__base__graph_8c_a6f9a294b0b7a73ae30cb2e03a5fbb961}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+alloc\+\_\+node@{opal\+\_\+carto\+\_\+base\+\_\+alloc\+\_\+node}}
\index{opal\+\_\+carto\+\_\+base\+\_\+alloc\+\_\+node@{opal\+\_\+carto\+\_\+base\+\_\+alloc\+\_\+node}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+alloc\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}static void $\ast$ opal\+\_\+carto\+\_\+base\+\_\+alloc\+\_\+node (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{carto__base__graph_8c_a6f9a294b0b7a73ae30cb2e03a5fbb961}


Allocate memory for node. 

this function will be assign to the alloc\+\_\+vertex\+\_\+data function pointer.

\begin{DoxyReturn}{Returns}
void$\ast$ 
\end{DoxyReturn}


Referenced by opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn().

\hypertarget{carto__base__graph_8c_a3aac7d99851d1174c92db24feb1c6493}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+connect\+\_\+nodes\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+connect\+\_\+nodes\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+connect\+\_\+nodes\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+connect\+\_\+nodes\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+connect\+\_\+nodes\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}int opal\+\_\+carto\+\_\+base\+\_\+connect\+\_\+nodes\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$}]{start, }
\item[{{\bf opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$}]{end, }
\item[{uint32\+\_\+t}]{weight}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_a3aac7d99851d1174c92db24feb1c6493}


Connect two nodes by adding an edge to the graph. 


\begin{DoxyParams}{Parameters}
{\em graph} & the graph that the nodes belongs to. \\
\hline
{\em start} & the start node \\
\hline
{\em end} & the end node \\
\hline
{\em weight} & the weight of the connection\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int success or error (if one of the nodes does not belong to the graph. 
\end{DoxyReturn}


References opal\+\_\+graph\+\_\+add\+\_\+edge().

\hypertarget{carto__base__graph_8c_a9ce03b81a87ca46e6910e3fb3e9da2d6}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+copy\+\_\+nodes@{opal\+\_\+carto\+\_\+base\+\_\+copy\+\_\+nodes}}
\index{opal\+\_\+carto\+\_\+base\+\_\+copy\+\_\+nodes@{opal\+\_\+carto\+\_\+base\+\_\+copy\+\_\+nodes}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+copy\+\_\+nodes}]{\setlength{\rightskip}{0pt plus 5cm}static void opal\+\_\+carto\+\_\+base\+\_\+copy\+\_\+nodes (
\begin{DoxyParamCaption}
\item[{void $\ast$$\ast$}]{dst, }
\item[{void $\ast$}]{src}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{carto__base__graph_8c_a9ce03b81a87ca46e6910e3fb3e9da2d6}


A function to copy a node. 

this function will be assign in the copy\+\_\+vertex\+\_\+data function pointer.


\begin{DoxyParams}{Parameters}
{\em dst} & the destination node. \\
\hline
{\em src} & the source node. \\
\hline
\end{DoxyParams}


Referenced by opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn().

\hypertarget{carto__base__graph_8c_ae245136cfa0cd86940b8b6b29328eff4}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}void opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$$\ast$}]{destination, }
\item[{const {\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$}]{source, }
\item[{const char $\ast$}]{node\+\_\+type}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_ae245136cfa0cd86940b8b6b29328eff4}


Duplicate a carto graph and reduce the new graph to contain nodes from a ceratin type(s) 


\begin{DoxyParams}{Parameters}
{\em destination} & The new graph. \\
\hline
{\em source} & the original graph. \\
\hline
{\em node\+\_\+type} & the node type(s) that the new graph will include. \\
\hline
\end{DoxyParams}


References O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+graph\+\_\+duplicate(), opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices(), opal\+\_\+graph\+\_\+remove\+\_\+vertex(), opal\+\_\+pointer\+\_\+array\+\_\+get\+\_\+item(), and opal\+\_\+pointer\+\_\+array\+\_\+init().



Referenced by opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+get\+\_\+host\+\_\+graph\+\_\+fn().

\hypertarget{carto__base__graph_8c_a1887ee911e1ac58b190d31ea03d5c11b}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}void opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$}]{graph}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_a1887ee911e1ac58b190d31ea03d5c11b}


Free a carto graph. 


\begin{DoxyParams}{Parameters}
{\em graph} & the graph we want to free. \\
\hline
\end{DoxyParams}


References O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E, opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node(), opal\+\_\+graph\+\_\+get\+\_\+graph\+\_\+vertices(), opal\+\_\+pointer\+\_\+array\+\_\+get\+\_\+item(), and opal\+\_\+pointer\+\_\+array\+\_\+init().

\hypertarget{carto__base__graph_8c_a49557ce49f661a9e76caba9cf19a7798}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node@{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node}}
\index{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node@{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}static void opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{node}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{carto__base__graph_8c_a49557ce49f661a9e76caba9cf19a7798}


A function to free node. 

this function will be assigned to the free\+\_\+vertex\+\_\+data pointer


\begin{DoxyParams}{Parameters}
{\em node} & the node to free. \\
\hline
\end{DoxyParams}


Referenced by opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn(), and opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn().

\hypertarget{carto__base__graph_8c_a7fd4d49449d8bb06caab2f6b689e53f7}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}int opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$}]{reference\+\_\+node, }
\item[{const char $\ast$}]{node\+\_\+type, }
\item[{{\bf opal\+\_\+value\+\_\+array\+\_\+t} $\ast$}]{dist\+\_\+array}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_a7fd4d49449d8bb06caab2f6b689e53f7}


opal\+\_\+carto\+\_\+base\+\_\+get\+\_\+nodes\+\_\+distance -\/ returns the distance of all the nodes from the reference node. 


\begin{DoxyParams}{Parameters}
{\em graph} & \\
\hline
{\em reference\+\_\+node} & \\
\hline
{\em node\+\_\+type} & the type of the nodes in the returned array \\
\hline
{\em dist\+\_\+array} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int number of nodes in the returned array. 
\end{DoxyReturn}


References opal\+\_\+graph\+\_\+dijkstra().

\hypertarget{carto__base__graph_8c_a8f931d75406d8ff920c6c867b0e0d1cf}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}void opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$}]{node}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_a8f931d75406d8ff920c6c867b0e0d1cf}


Add a node to carto graph. 


\begin{DoxyParams}{Parameters}
{\em graph} & the carto graph to add the node to. \\
\hline
{\em node} & the node to add. \\
\hline
\end{DoxyParams}


References opal\+\_\+carto\+\_\+base\+\_\+alloc\+\_\+node(), opal\+\_\+carto\+\_\+base\+\_\+copy\+\_\+nodes(), opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+node(), opal\+\_\+carto\+\_\+compare\+\_\+nodes(), opal\+\_\+carto\+\_\+print\+\_\+node(), and opal\+\_\+graph\+\_\+add\+\_\+vertex().

\hypertarget{carto__base__graph_8c_a775bd64aa9f708f2f75992e6d189e24e}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+create\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+create\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+create\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+create\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+create\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}void opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+create\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$$\ast$}]{graph}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_a775bd64aa9f708f2f75992e6d189e24e}


Create new carto graph. 


\begin{DoxyParams}{Parameters}
{\em graph} & an empty graph pointer \\
\hline
\end{DoxyParams}
\hypertarget{carto__base__graph_8c_ae398ec96f3f2ea18e586b99e2a7a8a9e}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+find\+\_\+node\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+find\+\_\+node\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+find\+\_\+node\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+find\+\_\+node\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+find\+\_\+node\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}{\bf opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t}$\ast$ opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+find\+\_\+node\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{const char $\ast$}]{node\+\_\+name}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_ae398ec96f3f2ea18e586b99e2a7a8a9e}


Find a node in the graph according to its name. 


\begin{DoxyParams}{Parameters}
{\em graph} & the graph in which we are searching. \\
\hline
{\em node\+\_\+name} & the node name.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t$\ast$ the node with the name -\/if found or N\+U\+L\+L. 
\end{DoxyReturn}
find a vertex in the graph. the find\+\_\+vertex uses the compare\+\_\+vertex\+\_\+data method. in our case, compare\+\_\+vertex\+\_\+data is assigned to opal\+\_\+carto\+\_\+compare\+\_\+nodes that compares two nodes names.

References opal\+\_\+graph\+\_\+find\+\_\+vertex().

\hypertarget{carto__base__graph_8c_a87c86274230b9c355488f7a0bddb1781}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+get\+\_\+host\+\_\+graph\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+get\+\_\+host\+\_\+graph\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+get\+\_\+host\+\_\+graph\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+get\+\_\+host\+\_\+graph\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+get\+\_\+host\+\_\+graph\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}int opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+get\+\_\+host\+\_\+graph\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$$\ast$}]{graph, }
\item[{const char $\ast$}]{graph\+\_\+type}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_a87c86274230b9c355488f7a0bddb1781}


Get the host cartography graph. 


\begin{DoxyParams}{Parameters}
{\em graph} & an unallocated pointer to a graph. \\
\hline
{\em graph\+\_\+type} & the type of nodes we want the returned graph will contain.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int success or error 
\end{DoxyReturn}


References opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn().

\hypertarget{carto__base__graph_8c_afd1d2efba295e8b0ad74f236cd9ea03c}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+spf\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+spf\+\_\+fn}}
\index{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+spf\+\_\+fn@{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+spf\+\_\+fn}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+spf\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}uint32\+\_\+t opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+spf\+\_\+fn (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+carto\+\_\+graph\+\_\+t} $\ast$}]{graph, }
\item[{{\bf opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$}]{node1, }
\item[{{\bf opal\+\_\+carto\+\_\+base\+\_\+node\+\_\+t} $\ast$}]{node2}
\end{DoxyParamCaption}
)}}\label{carto__base__graph_8c_afd1d2efba295e8b0ad74f236cd9ea03c}


Find the shortest path between two nodes in the graph. 


\begin{DoxyParams}{Parameters}
{\em graph} & the graph that the nodes belongs to. \\
\hline
{\em node1} & first node. \\
\hline
{\em node2} & second node.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
uint32\+\_\+t he distance between the nodes. 
\end{DoxyReturn}


References opal\+\_\+graph\+\_\+spf().

\hypertarget{carto__base__graph_8c_ad46f3e4511da13312e6d60240e43625e}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+compare\+\_\+nodes@{opal\+\_\+carto\+\_\+compare\+\_\+nodes}}
\index{opal\+\_\+carto\+\_\+compare\+\_\+nodes@{opal\+\_\+carto\+\_\+compare\+\_\+nodes}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+compare\+\_\+nodes}]{\setlength{\rightskip}{0pt plus 5cm}static int opal\+\_\+carto\+\_\+compare\+\_\+nodes (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{node1, }
\item[{void $\ast$}]{node2}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{carto__base__graph_8c_ad46f3e4511da13312e6d60240e43625e}


Compare two nodes. 

in our case we needs to compare only the node name. this function will be assign to the compare vertex data function pointer.


\begin{DoxyParams}{Parameters}
{\em node1} & \\
\hline
{\em node2} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int 0-\/equal, 1-\/the first is bigger, -\/1-\/the first is smaller. 
\end{DoxyReturn}


Referenced by opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn().

\hypertarget{carto__base__graph_8c_ad489e7d8edf72739ea3b03b584bddd0e}{\index{carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}!opal\+\_\+carto\+\_\+print\+\_\+node@{opal\+\_\+carto\+\_\+print\+\_\+node}}
\index{opal\+\_\+carto\+\_\+print\+\_\+node@{opal\+\_\+carto\+\_\+print\+\_\+node}!carto\+\_\+base\+\_\+graph.\+c@{carto\+\_\+base\+\_\+graph.\+c}}
\subsubsection[{opal\+\_\+carto\+\_\+print\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}static char $\ast$ opal\+\_\+carto\+\_\+print\+\_\+node (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{node}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{carto__base__graph_8c_ad489e7d8edf72739ea3b03b584bddd0e}


A function to print a node. 

this function allocates buffer and prints in it the node type and the node name. this function will be assign to the print\+\_\+vertex function pointer when building a new node.


\begin{DoxyParams}{Parameters}
{\em node} & The node we want to print\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
char$\ast$ the string to print. 
\end{DoxyReturn}


Referenced by opal\+\_\+carto\+\_\+base\+\_\+graph\+\_\+add\+\_\+node\+\_\+fn().

