Ant-file changes, some mathematics refactored.

This commit is contained in:
Marcel Kronfeld
2008-04-18 07:55:18 +00:00
parent b72d2a86b4
commit fdbfa5fe85
6 changed files with 320 additions and 325 deletions

View File

@@ -2,6 +2,8 @@ package wsi.ra.math;
import java.util.Random;
import eva2.tools.Mathematics;
public class RNG extends Random {
private static Random random;
private static long randomSeed;
@@ -264,5 +266,20 @@ public class RNG extends Random {
v[i] += gaussianDouble(dev);
}
}
/**
* Create a random vector with gaussian random double entries.
*
* @param n
* @return
*/
public static double[] gaussianVector(int n, double dev) {
double[] result = new double[n];
for (int i = 0; i < result.length; i++) {
result[i] = RNG.gaussianDouble(dev);
}
Mathematics.normalizeVector(result);
return result;
}
}