OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
sloanlevelstruct.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #ifndef sloanlevelstruct_h
36 #define sloanlevelstruct_h
37 
38 #include "oofemcfg.h"
39 #include "intarray.h"
40 
41 namespace oofem {
42 class SloanGraph;
43 
51 class OOFEM_EXPORT SloanLevelStructure
52 {
53 private:
57  int Root;
59  int End;
61  std::vector< IntArray >Structure;
63  int Depth;
65  int Width;
66 
67 public:
69  SloanLevelStructure(SloanGraph * graph, int root) : Structure()
70  {
71  Graph = graph;
72  Root = root;
73  End = 0;
74  Depth = Width = 0;
75  }
78 
80  void destroyLevels();
88  int formYourself(int limitWidth = -1);
89 
91  int giveDepth() {
92  if ( !Depth ) {
93  computeDepth();
94  }
95 
96  return Depth;
97  }
99  int giveWidth() {
100  if ( !Width ) {
101  computeWidth();
102  }
103 
104  return Width;
105  }
107  IntArray &giveLevel(int num);
109  void setEnd(int end) { End = end; }
111  int giveEnd() { return End; }
113  int giveRoot() { return Root; }
114 
115 private:
117  void computeDepth();
119  void computeWidth();
120 };
121 } // end namespace oofem
122 #endif // sloanlevelstruct_h
int giveDepth()
Returns the depth of receiver.
Class representing level structure for Sloan profile optimizer.
int Width
Width of structure defined as max number of nodes in all levels.
SloanLevelStructure(SloanGraph *graph, int root)
Creates new level structure assignment to graph, with root being the root node.
void setEnd(int end)
Sets the end node of receiver.
Class implementing an array of integers.
Definition: intarray.h:61
int End
End node of root structure.
int giveWidth()
Returns the width of receiver.
int giveEnd()
Returns the end node of receiver.
SloanGraph * Graph
Reference to corresponding graph.
Graph representing the undirected graph used for Sloan algorithm for symmetric matrix profile reducti...
Definition: sloangraph.h:77
int Root
Root node of level structure.
std::vector< IntArray > Structure
Data representation of structure: List of arrays, one array for each level.
the oofem namespace is to define a context or scope in which all oofem names are defined.
int giveRoot()
Return root node of receiver.
int Depth
Depth of structure defined as number of levels.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011