Skip to content

Commit 5401eea

Browse files
committed
Change package names
1 parent 315a98d commit 5401eea

107 files changed

Lines changed: 501 additions & 565 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Jenkinsfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ pipeline {
102102
}
103103

104104
post {
105-
always {
106-
chuckNorris()
107-
}
108-
109105
cleanup {
110106
cleanWs()
111107
}

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ ext {
99
specVersion = "${majorVersion}.${minorVersion}"
1010
jarVersion = "${majorVersion}.${minorVersion}.${dateVersion}"
1111
vendor = 'Rafał Kaleta'
12-
mainPackage = 'algolib'
12+
mainPackage = 'com.github.refhumbold.algolib'
1313
}
1414

1515
version = project.jarVersion
16-
archivesBaseName = project.mainPackage
1716

1817
repositories {
1918
mavenCentral()

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.name = 'AlgoLib_Java'
1+
rootProject.name = 'AlgoLib'

src/main/java/algolib/geometry/GeometryObject.java renamed to src/main/java/com/github/refhumbold/algolib/geometry/GeometryObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algolib.geometry;
1+
package com.github.refhumbold.algolib.geometry;
22

33
public abstract class GeometryObject
44
{

src/main/java/algolib/geometry/dim2/ClosestPoints.java renamed to src/main/java/com/github/refhumbold/algolib/geometry/dim2/ClosestPoints.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
package algolib.geometry.dim2;
1+
package com.github.refhumbold.algolib.geometry.dim2;
22

33
import java.util.ArrayList;
44
import java.util.List;
55
import java.util.NoSuchElementException;
66
import java.util.Objects;
77
import java.util.Optional;
8-
9-
import algolib.tuples.Pair;
8+
import com.github.refhumbold.algolib.tuples.Pair;
109

1110
/** Algorithm for searching pair of closest points in 2D. */
1211
public final class ClosestPoints
@@ -35,8 +34,9 @@ public static Pair<Point2D, Point2D> findClosestPoints(List<Point2D> points)
3534
}
3635

3736
// Searches for closest points among three of them.
38-
private static Pair<Point2D, Point2D> searchThree(
39-
Point2D point1, Point2D point2, Point2D point3)
37+
private static Pair<Point2D, Point2D> searchThree(Point2D point1,
38+
Point2D point2,
39+
Point2D point3)
4040
{
4141
double distance12 = Geometry2D.distance(point1, point2);
4242
double distance23 = Geometry2D.distance(point2, point3);
@@ -53,8 +53,9 @@ private static Pair<Point2D, Point2D> searchThree(
5353

5454
// Searches for closest points inside a belt of given width.
5555
// The resulting distance should not be less than belt width.
56-
private static Optional<Pair<Point2D, Point2D>> checkBelt(
57-
List<Point2D> pointsY, double middleX, double beltWidth)
56+
private static Optional<Pair<Point2D, Point2D>> checkBelt(List<Point2D> pointsY,
57+
double middleX,
58+
double beltWidth)
5859
{
5960
Optional<Pair<Point2D, Point2D>> closestPoints = Optional.empty();
6061
List<Integer> beltPoints = new ArrayList<>();
@@ -90,23 +91,25 @@ private static Optional<Pair<Point2D, Point2D>> checkBelt(
9091

9192
// Searches for closest points in given sublist of points.
9293
// Points are given sorted by X coordinate and by Y coordinate.
93-
private static Pair<Point2D, Point2D> searchClosest(
94-
List<Point2D> pointsX, List<Point2D> pointsY, int indexBegin, int indexEnd)
94+
private static Pair<Point2D, Point2D> searchClosest(List<Point2D> pointsX,
95+
List<Point2D> pointsY,
96+
int indexBegin,
97+
int indexEnd)
9598
{
9699
if(indexEnd - indexBegin <= 2)
97100
return Pair.of(pointsX.get(indexBegin), pointsX.get(indexEnd - 1));
98101

99102
if(indexEnd - indexBegin == 3)
100103
return searchThree(pointsX.get(indexBegin), pointsX.get(indexBegin + 1),
101-
pointsX.get(indexBegin + 2));
104+
pointsX.get(indexBegin + 2));
102105

103106
int indexMiddle = (indexBegin + indexEnd) / 2;
104107
List<Point2D> closetsYL = new ArrayList<>();
105108
List<Point2D> closetsYR = new ArrayList<>();
106109

107110
for(Point2D pt : pointsY)
108111
if(pt.x < pointsX.get(indexMiddle).x
109-
|| pt.x == pointsX.get(indexMiddle).x && pt.y < pointsX.get(indexMiddle).y)
112+
|| pt.x == pointsX.get(indexMiddle).x && pt.y < pointsX.get(indexMiddle).y)
110113
closetsYL.add(pt);
111114
else
112115
closetsYR.add(pt);
@@ -118,9 +121,7 @@ private static Pair<Point2D, Point2D> searchClosest(
118121
Geometry2D.distance(closestL.first, closestL.second) <= Geometry2D.distance(
119122
closestR.first, closestR.second) ? closestL : closestR;
120123
Optional<Pair<Point2D, Point2D>> beltPoints = checkBelt(pointsY, pointsX.get(indexMiddle).x,
121-
Geometry2D.distance(
122-
closestPoints.first,
123-
closestPoints.second));
124+
Geometry2D.distance(closestPoints.first, closestPoints.second));
124125

125126
return beltPoints.orElse(closestPoints);
126127
}

src/main/java/algolib/geometry/dim2/ConvexHull.java renamed to src/main/java/com/github/refhumbold/algolib/geometry/dim2/ConvexHull.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algolib.geometry.dim2;
1+
package com.github.refhumbold.algolib.geometry.dim2;
22

33
import java.util.ArrayList;
44
import java.util.Comparator;

src/main/java/algolib/geometry/dim2/Geometry2D.java renamed to src/main/java/com/github/refhumbold/algolib/geometry/dim2/Geometry2D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algolib.geometry.dim2;
1+
package com.github.refhumbold.algolib.geometry.dim2;
22

33
import java.util.List;
44

src/main/java/algolib/geometry/dim2/Point2D.java renamed to src/main/java/com/github/refhumbold/algolib/geometry/dim2/Point2D.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
package algolib.geometry.dim2;
1+
package com.github.refhumbold.algolib.geometry.dim2;
22

33
import java.util.Objects;
4-
5-
import algolib.geometry.GeometryObject;
4+
import com.github.refhumbold.algolib.geometry.GeometryObject;
65

76
/** Structure of point in 2D. */
87
public final class Point2D
@@ -21,7 +20,7 @@ private Point2D(double x, double y)
2120
@Override
2221
public double[] getCoordinates()
2322
{
24-
return new double[]{x, y};
23+
return new double[]{ x, y };
2524
}
2625

2726
public static Point2D of(double x, double y)

src/main/java/algolib/geometry/dim2/Vector2D.java renamed to src/main/java/com/github/refhumbold/algolib/geometry/dim2/Vector2D.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
package algolib.geometry.dim2;
1+
package com.github.refhumbold.algolib.geometry.dim2;
22

33
import java.util.Objects;
4-
5-
import algolib.geometry.GeometryObject;
4+
import com.github.refhumbold.algolib.geometry.GeometryObject;
65

76
/** Structure of vector in 2D. */
87
public final class Vector2D
@@ -21,7 +20,7 @@ private Vector2D(double x, double y)
2120
@Override
2221
public double[] getCoordinates()
2322
{
24-
return new double[]{x, y};
23+
return new double[]{ x, y };
2524
}
2625

2726
public static Vector2D of(double x, double y)

src/main/java/algolib/geometry/dim3/Geometry3D.java renamed to src/main/java/com/github/refhumbold/algolib/geometry/dim3/Geometry3D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algolib.geometry.dim3;
1+
package com.github.refhumbold.algolib.geometry.dim3;
22

33
import java.util.List;
44

0 commit comments

Comments
 (0)