Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sébastien Villemot
preprocessor
Commits
ec57ee96
Verified
Commit
ec57ee96
authored
Mar 17, 2020
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
MinimumFeedbackSet: make most functions (de facto) private
parent
ca702480
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/MinimumFeedbackSet.cc
+4
-1
4 additions, 1 deletion
src/MinimumFeedbackSet.cc
src/MinimumFeedbackSet.hh
+2
-29
2 additions, 29 deletions
src/MinimumFeedbackSet.hh
with
6 additions
and
30 deletions
src/MinimumFeedbackSet.cc
+
4
−
1
View file @
ec57ee96
/*
* Copyright © 2009-20
19
Dynare Team
* Copyright © 2009-20
20
Dynare Team
*
* This file is part of Dynare.
*
...
...
@@ -25,6 +25,9 @@ using namespace boost;
namespace
MFS
{
using
color_t
=
map
<
boost
::
graph_traits
<
AdjacencyList_t
>::
vertex_descriptor
,
boost
::
default_color_type
>
;
using
vector_vertex_descriptor_t
=
vector
<
AdjacencyList_t
::
vertex_descriptor
>
;
void
Suppress
(
AdjacencyList_t
::
vertex_descriptor
vertex_to_eliminate
,
AdjacencyList_t
&
G
)
{
...
...
This diff is collapsed.
Click to expand it.
src/MinimumFeedbackSet.hh
+
2
−
29
View file @
ec57ee96
/*
* Copyright © 2009-20
19
Dynare Team
* Copyright © 2009-20
20
Dynare Team
*
* This file is part of Dynare.
*
...
...
@@ -38,28 +38,7 @@ namespace MFS
boost
::
property
<
boost
::
vertex_in_degree_t
,
int
,
boost
::
property
<
boost
::
vertex_out_degree_t
,
int
>>>>>
;
using
AdjacencyList_t
=
boost
::
adjacency_list
<
boost
::
listS
,
boost
::
listS
,
boost
::
bidirectionalS
,
VertexProperty_t
>
;
using
color_t
=
map
<
boost
::
graph_traits
<
AdjacencyList_t
>::
vertex_descriptor
,
boost
::
default_color_type
>
;
using
vector_vertex_descriptor_t
=
vector
<
AdjacencyList_t
::
vertex_descriptor
>
;
//! Eliminate a vertex i
/*! For a vertex i replace all edges e_k_i and e_i_j by a shorcut e_k_j and then Suppress the vertex i*/
void
Eliminate
(
AdjacencyList_t
::
vertex_descriptor
vertex_to_eliminate
,
AdjacencyList_t
&
G
);
//! Collect all doublets (edges e_i_k such that there is an edge e_k_i with k!=i in the graph)
/*! Returns the vector of doublets */
vector_vertex_descriptor_t
Collect_Doublet
(
AdjacencyList_t
::
vertex_descriptor
vertex
,
AdjacencyList_t
&
G
);
//! Detect all the clique (all vertex in a clique are related to each other) in the graph
bool
Vertex_Belong_to_a_Clique
(
AdjacencyList_t
::
vertex_descriptor
vertex
,
AdjacencyList_t
&
G
);
//! Graph reduction: eliminating purely intermediate variables or variables outside of any circuit
bool
Elimination_of_Vertex_With_One_or_Less_Indegree_or_Outdegree_Step
(
AdjacencyList_t
&
G
);
//! Graph reduction: elimination of a vertex inside a clique
bool
Elimination_of_Vertex_belonging_to_a_clique_Step
(
AdjacencyList_t
&
G
);
//! A vertex belong to the feedback vertex set if the vertex loops on itself.
/*! We have to suppress this vertex and store it into the feedback set.*/
bool
Suppression_of_Vertex_X_if_it_loops_store_in_set_of_feedback_vertex_Step
(
set
<
int
>
&
feed_back_vertices
,
AdjacencyList_t
&
G1
);
//! Print the Graph
void
Print
(
AdjacencyList_t
&
G
);
//! Create an adjacency graph from a Adjacency Matrix (an incidence Matrix without the diagonal terms)
AdjacencyList_t
AM_2_AdjacencyList
(
bool
*
AMp
,
unsigned
int
n
);
//! Extracts a subgraph
/*!
\param[in] G1 The original graph
...
...
@@ -71,14 +50,8 @@ namespace MFS
to the subgraph.
*/
AdjacencyList_t
extract_subgraph
(
AdjacencyList_t
&
G1
,
set
<
int
>
select_index
);
//! Check if the graph contains any cycle (true if the model contains at least one cycle, false otherwise)
bool
has_cycle
(
vector
<
int
>
&
circuit_stack
,
AdjacencyList_t
&
g
);
bool
has_cycle_dfs
(
AdjacencyList_t
&
g
,
AdjacencyList_t
::
vertex_descriptor
u
,
color_t
&
color
,
vector
<
int
>
&
circuit_stack
);
//! Return the feedback set
AdjacencyList_t
Minimal_set_of_feedback_vertex
(
set
<
int
>
&
feed_back_vertices
,
const
AdjacencyList_t
&
G
);
//! Clear all in and out edges of vertex_to_eliminate and remove vertex_to_eliminate from the graph
void
Suppress
(
AdjacencyList_t
::
vertex_descriptor
vertex_to_eliminate
,
AdjacencyList_t
&
G
);
void
Suppress
(
int
vertex_num
,
AdjacencyList_t
&
G
);
//! Reorder the recursive variables
/*! They appear first in a quasi triangular form and they are followed by the feedback variables */
void
Reorder_the_recursive_variables
(
const
AdjacencyList_t
&
G1
,
set
<
int
>
&
feedback_vertices
,
vector
<
int
>
&
Reordered_Vertices
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment