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 invalid input: '<'post@mkonrad.net>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalcClusters(int numClusters) protected Point3dcreateNewClusterPoint(Point3d clusterPoint3d, int epsilonFactor) getClusterPoints(int numClusters) Get calculated cluster points.doubleReturn epsilon parameter (accuracy)protected Point3dinitializeClusterPoint(List<Point3d> pointsInCluster) voidsetEpsilon(double epsilon) Set epsilon parameter (accuracy).voidsetSamplePoints(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 invalid input: '<' epsilon invalid input: '<' 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
-