|
Algorithm Development Kit 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectalgs.model.data.Generator<IPoint>
algs.model.data.points.UnusualGenerator
public class UnusualGenerator
Divide the size into n/4 and create uniform clusters of [0,1] way apart along the +/- X-axis and Y-axis. This data set tests the way how errors caused by floating point arithmetic can alter the result of an algorithm
| Field Summary | |
|---|---|
double |
maxValue
Store the max value. |
| Constructor Summary | |
|---|---|
UnusualGenerator(double maxValue)
Construct the generator given a maximum distance between four clusters. |
|
| Method Summary | |
|---|---|
Generator<IPoint> |
construct(java.lang.String[] args)
Provide reflective behavior to construct instance of generator given an array of string arguments. |
IPoint[] |
generate(int size)
Generate a set of |size| points all clustered into four regions, each located at the corners of a rectangle of width and height of maxValue. |
java.lang.String[] |
parameters()
Declares the name of the parameters used when constructing the generator in order from left to right. |
| Methods inherited from class algs.model.data.Generator |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final double maxValue
| Constructor Detail |
|---|
public UnusualGenerator(double maxValue)
maxValue - the distance between clusters.| Method Detail |
|---|
public java.lang.String[] parameters()
Generator
parameters in class Generator<IPoint>public Generator<IPoint> construct(java.lang.String[] args)
construct in class Generator<IPoint>public IPoint[] generate(int size)
Each cluster is going to be within a unit square [0,1] that is offset appropriately with maxValue to place these clusters at each corner.
generate in class Generator<IPoint>size - number of points to generate.
|
Algorithm Development Kit 1.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||