public class GeneratorSingleCluster extends Object implements GeneratorInterfaceDynamic
Modifier and Type | Field and Description |
---|---|
private LinkedList<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
|
LinkedList<Vector> |
points
The generated cluster points.
|
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 |
addDiscarded(int discarded)
Increase number of discarded points
|
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
|
LinkedList<Vector> |
generate(int count)
Generate the given number of additional points.
|
LinkedList<Distribution> |
getAxes()
Get axis generators.
|
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
|
String |
getName()
Get cluster name.
|
Random |
getNewRandomGenerator()
Create a new random generator (reproducible)
|
LinkedList<Vector> |
getPoints()
Return the list of points (no copy)
|
int |
getRetries()
Return number of remaining retries.
|
int |
getSize()
Return the size
|
AffineTransformation |
getTrans()
Get transformation
|
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.
|
void |
setPoints(LinkedList<Vector> points)
Set the list of points in the cluster
|
private boolean |
testClipping(Vector p)
Test if a point is to be clipped
|
private LinkedList<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
public LinkedList<Vector> points
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 LinkedList<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 LinkedList<Distribution> getAxes()
public AffineTransformation getTrans()
public Vector getClipmin()
public Vector getClipmax()
public LinkedList<Vector> getPoints()
getPoints
in interface GeneratorInterface
public void setPoints(LinkedList<Vector> points)
points
- New list of points in this cluster.public int getSize()
getSize
in interface GeneratorInterface
public String getName()
getName
in interface GeneratorInterface
public int getDiscarded()
getDiscarded
in interface GeneratorInterfaceDynamic
public void addDiscarded(int discarded)
addDiscarded
in interface GeneratorInterfaceDynamic
discarded
- number of points discarded.public int getRetries()
getRetries
in interface GeneratorInterfaceDynamic
public double getDensityCorrection()
public void setDensityCorrection(double densitycorrection)
densitycorrection
- new density correction factor.public Random getNewRandomGenerator()