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
58544f7f
Commit
58544f7f
authored
9 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- added entails( DisjunctiveRelation ) across disjunctive relations
parent
8a8f1d64
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/fr/inrialpes/exmo/align/impl/BitSetDisjunctiveRelation.java
+18
-0
18 additions, 0 deletions
.../inrialpes/exmo/align/impl/BitSetDisjunctiveRelation.java
src/fr/inrialpes/exmo/align/impl/DisjunctiveRelation.java
+2
-0
2 additions, 0 deletions
src/fr/inrialpes/exmo/align/impl/DisjunctiveRelation.java
with
20 additions
and
0 deletions
src/fr/inrialpes/exmo/align/impl/BitSetDisjunctiveRelation.java
+
18
−
0
View file @
58544f7f
...
...
@@ -121,6 +121,24 @@ public abstract class BitSetDisjunctiveRelation<T extends BaseRelation> extends
return
relset
.
isEmpty
();
}
public
boolean
entails
(
BitSetDisjunctiveRelation
<
T
>
dr
)
{
if
(
dr
==
this
)
return
true
;
if
(
dr
==
null
)
return
false
;
// This does allocate but is certainly faster and simpler
BitSet
bs
=
(
BitSet
)
relset
.
clone
();
bs
.
andNot
(
((
BitSetDisjunctiveRelation
<?>)
dr
).
getRelations
()
);
return
bs
.
isEmpty
();
/*
// This does not allocate but is certainly slower
BitSet bs = ((BitSetDisjunctiveRelation<?>)dr).getRelations();
int size = relset.size(); // is it correct?
for( int i=0; i < size; i++ ) {
if ( bs.get(i) && !relset.get(i) ) return false;
}
return true;
*/
}
/** This is kept for displayig more correctly the result **/
public
void
write
(
PrintWriter
writer
)
{
Iterator
<
T
>
brit
=
iterator
();
...
...
This diff is collapsed.
Click to expand it.
src/fr/inrialpes/exmo/align/impl/DisjunctiveRelation.java
+
2
−
0
View file @
58544f7f
...
...
@@ -45,5 +45,7 @@ public interface DisjunctiveRelation<T extends BaseRelation> extends Relation, I
public
boolean
isEmpty
();
//public boolean entails( DisjunctiveRelation<T> dr );
}
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