public class GeneratorSingleCluster extends Object implements GeneratorInterfaceDynamic, Model
Modifier and Type | Field and Description |
---|---|
private List<Distribution> |
axes
The distribution generators for each axis
|
private Vector |
clipmax |
private Vector |
clipmin
Clipping vectors.
|
private double |
densitycorrection
Correction factor for probability computation
|
private int |
dim
The dimensionality
|
private int |
discarded
Discarded count
|
private String |
name
Cluster name
|
private 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(String name,
int size,
double densitycorrection,
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(Vector v)
Add a translation to the generator
|
List<Vector> |
generate(int count)
Generate the given number of additional points.
|
Vector |
getClipmax()
Return a copy of the 'clipping maximum' vector
|
Vector |
getClipmin()
Return a copy of the 'clipping minimum' vector.
|
double |
getDensity(Vector p)
Compute density for cluster model at given vector 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.
|
String |
getName()
Get cluster name.
|
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(Vector min,
Vector 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(Vector p)
Test if a point is to be clipped
|
private List<Distribution> axes
private AffineTransformation trans
private int dim
private Vector clipmin
private Vector clipmax
private double densitycorrection
private int size
private String name
private int retries
private int discarded
private Random random
public void addGenerator(Distribution gen) throws UnableToComplyException
gen
- Distribution generatorUnableToComplyException
- thrown when no new generators may be added
anymorepublic 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(Vector v)
v
- translation vectorpublic void setClipping(Vector min, Vector max) throws UnableToComplyException
min
- Minimum values for clippingmax
- Maximum values for clippingUnableToComplyException
- thrown when invalid vectors were given.public int getDim()
getDim
in interface GeneratorInterface
private boolean testClipping(Vector p)
p
- pointpublic List<Vector> generate(int count) throws UnableToComplyException
generate
in interface GeneratorInterface
count
- Number of points to generateUnableToComplyException
- when generation failsGeneratorInterface.generate(int)
public double getDensity(Vector p)
getDensity
in interface GeneratorInterface
p
- vectorGeneratorInterface.getDensity(de.lmu.ifi.dbs.elki.math.linearalgebra.Vector)
public AffineTransformation getTransformation()
public Vector getClipmin()
public Vector getClipmax()
public int getSize()
getSize
in interface GeneratorInterface
public 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 Random getNewRandomGenerator()
public Model makeModel()
makeModel
in interface GeneratorInterface
public Distribution getDistribution(int i)
i
- Generator axis iCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.