Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
iMSTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Boeckel
iMSTK
Commits
fc178ff5
Commit
fc178ff5
authored
5 years ago
by
Nghia Truong
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: Add comments and commandline option for Graph example
parent
0d3f42f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/Graph/GraphExample.cpp
+14
-1
14 additions, 1 deletion
Examples/Graph/GraphExample.cpp
with
14 additions
and
1 deletion
Examples/Graph/GraphExample.cpp
+
14
−
1
View file @
fc178ff5
...
...
@@ -23,14 +23,20 @@
#include
"imstkTetrahedralMesh.h"
#include
"imstkMeshIO.h"
#include
<iostream>
using
namespace
imstk
;
///
/// \brief This example demonstrates the imstk graph usage
/// Usage: Example-Graph.exe [method=greedy/welsh-powell]
/// (if no method was specified, WelshPowell method will be used)
///
int
main
(
int
argc
,
char
**
argv
)
{
// Using WelshPowell method by default
Graph
::
ColoringMethod
method
=
Graph
::
ColoringMethod
::
WelshPowell
;
if
(
argc
>
1
)
{
auto
param
=
std
::
string
(
argv
[
1
]);
...
...
@@ -41,10 +47,17 @@ int main(int argc, char** argv)
{
method
=
Graph
::
ColoringMethod
::
Greedy
;
}
// else: no need to set
else
if
(
param
.
substr
(
param
.
find_first_of
(
"="
)
+
1
)
==
"welsh-powell"
)
{
method
=
Graph
::
ColoringMethod
::
WelshPowell
;
}
}
}
std
::
cout
<<
(
method
==
Graph
::
ColoringMethod
::
Greedy
?
"Graph coloring method: Greedy"
:
"Graph coloring method: WelshPowell"
)
<<
std
::
endl
<<
std
::
endl
;
Graph
g1
(
5
);
g1
.
addEdge
(
0
,
1
);
g1
.
addEdge
(
0
,
2
);
...
...
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