java.lang.Object
de.grogra.math.GenLloyd
GenLloyd Library - Implementation of Generalized Lloyd (also known as Linde-Buzo-Gray or LBG) algorithm
- Author:
- Markus Konrad <post@mkonrad.net>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
calcClusters
(int numClusters) protected Point3d
createNewClusterPoint
(Point3d clusterPoint3d, int epsilonFactor) getClusterPoints
(int numClusters) Get calculated cluster points.double
Return epsilon parameter (accuracy)protected Point3d
initializeClusterPoint
(List<Point3d> pointsInCluster) void
setEpsilon
(double epsilon) Set epsilon parameter (accuracy).void
setSamplePoints
(List<Point3d> samplePoints) Set list of sample pointsprotected int
-
Field Details
-
samplePoints
-
clusterPoints
-
epsilon
protected double epsilon -
avgDistortion
protected double avgDistortion
-
-
Constructor Details
-
GenLloyd
Create Generalized Lloyd object with an array of sample points- Parameters:
samplePoint3ds
- 2-dimensional array of N sample points where each point has the same dimension K
-
GenLloyd
-
-
Method Details
-
getEpsilon
public double getEpsilon()Return epsilon parameter (accuracy)- Returns:
- epsilon parameter (accuracy)
-
setEpsilon
public void setEpsilon(double epsilon) Set epsilon parameter (accuracy). Should be a small number 0.0 < epsilon < 0.1- Parameters:
epsilon
- parameter (accuracy)
-
setSamplePoints
Set list of sample points- Parameters:
samplePoints
-
-
getClusterPoints
Get calculated cluster points.cluster points will be calculated and returned - Parameters:
numClusters
- number of clusters that should be calculated. This should be a power of 2.- Returns:
- calculated cluster points
-
calcClusters
protected void calcClusters(int numClusters) -
splitClusters
protected int splitClusters() -
initializeClusterPoint
-
createNewClusterPoint
-