Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TULIP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NUI
TULIP
Commits
ff22c512
Commit
ff22c512
authored
Aug 26, 2020
by
Nico Mack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor bug fixes and improvements
parent
5cd35629
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
9 deletions
+37
-9
TULIP/src/lu/list/itis/dkd/tui/feature/cluster/clusterer/DBScanClusterer.java
...is/dkd/tui/feature/cluster/clusterer/DBScanClusterer.java
+6
-4
TULIP/src/lu/list/itis/dkd/tui/utility/Point.java
TULIP/src/lu/list/itis/dkd/tui/utility/Point.java
+30
-4
TULIP/src/lu/list/itis/dkd/tui/utility/kdtree/SquaredDistancePointComparator.java
...kd/tui/utility/kdtree/SquaredDistancePointComparator.java
+1
-1
No files found.
TULIP/src/lu/list/itis/dkd/tui/feature/cluster/clusterer/DBScanClusterer.java
View file @
ff22c512
...
...
@@ -148,10 +148,12 @@ public class DBScanClusterer<T extends Positionable> implements Clusterer<T> {
int
numberOfPoints
=
points
.
size
();
for
(
int
current
=
0
;
current
<
numberOfPoints
;
current
++)
{
int
assignedCLusterId
=
this
.
clusterIds
.
get
(
current
);
Cluster
<
T
>
cluster
=
clustered
.
get
(
assignedCLusterId
);
cluster
.
setHandleId
(
assignedCLusterId
);
cluster
.
addPoint
(
this
.
points
.
get
(
current
));
clustered
.
set
(
assignedCLusterId
,
cluster
);
if
(
assignedCLusterId
>=
0
)
{
Cluster
<
T
>
cluster
=
clustered
.
get
(
assignedCLusterId
);
cluster
.
setHandleId
(
assignedCLusterId
);
cluster
.
addPoint
(
this
.
points
.
get
(
current
));
clustered
.
set
(
assignedCLusterId
,
cluster
);
}
}
return
clustered
;
}
...
...
TULIP/src/lu/list/itis/dkd/tui/utility/Point.java
View file @
ff22c512
...
...
@@ -70,6 +70,8 @@ public class Point extends Float implements Comparable<Point>, Scriptable {
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
Point
.
class
.
getSimpleName
());
private
static
final
String
NO_SUCH_AXIS_MESSAGE
=
"This should never happen! No such axis {}!"
;
/** Constant identifying the X Axis */
public
static
final
int
X_AXIS
=
0
;
...
...
@@ -562,7 +564,14 @@ public class Point extends Float implements Comparable<Point>, Scriptable {
return
(
deltaX
*
deltaX
)
+
(
deltaY
*
deltaY
);
}
/** {@inheritDoc} */
/**
* returns the distance between this point and the other one along a given axis. Method returns
* the absolute value of the distance
*
* @param other
* @param axis
* @return
*/
public
double
getDistance
(
Point
other
,
int
axis
)
{
double
distance
=
0
;
switch
(
axis
)
{
...
...
@@ -573,10 +582,27 @@ public class Point extends Float implements Comparable<Point>, Scriptable {
distance
=
this
.
y
-
other
.
y
;
break
;
default
:
LOGGER
.
error
(
"This should never happen! No such axis {}!"
,
axis
);
//$NON-NLS-1$
LOGGER
.
error
(
NO_SUCH_AXIS_MESSAGE
,
axis
);
break
;
}
return
Math
.
abs
(
distance
);
}
/** {@inheritDoc} */
public
double
getSquaredDistance
(
Point
other
,
int
axis
)
{
double
distance
=
0
;
switch
(
axis
)
{
case
X_AXIS:
distance
=
this
.
x
-
other
.
x
;
break
;
case
Y_AXIS:
distance
=
this
.
y
-
other
.
y
;
break
;
default
:
LOGGER
.
error
(
NO_SUCH_AXIS_MESSAGE
,
axis
);
break
;
}
return
Math
.
sqrt
(
distance
*
distance
);
return
(
distance
*
distance
);
}
/** {@inheritDoc} */
...
...
@@ -630,7 +656,7 @@ public class Point extends Float implements Comparable<Point>, Scriptable {
comparison
=
PointComparator
.
y
.
compare
(
this
,
o
);
break
;
default
:
LOGGER
.
error
(
"This should never happen! No such axis {}!"
,
axis
);
//$NON-NLS-1$
LOGGER
.
error
(
NO_SUCH_AXIS_MESSAGE
,
axis
);
break
;
}
}
...
...
TULIP/src/lu/list/itis/dkd/tui/utility/kdtree/SquaredDistancePointComparator.java
View file @
ff22c512
...
...
@@ -40,7 +40,7 @@ public class SquaredDistancePointComparator implements KdComparator<Point> {
/** {@inheritDoc} */
@Override
public
double
getDistance
(
Point
o1
,
Point
o2
,
int
axis
)
{
return
o1
.
getDistance
(
o2
,
axis
);
return
o1
.
get
Squared
Distance
(
o2
,
axis
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment