 |
Synthia
Generic and flexible data structure generator
|
Go to the documentation of this file.
19 package ca.uqac.lif.synthia.vector;
55 @SuppressWarnings(
"unchecked")
68 @SuppressWarnings(
"unchecked")
74 for (
int i = 0; i < dimensions.length; i++)
101 float[] v =
new float[n];
104 v[n - 1] = r * (float) Math.cos(last_theta);
105 for (
int i = n - 2; i > 1; i--)
107 sin_prod *= Math.sin(last_theta);
109 v[i] = r * (float) Math.cos(last_theta);
112 v[0] = r * (float) Math.sin(last_theta) * sin_prod;
124 @SuppressWarnings(
"unchecked")
145 return "HyperspherePicker";
void reset()
Puts the hypersphere picker back into its initial state.
Miscellaneous pickers performing various functions.
float[] pick()
Picks an object.
Picker that returns the same object every time.
Generates n-dimensional vectors with a given modulus.
Interface for pickers that generate arrays of floating-point numbers.
Picker<? extends Number >[] m_dimensions
The pickers for the radius and each polar angle.
HyperspherePicker(Picker<? extends Number > ... dimensions)
Creates a new hypersphere picker.
int getDimension()
Returns the dimension of the picker, i.e.
Picker< T > duplicate(boolean with_state)
Creates a copy of the picker.
HyperspherePicker duplicate(boolean with_state)
Creates a copy of the hypersphere picker.