Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alignment API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
moex
Alignment API
Commits
6126ba35
Commit
6126ba35
authored
14 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- better documented the Hungarian alorithm guard
parent
75e38f68
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fr/inrialpes/exmo/align/impl/DistanceAlignment.java
+15
-14
15 additions, 14 deletions
src/fr/inrialpes/exmo/align/impl/DistanceAlignment.java
with
15 additions
and
14 deletions
src/fr/inrialpes/exmo/align/impl/DistanceAlignment.java
+
15
−
14
View file @
6126ba35
...
@@ -238,6 +238,7 @@ public abstract class DistanceAlignment extends ObjectAlignment implements Align
...
@@ -238,6 +238,7 @@ public abstract class DistanceAlignment extends ObjectAlignment implements Align
for
(
Object
ob
:
ontology2
().
getClasses
()
)
{
for
(
Object
ob
:
ontology2
().
getClasses
()
)
{
class2
[
j
++]
=
ob
;
class2
[
j
++]
=
ob
;
}
}
// ival indicates if all cells have the same value, or different (-1)
double
ival
=
sim
.
getClassSimilarity
(
class1
[
0
],
class2
[
0
]);
double
ival
=
sim
.
getClassSimilarity
(
class1
[
0
],
class2
[
0
]);
for
(
i
=
0
;
i
<
nbclasses1
;
i
++
){
for
(
i
=
0
;
i
<
nbclasses1
;
i
++
){
for
(
j
=
0
;
j
<
nbclasses2
;
j
++
){
for
(
j
=
0
;
j
<
nbclasses2
;
j
++
){
...
@@ -247,22 +248,22 @@ public abstract class DistanceAlignment extends ObjectAlignment implements Align
...
@@ -247,22 +248,22 @@ public abstract class DistanceAlignment extends ObjectAlignment implements Align
}
}
}
}
// Pass it to the algorithm
// Pass it to the algorithm
if
(
ival
==
-
1
.
)
{
if
(
ival
==
-
1
.
)
{
// if values are the same, return an empty alignment
int
[][]
result
=
HungarianAlgorithm
.
hgAlgorithm
(
matrix
,
"max"
);
int
[][]
result
=
HungarianAlgorithm
.
hgAlgorithm
(
matrix
,
"max"
);
// Extract the result
// Extract the result
for
(
i
=
0
;
i
<
result
.
length
;
i
++
){
for
(
i
=
0
;
i
<
result
.
length
;
i
++
){
// The matrix has been destroyed
// The matrix has been destroyed
double
val
;
double
val
;
if
(
sim
.
getSimilarity
()
)
val
=
sim
.
getClassSimilarity
(
class1
[
result
[
i
][
0
]],
class2
[
result
[
i
][
1
]]);
if
(
sim
.
getSimilarity
()
)
val
=
sim
.
getClassSimilarity
(
class1
[
result
[
i
][
0
]],
class2
[
result
[
i
][
1
]]);
else
val
=
1
-
sim
.
getClassSimilarity
(
class1
[
result
[
i
][
0
]],
class2
[
result
[
i
][
1
]]);
else
val
=
1
-
sim
.
getClassSimilarity
(
class1
[
result
[
i
][
0
]],
class2
[
result
[
i
][
1
]]);
// JE: here using strict-> is a very good idea.
// JE: here using strict-> is a very good idea.
// it means that alignments with 0. similarity
// it means that correspondences with 0. similarity
// will be excluded from the best match.
// will be excluded from the best match.
if
(
val
>
threshold
){
if
(
val
>
threshold
){
addCell
(
new
ObjectCell
(
(
String
)
null
,
class1
[
result
[
i
][
0
]],
class2
[
result
[
i
][
1
]],
BasicRelation
.
createRelation
(
"="
),
val
)
);
addCell
(
new
ObjectCell
(
(
String
)
null
,
class1
[
result
[
i
][
0
]],
class2
[
result
[
i
][
1
]],
BasicRelation
.
createRelation
(
"="
),
val
)
);
}
}
}
}
}
}
}
catch
(
AlignmentException
alex
)
{
alex
.
printStackTrace
();
}
}
catch
(
AlignmentException
alex
)
{
alex
.
printStackTrace
();
}
catch
(
OntowrapException
owex
)
{
owex
.
printStackTrace
();
}
catch
(
OntowrapException
owex
)
{
owex
.
printStackTrace
();
}
// For properties
// For properties
...
...
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