1%%%%%%%%%%%%%%%%%%% 2% XLiFE++ is an extended library of finite elements written in C++ 3% Copyright (C) 2014 Lunéville, Eric; Kielbasiewicz, Nicolas; Lafranche, Yvon; Nguyen, Manh-Ha; Chambeyron, Colin 4% 5% This program is free software: you can redistribute it and/or modify 6% it under the terms of the GNU General Public License as published by 7% the Free Software Foundation, either version 3 of the License, or 8% (at your option) any later version. 9% This program is distributed in the hope that it will be useful, 10% but WITHOUT ANY WARRANTY; without even the implied warranty of 11% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12% GNU General Public License for more details. 13% You should have received a copy of the GNU General Public License 14% along with this program. If not, see <http://www.gnu.org/licenses/>. 15%%%%%%%%%%%%%%%%%%% 16 17\section{The {\classtitle Graph} class} 18 19The {\class Graph} class is a simple class representing a numbering graph well suited to deal with 20storage of matrices, in particular to optimize the matrix numbering in order to minimize its 21bandwith. It is not a general {\class Graph} class.\\ 22 23Each node, represented by a \verb?vector<Number>?, contains the connection between this node 24and others. Node $n_i$ and $n_j$ are "connected" if $n_j$ belongs to \verb?vector<Number>? 25defining $n_i$. The degree of a node is the number of nodes connected to it. It is implemented 26as a child class of \verb?vector<vector<Number> >?: 27\vspace{.2cm} 28\begin{lstlisting} 29class Graph : public std::vector<std::vector<Number> > 30{ 31public: 32 Graph(Number); //basic co nstructor 33 Number nodeDegree(Number) const; 34 Number maximumDegree() const; 35 ... 36}; 37\end{lstlisting} 38\vspace{.2cm} 39It provides some tools to compute matrix bandwidth and length of skyline storage of matrix, 40and to optimize numbering to reduce the bandwidth: 41\vspace{.1cm} 42\begin{lstlisting}[] 43pair<Number, Number> bandWidthAndSkyline() const; 44Number bandWidth() const; 45Number skylineSize() const; 46vector<Number> renumber(Number); 47Number renumEngine(vector<bool>&, vector<Number>&, Number& ,Number, 48 Number&, Number&); 49\end{lstlisting} 50\vspace{.2cm} 51and some printing facilities: 52\vspace{.1cm} 53\begin{lstlisting}[] 54void print(std::ostream&, const String&) const; 55void print(const String& title = "") const; 56void printNodes(std::ostream&, const vector<Number>&); 57void printNodes(const vector<Number>&); 58\end{lstlisting} 59 60\displayInfos{library=utils, header=Graph.hpp, implementation=Graph.cpp, test=test\_Graph.cpp} 61