Ant-file changes, some mathematics refactored.
This commit is contained in:
		@@ -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;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user