Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sasa
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
sasa
Commits
a7b23332
Commit
a7b23332
authored
5 years ago
by
Gwennan Eliezer
Browse files
Options
Downloads
Patches
Plain Diff
Corrected spelling and replaced "failwith" by "assert false".
parent
7bfd23d6
No related branches found
No related tags found
1 merge request
!4
WIP: Resolve "Compute the graph degree, diameter, etc."
Pipeline
#26589
passed
5 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/sasacore/diameter.ml
+2
-2
2 additions, 2 deletions
lib/sasacore/diameter.ml
lib/sasacore/register.ml
+4
-4
4 additions, 4 deletions
lib/sasacore/register.ml
with
6 additions
and
6 deletions
lib/sasacore/diameter.ml
+
2
−
2
View file @
a7b23332
...
...
@@ -5,7 +5,7 @@ let (pos:string -> Topology.node list -> int) =
fst
(
List
.
fold_left
(
fun
(
found_i
,
i
)
lid
->
if
(
nid
=
lid
.
Topology
.
id
)
then
(
i
,
i
+
1
)
else
(
found_i
,
i
+
1
)
)
(
-
1
,
0
)
lid
)
(* take a graph t and returns the Adjacency matrix of t *)
let
(
graph_to_ajency
:
Topology
.
t
->
int
array
array
)
=
let
(
graph_to_a
d
jency
:
Topology
.
t
->
int
array
array
)
=
fun
t
->
let
taille
=
List
.
length
t
.
nodes
in
let
mat
=
Array
.
make_matrix
(
taille
)
(
taille
)
0
in
...
...
@@ -58,5 +58,5 @@ let (max_mat: int array array -> int) =
(* takes a graph t in argument and returns the diameter *)
let
(
get
:
Topology
.
t
->
int
)
=
fun
t
->
(
max_mat
(
floydwarshall
(
graph_to_ajency
t
)))
(
max_mat
(
floydwarshall
(
graph_to_a
d
jency
t
)))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/sasacore/register.ml
+
4
−
4
View file @
a7b23332
...
...
@@ -33,7 +33,7 @@ type 's internal_tables = {
mutable
diameter
:
int
;
}
type
proper
i
ties_functions
=
{
type
properties_functions
=
{
mutable
card
:
unit
->
int
;
mutable
min_max
:
unit
->
int
*
int
;
mutable
mean_deg
:
unit
->
float
;
...
...
@@ -65,7 +65,7 @@ let (tbls:'s internal_tables) = {
diameter
=
(
-
1
)
}
let
(
prop_funs
:
proper
i
ties_functions
)
=
{
let
(
prop_funs
:
properties_functions
)
=
{
card
=
(
fun
()
->
-
1
);
min_max
=
(
fun
()
->
(
-
1
,-
1
));
mean_deg
=
(
fun
()
->
-
1
.
);
...
...
@@ -202,7 +202,7 @@ let (is_cyclic : unit -> bool) =
|
None
->
(
set_connec_cycl
()
;
match
tbls
.
is_cyclic
with
|
Some
b
->
b
|
_
->
failwith
"unexpected error in Register.is_cyclic"
)
|
_
->
assert
false
)
|
Some
b
->
b
let
(
is_connected
:
unit
->
bool
)
=
...
...
@@ -210,7 +210,7 @@ let (is_connected : unit -> bool) =
|
None
->
(
set_connec_cycl
()
;
match
tbls
.
is_connected
with
|
Some
b
->
b
|
_
->
failwith
"unexpected error in Register.is_connected"
)
|
_
->
assert
false
)
|
Some
b
->
b
let
(
is_tree
:
unit
->
bool
)
=
...
...
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