using System; using System.Diagnostics; using static System.Console; using static System.Math; public class normal_random{ public Random rnd; public normal_random(int seed=1){ rnd=new Random(seed); } public double next(double mean=0,double sigma=1){ double sum=0; for(int i=0;i<12;i++)sum+=rnd.NextDouble(); return mean+(sum-6)*sigma; } } public static class bbpso{ public static vector randomvec(vector a,vector b,Random rnd){ var x=new vector(a.size); for(int i=0;if,vector a,vector b,int seconds=1) { int dim=a.size, N=8*dim; vector[] x=new vector[N], p=new vector[N]; var fp=new double[N]; Random rnd=new Random(); var g=(a+b)/2; double fg=f(g); for(int i=0;i