Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MH-Tree
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
disa
public
Hulls
MH-Tree
Commits
fc444452
There was an error fetching the commit references. Please try again later.
Verified
Commit
fc444452
authored
3 years ago
by
David Procházka
Browse files
Options
Downloads
Patches
Plain Diff
ADD: an incremental version is now done by building the hull on hull objects
parent
a7fed238
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/mhtree/LeafNode.java
+1
-6
1 addition, 6 deletions
src/mhtree/LeafNode.java
src/mhtree/Node.java
+20
-26
20 additions, 26 deletions
src/mhtree/Node.java
with
21 additions
and
32 deletions
src/mhtree/LeafNode.java
+
1
−
6
View file @
fc444452
...
@@ -39,13 +39,8 @@ public class LeafNode extends Node implements Serializable {
...
@@ -39,13 +39,8 @@ public class LeafNode extends Node implements Serializable {
* @throws BucketStorageException addition of object into bucket exception
* @throws BucketStorageException addition of object into bucket exception
*/
*/
protected
void
addObject
(
LocalAbstractObject
object
)
throws
BucketStorageException
{
protected
void
addObject
(
LocalAbstractObject
object
)
throws
BucketStorageException
{
addObject
(
object
,
null
);
}
protected
void
addObject
(
LocalAbstractObject
object
,
PrecomputedDistances
distances
)
throws
BucketStorageException
{
bucket
.
addObject
(
object
);
bucket
.
addObject
(
object
);
addObjectIntoHull
(
object
);
addObjectIntoHull
(
object
,
distances
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
src/mhtree/Node.java
+
20
−
26
View file @
fc444452
...
@@ -6,7 +6,6 @@ import messif.buckets.BucketStorageException;
...
@@ -6,7 +6,6 @@ import messif.buckets.BucketStorageException;
import
messif.objects.LocalAbstractObject
;
import
messif.objects.LocalAbstractObject
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -94,18 +93,18 @@ public abstract class Node implements Serializable {
...
@@ -94,18 +93,18 @@ public abstract class Node implements Serializable {
}
}
protected
void
addObjectIntoHull
(
LocalAbstractObject
object
)
{
protected
void
addObjectIntoHull
(
LocalAbstractObject
object
)
{
addObjectIntoHull
(
object
,
null
);
if
(
isCovered
(
object
))
return
;
}
switch
(
insertType
)
{
protected
void
addObjectIntoHull
(
LocalAbstractObject
object
,
PrecomputedDistances
distances
)
{
case
GREEDY:
if
(
isCovered
(
object
,
distances
))
return
;
insertGreedy
(
object
);
break
;
if
(
insertType
==
InsertType
.
INCREMENTAL
)
{
case
INCREMENTAL:
hull
.
addHullObject
(
object
);
insertIncremental
(
object
);
return
;
break
;
default
:
throw
new
IllegalStateException
(
"Unexpected value: "
+
insertType
);
}
}
rebuildHull
(
object
,
distances
);
}
}
protected
abstract
void
addObject
(
LocalAbstractObject
object
)
throws
BucketStorageException
;
protected
abstract
void
addObject
(
LocalAbstractObject
object
)
throws
BucketStorageException
;
...
@@ -118,24 +117,19 @@ public abstract class Node implements Serializable {
...
@@ -118,24 +117,19 @@ public abstract class Node implements Serializable {
protected
abstract
void
gatherLeafNodes
(
List
<
LeafNode
>
leafNodes
);
protected
abstract
void
gatherLeafNodes
(
List
<
LeafNode
>
leafNodes
);
private
void
rebuildHull
(
LocalAbstractObject
object
,
PrecomputedDistances
distances
)
{
private
void
insertGreedy
(
LocalAbstractObject
object
)
{
List
<
LocalAbstractObject
>
objects
=
new
ArrayList
<>(
getObjects
());
List
<
LocalAbstractObject
>
objectsFromLeafNodes
=
getObjects
();
objects
.
add
(
object
);
objectsFromLeafNodes
.
add
(
object
);
if
(
distances
==
null
)
{
hull
=
new
HullOptimizedRepresentationV3
(
objects
);
}
else
{
hull
=
new
HullOptimizedRepresentationV3
(
distances
.
getSubset
(
objects
));
}
hull
=
new
HullOptimizedRepresentationV3
(
objectsFromLeafNodes
);
hull
.
build
();
hull
.
build
();
}
}
private
boolean
isCovered
(
LocalAbstractObject
object
,
PrecomputedDistances
distances
)
{
private
void
insertIncremental
(
LocalAbstractObject
object
)
{
if
(
distances
==
null
)
{
List
<
LocalAbstractObject
>
hullObjects
=
hull
.
getHull
();
return
hull
.
isExternalCovered
(
object
);
hullObjects
.
add
(
object
);
}
return
hull
.
isExternalCovered
(
object
,
distances
);
hull
=
new
HullOptimizedRepresentationV3
(
hullObjects
);
hull
.
build
();
}
}
}
}
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