public class GeneratorSingleCluster extends java.lang.Object implements GeneratorInterfaceDynamic
Modifier and Type | Field and Description |
---|---|
private java.util.List<Distribution> |
axes
The distribution generators for each axis
|
private double[] |
clipmax
Clipping vectors.
|
private double[] |
clipmin
Clipping vectors.
|
private double |
densitycorrection
Correction factor for probability computation
|
private int |
dim
The dimensionality
|
private int |
discarded
Discarded count
|
private java.lang.String |
name
Cluster name
|
private java.util.Random |
random
Random generator (used for initializing random generators)
|
private int |
retries
Retry count
|
private int |
size
Number of points in the cluster (~density)
|
private AffineTransformation |
trans
The transformation matrix
|
Constructor and Description |
---|
GeneratorSingleCluster(java.lang.String name,
int size,
double densitycorrection,
java.util.Random random)
Generator (without axes)
|
Modifier and Type | Method and Description |
---|---|
void |
addGenerator(Distribution gen)
Add a new generator to the cluster.
|
void |
addRotation(int axis1,
int axis2,
double angle)
Apply a rotation to the generator
|
void |
addTranslation(double[] v)
Add a translation to the generator
|
double[] |
computeMean()
Get the cluster mean vector.
|
java.util.List<double[]> |
generate(int count)
Generate the given number of additional points.
|
double[] |
getClipmax()
Return a copy of the 'clipping maximum' double[]
|
double[] |
getClipmin()
Return a copy of the 'clipping minimum' double[].
|
double |
getDensity(double[] p)
Compute density for cluster model at given double[] p-
|
double |
getDensityCorrection()
Return density correction factor
|
int |
getDim()
Get the cluster dimensionality
|
int |
getDiscarded()
Get number of discarded points
|
Distribution |
getDistribution(int i)
Get distribution along (generator) axis i.
|
java.lang.String |
getName()
Get cluster name.
|
java.util.Random |
getNewRandomGenerator()
Create a new random generator (reproducible)
|
int |
getRetries()
Return number of remaining retries.
|
int |
getSize()
Return the size
|
AffineTransformation |
getTransformation()
Get transformation
|
void |
incrementDiscarded()
Increase number of discarded points
|
Model |
makeModel()
Make a cluster model for this cluster.
|
void |
setClipping(double[] min,
double[] max)
Set a clipping box. min needs to be smaller than max in each component.
|
void |
setDensityCorrection(double densitycorrection)
Set density correction factor.
|
private boolean |
testClipping(double[] p)
Test if a point is to be clipped
|
private java.util.List<Distribution> axes
private AffineTransformation trans
private int dim
private double[] clipmin
private double[] clipmax
private double densitycorrection
private int size
private java.lang.String name
private int retries
private int discarded
private java.util.Random random
public GeneratorSingleCluster(java.lang.String name, int size, double densitycorrection, java.util.Random random)
name
- Cluster namesize
- Cluster sizedensitycorrection
- Density correction factorrandom
- Random number generatorpublic void addGenerator(Distribution gen)
gen
- Distribution generatorpublic void addRotation(int axis1, int axis2, double angle)
axis1
- First axis (0 <= axis1 < dim)axis2
- Second axis (0 <= axis2 < dim)angle
- Angle in Radianspublic void addTranslation(double[] v)
v
- translation double[]public void setClipping(double[] min, double[] max)
min
- Minimum values for clippingmax
- Maximum values for clippingpublic int getDim()
getDim
in interface GeneratorInterface
private boolean testClipping(double[] p)
p
- pointpublic java.util.List<double[]> generate(int count)
generate
in interface GeneratorInterface
count
- Number of points to generateGeneratorInterface.generate(int)
public double getDensity(double[] p)
getDensity
in interface GeneratorInterface
p
- vectorGeneratorInterface.getDensity(double[])
public AffineTransformation getTransformation()
public double[] getClipmin()
public double[] getClipmax()
public int getSize()
getSize
in interface GeneratorInterface
public java.lang.String getName()
getName
in interface GeneratorInterface
public int getDiscarded()
getDiscarded
in interface GeneratorInterfaceDynamic
public void incrementDiscarded()
incrementDiscarded
in interface GeneratorInterfaceDynamic
public int getRetries()
getRetries
in interface GeneratorInterfaceDynamic
public double getDensityCorrection()
public void setDensityCorrection(double densitycorrection)
densitycorrection
- new density correction factor.public java.util.Random getNewRandomGenerator()
public Model makeModel()
makeModel
in interface GeneratorInterface
public Distribution getDistribution(int i)
i
- Generator axis ipublic double[] computeMean()
GeneratorInterface
computeMean
in interface GeneratorInterface
null
.Copyright © 2019 ELKI Development Team. License information.