de.grogra.math
public class GenLloyd extends java.lang.Object
http://www.data-compression.com/vq.html#lbg,
%20LBG%20implementation&pg=PA29#v=onepage&q&f=false| Modifier and Type | Field and Description |
|---|---|
protected double |
avgDistortion |
protected java.util.List<Point3d> |
clusterPoints |
protected double |
epsilon |
protected java.util.List<Point3d> |
samplePoints |
| Constructor and Description |
|---|
GenLloyd(java.util.List<Point3d> samplePoints)
Create Generalized Lloyd object with an array of sample points
|
GenLloyd(Point3d[] samplePoints) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calcClusters(int numClusters) |
protected Point3d |
createNewClusterPoint(Point3d clusterPoint3d,
int epsilonFactor) |
java.util.List<Point3d> |
getClusterPoints(int numClusters)
Get calculated cluster points.
|
double |
getEpsilon()
Return epsilon parameter (accuracy)
|
protected Point3d |
initializeClusterPoint(java.util.List<Point3d> pointsInCluster) |
void |
setEpsilon(double epsilon)
Set epsilon parameter (accuracy).
|
void |
setSamplePoints(java.util.List<Point3d> samplePoints)
Set list of sample points
|
protected int |
splitClusters() |
protected double avgDistortion
protected java.util.List<Point3d> clusterPoints
protected double epsilon
protected java.util.List<Point3d> samplePoints
public GenLloyd(java.util.List<Point3d> samplePoints)
samplePoint3ds - 2-dimensional array of N sample points where each point has
the same dimension Kpublic GenLloyd(Point3d[] samplePoints)
protected void calcClusters(int numClusters)
protected Point3d createNewClusterPoint(Point3d clusterPoint3d, int epsilonFactor)
public java.util.List<Point3d> getClusterPoints(int numClusters)
numClusters - number of clusters that should be calculated. This should be a power of 2.public double getEpsilon()
protected Point3d initializeClusterPoint(java.util.List<Point3d> pointsInCluster)
public void setEpsilon(double epsilon)
epsilon - parameter (accuracy)public void setSamplePoints(java.util.List<Point3d> samplePoints)
samplePoints - protected int splitClusters()