45 double(*
f)(
double *
x,
void *),
void *
prm,
46 double ftol,
double &fret,
51 double *auxpptr = pptr + (i0 - 1);
54 std::vector<double>
buffer(n*n);
55 auto *
xi= buffer.data()-1;
56 for (
int i = 1, ptr = 1;
i <=
n;
i++)
57 for (
int j = 1;
j <=
n;
j++, ptr++)
61 powell(auxpptr,
xi -n, n, ftol, iter, fret,
f, prm, show);
71 double inorm=1.0/
sqrt(2*
PI);
102 &rnorm,
nullptr,
nullptr,
nullptr);
104 std::cerr <<
"Warning, too many iterations in nnls\n";
105 else if (success == 2)
136 for (
size_t i = 0;
i < H.
Ydim();
i++)
137 for (
size_t j = 0;
j < x.
size();
j++)
144 for (
size_t j = 0;
j < x.
size();
j++)
176 result = 0.5 * X.
transpose() *
in->C * X +
in->D.transpose() * X;
187 *gj +=
in->A(j - 1,
k) * x[
k];
188 *gj -=
in->B(j - 1, 0);
200 gradient =
in->C * X +
in->D;
202 gradfj[
k] = gradient(
k, 0);
210 gradgj[
k] =
in->A(j - 1,
k);
236 for (
size_t i = 0;
i < A.
Ydim();
i++)
238 for (
size_t j = 0;
j < A.
Xdim();
j++)
239 prm.
A(
i,
j) = A(
i,
j);
244 for (
size_t i = 0;
i < Aeq.
Ydim();
i++)
246 for (
size_t j = 0;
j < Aeq.
Xdim();
j++)
248 prm.
B(
i + A.
Ydim(), 0) = beq(
i);
269 double epsneq = 1e-4;
291 cfsqp(nparam, nf, nfsr, nineqn, nineq, neqn, neq, ncsrl, ncsrn, mesh_pts,
292 mode, iprint, miter, &inform, bigbnd, eps, epsneq, udelta,
304 std::cout <<
"SUCCESSFUL RETURN. \n";
305 if (inform == 1 || inform == 2)
306 std::cout <<
"\nINITIAL GUESS INFEASIBLE.\n";
308 printf(
"\n MAXIMUM NUMBER OF ITERATIONS REACHED.\n");
310 printf(
"\ninform=%d\n", inform);
352 for (
size_t k=0;
k<A.
Ydim();
k++)
353 X(
i,
j) += A(
k,
i) * A(
k,
j);
357 for (
int i=0;
i<Nx;
i++)
362 for (
size_t k=0;
k<G.
Ydim();
k++)
363 X(
i,
j) += G(
k,
i) * G(
k,
j);
369 for (
size_t k=0;
k<A.
Ydim();
k++)
370 Atd(
i) += A(
k,
i) *
d(
k);
383 #define Element(a,b,c) a[b*nDim+c] 384 #define RowVector(a,b) (&a[b*nDim]) 385 #define CopyVector(a,b) memcpy((a),(b),nDim*sizeof(double)) 388 nDim(dim), nPop(popSize),
390 scale(0.7), probability(0.5), bestEnergy(0.0),
391 trialSolution(0), bestSolution(0),
392 popEnergy(0), population(0)
418 int deStrategy,
double diffScale,
double crossoverProb)
428 for (i = 0; i <
nPop; i++)
430 for (j = 0; j <
nDim; j++)
439 for (i = 0; i <
nDim; i++)
490 bool bAtSolution =
false;
493 for (generation = 0;(generation < maxGenerations) && !bAtSolution;generation++)
494 for (
int candidate = 0; candidate <
nPop; candidate++)
518 void DESolver::Best1Exp(
int candidate)
539 void DESolver::Rand1Exp(
int candidate)
561 void DESolver::RandToBest1Exp(
int candidate)
582 void DESolver::Best2Exp(
int candidate)
607 void DESolver::Rand2Exp(
int candidate)
633 void DESolver::Best1Bin(
int candidate)
655 void DESolver::Rand1Bin(
int candidate)
678 void DESolver::RandToBest1Bin(
int candidate)
700 void DESolver::Best2Bin(
int candidate)
726 void DESolver::Rand2Bin(
int candidate)
750 int *
r3,
int *r4,
int *r5)
758 while (*r1 == candidate);
768 while ((*r2 == candidate) || (*r2 == *
r1));
778 while ((*r3 == candidate) || (*r3 == *
r2) || (*r3 == *r1));
788 while ((*r4 == candidate) || (*r4 == *
r3) || (*r4 == *r2) || (*r4 == *
r1));
798 while ((*r5 == candidate) || (*r5 == *r4) || (*r5 == *r3)
799 || (*r5 == *
r2) || (*r5 == *r1));
808 int imax=sequence.size();
815 for (
int i=1;
i<imax; ++
i)
817 if (sequence[
i]!=sequence[
i-1])
819 current=(current+1)%2;
834 double m=1+2*n0*n1/(n0+n1);
835 double s=
sqrt(2*n0*n1*(2*n0*n1-n0-n1)/((n0+n1)*(n0+n1)*(n0+n1-1)));
844 double r2=r*r,xr2=xr*xr,yr2=yr*yr,zr2=zr*zr;
847 double tht=0.0,phi=0.0,costh=0.0,sinth=0.0,costh2=0.0,sinth2=0.0;
851 phi = atan2(zr,
sqrt(xr2 + yr2));
852 sinth = sin(phi); costh = cos(tht);
853 sinth2 = sinth*sinth; costh2 = costh*costh;
903 R = 10.0*r2*r2*r-12.0*r2*r+3.0*r;;
906 R = 5.0*r2*r2*r-4.0*r2*r;
920 Y = (1.0/2.0)*
sqrt(1.0/
PI);
926 Y =
sqrt(3.0/(4.0*
PI))*yr;
929 Y =
sqrt(3.0/(4.0*
PI))*zr;
932 Y =
sqrt(3.0/(4.0*
PI))*xr;
939 Y =
sqrt(15.0/(4.0*
PI))*xr*yr;
942 Y =
sqrt(15.0/(4.0*
PI))*zr*yr;
945 Y =
sqrt(5.0/(16.0*
PI))*(-xr2-yr2+2.0*zr2);
948 Y =
sqrt(15.0/(4.0*
PI))*xr*zr;
951 Y =
sqrt(15.0/(16.0*
PI))*(xr2-yr2);
958 Y =
sqrt(35.0/(16.0*2.0*
PI))*yr*(3.0*xr2-yr2);
961 Y =
sqrt(105.0/(4.0*
PI))*zr*yr*xr;
964 Y =
sqrt(21.0/(16.0*2.0*
PI))*yr*(4.0*zr2-xr2-yr2);
967 Y =
sqrt(7.0/(16.0*
PI))*zr*(2.0*zr2-3.0*xr2-3.0*yr2);
970 Y =
sqrt(21.0/(16.0*2.0*
PI))*xr*(4.0*zr2-xr2-yr2);
973 Y =
sqrt(105.0/(16.0*
PI))*zr*(xr2-yr2);
976 Y =
sqrt(35.0/(16.0*2.0*
PI))*xr*(xr2-3.0*yr2);
983 Y =
sqrt((35.0*9.0)/(16.0*
PI))*yr*xr*(xr2-yr2);
986 Y =
sqrt((9.0*35.0)/(16.0*2.0*
PI))*yr*zr*(3.0*xr2-yr2);
989 Y =
sqrt((9.0*5.0)/(16.0*
PI))*yr*xr*(7.0*zr2-(xr2+yr2+zr2));
992 Y =
sqrt((9.0*5.0)/(16.0*2.0*
PI))*yr*zr*(7.0*zr2-3.0*(xr2+yr2+zr2));
995 Y =
sqrt(9.0/(16.0*16.0*
PI))*(35.0*zr2*zr2-30.0*zr2+3.0);
998 Y =
sqrt((9.0*5.0)/(16.0*2.0*
PI))*xr*zr*(7.0*zr2-3.0*(xr2+yr2+zr2));
1001 Y =
sqrt((9.0*5.0)/(8.0*8.0*
PI))*(xr2-yr2)*(7.0*zr2-(xr2+yr2+zr2));
1004 Y =
sqrt((9.0*35.0)/(16.0*2.0*
PI))*xr*zr*(xr2-3.0*yr2);
1007 Y =
sqrt((9.0*35.0)/(16.0*16.0*
PI))*(xr2*(xr2-3.0*yr2)-yr2*(3.0*xr2-yr2));
1014 Y = (3.0/16.0)*
sqrt(77.0/(2.0*
PI))*sint2*sint2*sinth*sin(5.0*phi);
1017 Y = (3.0/8.0)*
sqrt(385.0/(2.0*
PI))*sint2*sint2*sin(4.0*phi);
1020 Y = (1.0/16.0)*
sqrt(385.0/(2.0*
PI))*sint2*sinth*(9.0*cost2-1.0)*sin(3.0*phi);
1023 Y = (1.0/4.0)*
sqrt(1155.0/(4.0*
PI))*sint2*(3.0*cost2*costh-costh)*sin(2.0*phi);
1026 Y = (1.0/8.0)*
sqrt(165.0/(4.0*
PI))*sinth*(21.0*cost2*cost2-14.0*cost2+1)*sin(phi);
1029 Y = (1.0/16.0)*
sqrt(11.0/
PI)*(63.0*cost2*cost2*costh-70.0*cost2*costh+15.0*costh);
1032 Y = (1.0/8.0)*
sqrt(165.0/(4.0*
PI))*sinth*(21.0*cost2*cost2-14.0*cost2+1)*cos(phi);
1035 Y = (1.0/4.0)*
sqrt(1155.0/(4.0*
PI))*sint2*(3.0*cost2*costh-costh)*cos(2.0*phi);
1038 Y = (1.0/16.0)*
sqrt(385.0/(2.0*
PI))*sint2*sinth*(9.0*cost2-1.0)*cos(3.0*phi);
1041 Y = (3.0/8.0)*
sqrt(385.0/(2.0*
PI))*sint2*sint2*cos(4.0*phi);
1044 Y = (3.0/16.0)*
sqrt(77.0/(2.0*
PI))*sint2*sint2*sinth*cos(5.0*phi);
1053 template<
int L1,
int L2>
1074 phi = atan2(zr,
sqrt(xr2 + yr2));
1075 sinth = sin(
abs(m)*phi); costh = cos(tht); cosph = cos(
abs(m)*phi);
1076 sinth2 = sinth*sinth; costh2 = costh*costh; cosph2 = cosph * cosph;
1104 R = -1.5*r*(3.5*(1-2*
r2)+1.5);
1113 R =
std::sqrt(11.0)*((63.0*r2*r2/8.0)-(35.0*r2/4.0)+(15.0/8.0));
1126 R =
std::sqrt(13.0)*r*((99.0*r2*r2/8.0)-(63.0*r2/4.0)+(35.0/8.0));
1139 R = 103.8 * r2 * r2 * r2 - 167.7 * r2 * r2 + 76.25 * r2 - 8.472;
1142 R = 69.23 * r2 * r2 * r2 - 95.86 * r2 * r2 + 30.5 *
r2;
1145 R = 25.17 * r2 * r2 * r2 - 21.3 * r2 *
r2;
1148 R = 3.873 * r2 * r2 *
r2;
1155 R = 184.3 * r2 * r2 * r2 * r - 331.7 * r2 * r2 * r + 178.6 * r2 * r - 27.06 * r;
1158 R = 100.5 * r2 * r2 * r2 * r - 147.4 * r2 * r2 * r + 51.02 * r2 * r;
1161 R = 30.92 * r2 * r2 * r2 * r - 26.8 * r2 * r2 * r;
1164 R = 4.123 * r2 * r2 * r2 * r;
1171 R = 413.9*r2*r2*r2*r2 - 876.5*r2*r2*r2 + 613.6*r2*r2 - 157.3*r2 + 10.73;
1174 R = 301.0*r2*r2*r2*r2 - 584.4*r2*r2*r2 + 350.6*r2*r2 - 62.93*
r2;
1177 R = 138.9*r2*r2*r2*r2 - 212.5*r2*r2*r2 + 77.92*r2*
r2;
1180 R = 37.05*r2*r2*r2*r2 - 32.69*r2*r2*
r2;
1183 R = 4.359*r2*r2*r2*
r2;
1190 R = 751.6*r2*r2*r2*r2*r - 1741.0*r2*r2*r2*r + 1382.0*r2*r2*r - 430.0*r2*r + 41.35*r;
1193 R = 462.6*r2*r2*r2*r2*r - 949.5*r2*r2*r2*r + 614.4*r2*r2*r - 122.9*r2*r;
1196 R = 185.0*r2*r2*r2*r2*r - 292.1*r2*r2*r2*r + 111.7*r2*r2*r;
1199 R = 43.53*r2*r2*r2*r2*r - 38.95*r2*r2*r2*r;
1202 R = 4.583*r2*r2*r2*r2*r;
1209 R = 1652.0*r2*r2*r2*r2*r2 - 4326.0*r2*r2*r2*r2 + 4099.0*r2*r2*r2 - 1688.0*r2*r2 + 281.3*r2 - 12.98;
1212 R = 1271.0*r2*r2*r2*r2*r2 - 3147.0*r2*r2*r2*r2 + 2732.0*r2*r2*r2 - 964.4*r2*r2 + 112.5*
r2;
1215 R = 677.7*r2*r2*r2*r2*r2 - 1452.0*r2*r2*r2*r2 + 993.6*r2*r2*r2 - 214.3*r2*
r2;
1218 R = 239.2*r2*r2*r2*r2*r2 - 387.3*r2*r2*r2*r2 + 152.9*r2*r2*
r2;
1221 R = 50.36*r2*r2*r2*r2*r2 - 45.56*r2*r2*r2*
r2;
1224 R = 4.796*r2*r2*r2*r2*
r2;
1231 R = r*-5.865234375E+1+(r*r*r)*8.7978515625E+2-(r*r*r*r*r)*4.2732421875E+3+(r*r*r*r*r*r*r)*9.0212890625E+3-(r*r*r*r*r*r*r*r*r)*8.61123046875E+3+pow(r,1.1E+1)*3.04705078125E+3;
1234 R = (r*r*r)*2.513671875E+2-(r*r*r*r*r)*1.89921875E+3+(r*r*r*r*r*r*r)*4.920703125E+3-(r*r*r*r*r*r*r*r*r)*5.29921875E+3+pow(r,1.1E+1)*2.0313671875E+3;
1237 R = (r*r*r*r*r)*-3.453125E+2+(r*r*r*r*r*r*r)*1.5140625E+3-(r*r*r*r*r*r*r*r*r)*2.1196875E+3+pow(r,1.1E+1)*9.559375E+2;
1240 R = (r*r*r*r*r*r*r)*2.01875E+2-(r*r*r*r*r*r*r*r*r)*4.9875E+2+pow(r,1.1E+1)*3.01875E+2;
1243 R = (r*r*r*r*r*r*r*r*r)*-5.25E+1+pow(r,1.1E+1)*5.75E+1;
1246 R = pow(r,1.1E+1)*5.0;
1253 R = (r*r)*-4.57149777110666E+2+(r*r*r*r)*3.885773105442524E+3-(r*r*r*r*r*r)*1.40627979054153E+4+(r*r*r*r*r*r*r*r)*2.460989633446932E+4-pow(r,1.0E+1)*2.05828223888278E+4+pow(r,1.2E+1)*6.597058457955718E+3+1.523832590368693E+1;
1256 R = (r*r)*-1.828599108443595E+2+(r*r*r*r)*2.220441774539649E+3-(r*r*r*r*r*r)*9.375198603600264E+3+(r*r*r*r*r*r*r*r)*1.789810642504692E+4-pow(r,1.0E+1)*1.583294029909372E+4+pow(r,1.2E+1)*5.277646766364574E+3;
1259 R = (r*r*r*r)*4.934315054528415E+2-(r*r*r*r*r*r)*3.409163128584623E+3+(r*r*r*r*r*r*r*r)*8.260664503872395E+3-pow(r,1.0E+1)*8.444234826177359E+3+pow(r,1.2E+1)*3.104498097866774E+3;
1262 R = (r*r*r*r*r*r)*-5.244866351671517E+2+(r*r*r*r*r*r*r*r)*2.202843867704272E+3-pow(r,1.0E+1)*2.98031817394495E+3+pow(r,1.2E+1)*1.307157093837857E+3;
1265 R = (r*r*r*r*r*r*r*r)*2.591581020820886E+2-pow(r,1.0E+1)*6.274354050420225E+2+pow(r,1.2E+1)*3.734734553815797E+2;
1268 R = pow(r,1.0E+1)*-5.975575286115054E+1+pow(r,1.2E+1)*6.49519052838441E+1;
1271 R = pow(r,1.2E+1)*5.19615242270811;
1278 R = r*7.896313435467891E+1-(r*r*r)*1.610847940832376E+3+(r*r*r*r*r)*1.093075388422608E+4-(r*r*r*r*r*r*r)*3.400678986203671E+4+(r*r*r*r*r*r*r*r*r)*5.332882955634594E+4-pow(r,1.1E+1)*4.102217658185959E+4+pow(r,1.3E+1)*1.230665297454596E+4;
1281 R = (r*r*r)*-4.602422688100487E+2+(r*r*r*r*r)*4.858112837433815E+3-(r*r*r*r*r*r*r)*1.854915810656548E+4+(r*r*r*r*r*r*r*r*r)*3.281774126553535E+4-pow(r,1.1E+1)*2.734811772125959E+4+pow(r,1.3E+1)*8.687049158513546E+3;
1284 R = (r*r*r*r*r)*8.832932431697845E+2-(r*r*r*r*r*r*r)*5.707433263555169E+3+(r*r*r*r*r*r*r*r*r)*1.312709650617838E+4-pow(r,1.1E+1)*1.286970245704055E+4+pow(r,1.3E+1)*4.572131136059761E+3;
1287 R = (r*r*r*r*r*r*r)*-7.60991101808846E+2+(r*r*r*r*r*r*r*r*r)*3.088728589691222E+3-pow(r,1.1E+1)*4.064116565383971E+3+pow(r,1.3E+1)*1.741764242306352E+3;
1290 R = (r*r*r*r*r*r*r*r*r)*3.251293252306059E+2-pow(r,1.1E+1)*7.741174410264939E+2+pow(r,1.3E+1)*4.54373280601576E+2;
1293 R = pow(r,1.1E+1)*-6.731456008902751E+1+pow(r,1.3E+1)*7.269972489634529E+1;
1296 R = pow(r,1.3E+1)*5.385164807128604;
1303 R = (r*r)*6.939451623205096E+2-(r*r*r*r)*7.910974850460887E+3+(r*r*r*r*r*r)*3.955487425231934E+4-(r*r*r*r*r*r*r*r)*1.010846786448956E+5+pow(r,1.0E+1)*1.378427436065674E+5-pow(r,1.2E+1)*9.542959172773361E+4+pow(r,1.4E+1)*2.63567443819046E+4-1.749441585683962E+1;
1306 R = (r*r)*2.775780649287626E+2-(r*r*r*r)*4.520557057410479E+3+(r*r*r*r*r*r)*2.636991616821289E+4-(r*r*r*r*r*r*r*r)*7.351612992358208E+4+pow(r,1.0E+1)*1.060328796973228E+5-pow(r,1.2E+1)*7.634367338204384E+4+pow(r,1.4E+1)*2.170555419689417E+4;
1309 R = (r*r*r*r)*-1.004568234980106E+3+(r*r*r*r*r*r)*9.589060424804688E+3-(r*r*r*r*r*r*r*r)*3.393052150321007E+4+pow(r,1.0E+1)*5.655086917197704E+4-pow(r,1.2E+1)*4.490804316592216E+4+pow(r,1.4E+1)*1.370877107170224E+4;
1312 R = (r*r*r*r*r*r)*1.475240065354854E+3-(r*r*r*r*r*r*r*r)*9.04813906750083E+3+pow(r,1.0E+1)*1.99591302959919E+4-pow(r,1.2E+1)*1.8908649754107E+4+pow(r,1.4E+1)*6.527986224621534E+3;
1315 R = (r*r*r*r*r*r*r*r)*-1.064486949119717E+3+pow(r,1.0E+1)*4.201922167569399E+3-pow(r,1.2E+1)*5.402471358314157E+3+pow(r,1.4E+1)*2.270603904217482E+3;
1318 R = pow(r,1.0E+1)*4.001830635787919E+2-pow(r,1.2E+1)*9.395602362267673E+2+pow(r,1.4E+1)*5.44944937011227E+2;
1321 R = pow(r,1.2E+1)*-7.516481889830902E+1+pow(r,1.4E+1)*8.073258326109499E+1;
1324 R = pow(r,1.4E+1)*5.567764362829621;
1331 R = r*-1.022829477079213E+2+(r*r*r)*2.720726409032941E+3-(r*r*r*r*r)*2.448653768128157E+4+(r*r*r*r*r*r*r)*1.042945123462677E+5-(r*r*r*r*r*r*r*r*r)*2.370329826049805E+5+pow(r,1.1E+1)*2.953795629386902E+5-pow(r,1.3E+1)*1.903557183384895E+5+pow(r,1.5E+1)*4.958846444106102E+4;
1334 R = (r*r*r)*7.773504025805742E+2-(r*r*r*r*r)*1.088290563613176E+4+(r*r*r*r*r*r*r)*5.688791582524776E+4-(r*r*r*r*r*r*r*r*r)*1.458664508337975E+5+pow(r,1.1E+1)*1.969197086257935E+5-pow(r,1.3E+1)*1.343687423563004E+5+pow(r,1.5E+1)*3.653886853551865E+4;
1337 R = (r*r*r*r*r)*-1.978710115659982E+3+(r*r*r*r*r*r*r)*1.750397410005331E+4-(r*r*r*r*r*r*r*r*r)*5.834658033359051E+4+pow(r,1.1E+1)*9.266809817695618E+4-pow(r,1.3E+1)*7.072039071393013E+4+pow(r,1.5E+1)*2.08793534488678E+4;
1340 R = (r*r*r*r*r*r*r)*2.333863213345408E+3-(r*r*r*r*r*r*r*r*r)*1.372860713732243E+4+pow(r,1.1E+1)*2.926360995060205E+4-pow(r,1.3E+1)*2.694110122436285E+4+pow(r,1.5E+1)*9.077979760378599E+3;
1343 R = (r*r*r*r*r*r*r*r*r)*-1.445116540770978E+3+pow(r,1.1E+1)*5.57402094297111E+3-pow(r,1.3E+1)*7.028113362878561E+3+pow(r,1.5E+1)*2.90495352332294E+3;
1346 R = pow(r,1.1E+1)*4.846974733015522E+2-pow(r,1.3E+1)*1.124498138058931E+3+pow(r,1.5E+1)*6.455452274046838E+2;
1349 R = pow(r,1.3E+1)*-8.329615837475285E+1+pow(r,1.5E+1)*8.904072102135979E+1;
1352 R = pow(r,1.5E+1)*5.744562646534177;
1364 Y = (1.0/2.0)*
sqrt(1.0/
PI);
1370 Y =
sqrt(3.0/(4.0*
PI))*yr;
1373 Y =
sqrt(3.0/(4.0*
PI))*zr;
1376 Y =
sqrt(3.0/(4.0*
PI))*xr;
1383 Y =
sqrt(15.0/(4.0*
PI))*xr*yr;
1386 Y =
sqrt(15.0/(4.0*
PI))*zr*yr;
1389 Y =
sqrt(5.0/(16.0*
PI))*(-xr2-yr2+2.0*zr2);
1392 Y =
sqrt(15.0/(4.0*
PI))*xr*zr;
1395 Y =
sqrt(15.0/(16.0*
PI))*(xr2-yr2);
1402 Y =
sqrt(35.0/(16.0*2.0*
PI))*yr*(3.0*xr2-yr2);
1405 Y =
sqrt(105.0/(4.0*
PI))*zr*yr*xr;
1408 Y =
sqrt(21.0/(16.0*2.0*
PI))*yr*(4.0*zr2-xr2-yr2);
1411 Y =
sqrt(7.0/(16.0*
PI))*zr*(2.0*zr2-3.0*xr2-3.0*yr2);
1414 Y =
sqrt(21.0/(16.0*2.0*
PI))*xr*(4.0*zr2-xr2-yr2);
1417 Y =
sqrt(105.0/(16.0*
PI))*zr*(xr2-yr2);
1420 Y =
sqrt(35.0/(16.0*2.0*
PI))*xr*(xr2-3.0*yr2);
1427 Y =
sqrt((35.0*9.0)/(16.0*
PI))*yr*xr*(xr2-yr2);
1430 Y =
sqrt((9.0*35.0)/(16.0*2.0*
PI))*yr*zr*(3.0*xr2-yr2);
1433 Y =
sqrt((9.0*5.0)/(16.0*
PI))*yr*xr*(7.0*zr2-(xr2+yr2+zr2));
1436 Y =
sqrt((9.0*5.0)/(16.0*2.0*
PI))*yr*zr*(7.0*zr2-3.0*(xr2+yr2+zr2));
1439 Y =
sqrt(9.0/(16.0*16.0*
PI))*(35.0*zr2*zr2-30.0*zr2+3.0);
1442 Y =
sqrt((9.0*5.0)/(16.0*2.0*
PI))*xr*zr*(7.0*zr2-3.0*(xr2+yr2+zr2));
1445 Y =
sqrt((9.0*5.0)/(8.0*8.0*
PI))*(xr2-yr2)*(7.0*zr2-(xr2+yr2+zr2));
1448 Y =
sqrt((9.0*35.0)/(16.0*2.0*
PI))*xr*zr*(xr2-3.0*yr2);
1451 Y =
sqrt((9.0*35.0)/(16.0*16.0*
PI))*(xr2*(xr2-3.0*yr2)-yr2*(3.0*xr2-yr2));
1458 Y = (3.0/16.0)*
sqrt(77.0/(2.0*
PI))*sinth2*sinth2*sinth*sin(5.0*phi);
1461 Y = (3.0/8.0)*
sqrt(385.0/(2.0*
PI))*sinth2*sinth2*sin(4.0*phi);
1464 Y = (1.0/16.0)*
sqrt(385.0/(2.0*
PI))*sinth2*sinth*(9.0*costh2-1.0)*sin(3.0*phi);
1467 Y = (1.0/4.0)*
sqrt(1155.0/(4.0*
PI))*sinth2*(3.0*costh2*costh-costh)*sin(2.0*phi);
1470 Y = (1.0/8.0)*
sqrt(165.0/(4.0*
PI))*sinth*(21.0*costh2*costh2-14.0*costh2+1)*sin(phi);
1473 Y = (1.0/16.0)*
sqrt(11.0/
PI)*(63.0*costh2*costh2*costh-70.0*costh2*costh+15.0*costh);
1476 Y = (1.0/8.0)*
sqrt(165.0/(4.0*
PI))*sinth*(21.0*costh2*costh2-14.0*costh2+1)*cos(phi);
1479 Y = (1.0/4.0)*
sqrt(1155.0/(4.0*
PI))*sinth2*(3.0*costh2*costh-costh)*cos(2.0*phi);
1482 Y = (1.0/16.0)*
sqrt(385.0/(2.0*
PI))*sinth2*sinth*(9.0*costh2-1.0)*cos(3.0*phi);
1485 Y = (3.0/8.0)*
sqrt(385.0/(2.0*
PI))*sinth2*sinth2*cos(4.0*phi);
1488 Y = (3.0/16.0)*
sqrt(77.0/(2.0*
PI))*sinth2*sinth2*sinth*cos(5.0*phi);
1495 Y = -0.6832*sinth*pow(costh2 - 1.0, 3);
1498 Y = 2.367*costh*sinth*pow(1.0 - 1.0*costh2, 2.5);
1501 Y = 0.001068*sinth*(5198.0*costh2 - 472.5)*pow(costh2 - 1.0, 2);
1504 Y = -0.005849*sinth*pow(1.0 - 1.0*costh2, 1.5)*(- 1732.0*costh2*costh + 472.5*costh);
1507 Y = -0.03509*sinth*(costh2 - 1.0)*(433.1*costh2*costh2 - 236.2*costh2 + 13.12);
1510 Y = 0.222*sinth*pow(1.0 - 1.0*costh2, 0.5)*(86.62*costh2*costh2*costh - 78.75*costh2*costh + 13.12*costh);
1513 Y = 14.68*costh2*costh2*costh2 - 20.02*costh2*costh2 + 6.675*costh2 - 0.3178;
1516 Y = 0.222*cosph*pow(1.0 - 1.0*costh2, 0.5)*(86.62*costh2*costh2*costh - 78.75*costh2*costh + 13.12*costh);
1519 Y = -0.03509*cosph*(costh2 - 1.0)*(433.1*costh2*costh2 - 236.2*costh2 + 13.12);
1522 Y = -0.005849*cosph*pow(1.0 - 1.0*costh2, 1.5)*(-1732.0*costh2*costh + 472.5*costh);
1525 Y = 0.001068*cosph*(5198.0*costh2 - 472.5)*pow(costh2 - 1.0, 2);
1528 Y = 2.367*costh*cosph*pow(1.0 - 1.0*costh2, 2.5);
1531 Y = -0.6832*cosph*pow(costh2 - 1.0, 3);
1538 Y = 0.7072*sinth*pow(1.0 - 1.0*costh2, 3.5);
1541 Y = -2.646*costh*sinth*pow(costh2 - 1.0, 3);
1544 Y = 9.984e-5*sinth*pow(1.0 - 1.0*costh2, 2.5)*(67570.0*costh2 - 5198.0);
1547 Y = -0.000599*sinth*pow(costh2 - 1.0, 2)*(-22520.0*costh2*costh + 5198.0*costh);
1550 Y = 0.003974*sinth*pow(1.0 - 1.0*costh2, 1.5)*(5631.0*costh2*costh2 - 2599.0*costh2 + 118.1);
1553 Y = -0.0281*sinth*(costh2 - 1.0)*(1126.0*costh2*costh2*costh - 866.2*costh2*costh + 118.1*costh);
1556 Y = 0.2065*sinth*pow(1.0 - 1.0*costh2, 0.5)*(187.7*costh2*costh2*costh2 - 216.6*costh2*costh2 + 59.06*costh2 - 2.188);
1559 Y = 29.29*costh2*costh2*costh2*costh - 47.32*costh2*costh2*costh + 21.51*costh2*costh - 2.39*costh;
1562 Y = 0.2065*cosph*pow(1.0 - 1.0*costh2, 0.5)*(187.7*costh2*costh2*costh2 - 216.6*costh2*costh2 + 59.06*costh2 - 2.188);
1565 Y = -0.0281*cosph*(costh2 - 1.0)*(1126.0*costh2*costh2*costh - 866.2*costh2*costh + 118.1*costh);
1568 Y = 0.003974*cosph*pow(1.0 - 1.0*costh2, 1.5)*(5631.0*costh2*costh2 - 2599.0*costh2 + 118.1);
1571 Y = -0.000599*cosph*pow(costh2 - 1.0, 2)*(- 22520.0*costh2*costh + 5198.0*costh);
1574 Y = 9.984e-5*cosph*pow(1.0 - 1.0*costh2, 2.5)*(67570.0*costh2 - 5198.0);
1577 Y = -2.646*cosph*costh*pow(costh2 - 1.0, 3);
1580 Y = 0.7072*cosph*pow(1.0 - 1.0*costh2, 3.5);
1587 Y = sinth*pow(costh2-1.0,4.0)*7.289266601746931E-1;
1590 Y = costh*sinth*pow(costh2*-1.0+1.0,7.0/2.0)*2.915706640698772;
1593 Y = sinth*(costh2*1.0135125E+6-6.75675E+4)*pow(costh2-1.0,3.0)*-7.878532816224526E-6;
1596 Y = sinth*pow(costh2*-1.0+1.0,5.0/2.0)*(costh*6.75675E+4-(costh2*costh)*3.378375E+5)*-5.105872826582925E-56;
1599 Y = sinth*pow(costh2-1.0,2.0)*(costh2*-3.378375E+4+(costh2*costh2)*8.4459375E+4+1.299375E+3)*3.681897256448963E-4;
1602 Y = sinth*pow(costh2*-1.0+1.0,3.0/2.0)*(costh*1.299375E+3-(costh*costh2)*1.126125E+4+(costh*costh2*costh2)*1.6891875E+4)*2.851985351334463E-3;
1605 Y = sinth*(costh2-1.0)*(costh2*6.496875E+2-(costh2*costh2)*2.8153125E+3+(costh2*costh2*costh2)*2.8153125E+3-1.96875E+1)*-2.316963852365461E-2;
1608 Y = sinth*
sqrt(costh2*-1.0+1.0)*(costh*1.96875E+1-(costh*costh2)*2.165625E+2+(costh*costh2*costh2)*5.630625E+2-(costh*costh2*costh2*costh2)*4.021875E+2)*-1.938511038201796E-1;;
1611 Y = costh2*-1.144933081936324E+1+(costh2*costh2)*6.297131950652692E+1-(costh2*costh2*costh2)*1.091502871445846E+2+(costh2*costh2*costh2*costh2)*5.847336811327841E+1+3.180369672045344E-1;
1614 Y = cosph*
sqrt(costh2*-1.0+1.0)*(costh*1.96875E+1-(costh*costh2)*2.165625E+2+(costh*costh2*costh2)*5.630625E+2-(costh*costh2*costh2*costh2)*4.021875E+2)*-1.938511038201796E-1;;
1617 Y = cosph*(costh2-1.0)*(costh2*6.496875E+2-(costh2*costh2)*2.8153125E+3+(costh2*costh2*costh2)*2.8153125E+3-1.96875E+1)*-2.316963852365461E-2;
1620 Y = cosph*pow(costh2*-1.0+1.0,3.0/2.0)*(costh*1.299375E+3-(costh*costh2)*1.126125E+4+(costh*costh2*costh2)*1.6891875E+4)*2.851985351334463E-3;
1623 Y = cosph*pow(costh2-1.0,2.0)*(costh2*-3.378375E+4+(costh2*costh2)*8.4459375E+4+1.299375E+3)*3.681897256448963E-4;
1626 Y = cosph*pow(costh2*-1.0+1.0,5.0/2.0)*(costh*6.75675E+4-(costh*costh2)*3.378375E+5)*-5.105872826582925E-5;
1629 Y = cosph*(costh2*1.0135125E+6-6.75675E+4)*pow(costh2-1.0,3.0)*-7.878532816224526E-6;
1632 Y = cosph*costh*pow(costh2*-1.0+1.0,7.0/2.0)*2.915706640698772;
1635 Y = cosph*pow(costh2-1.0,4.0)*7.289266601746931E-1;
1642 Y = sinth*pow(costh2*-1.0+1.0,9.0/2.0)*7.489009518540115E-1;
1645 Y = costh*sinth*pow(costh2-1.0,4.0)*3.17731764895143;
1648 Y = sinth*pow(costh2*-1.0+1.0,7.0/2.0)*(costh2*1.72297125E+7-1.0135125E+6)*5.376406125665728E-7;
1651 Y = sinth*(costh*1.0135125E+6-(costh*costh2)*5.7432375E+6)*pow(costh2-1.0,3.0)*3.724883428715686E-6;
1654 Y = sinth*pow(costh2*-1.0+1.0,5.0/2.0)*(costh2*-5.0675625E+5+(costh2*costh2)*1.435809375E+6+1.6891875E+4)*2.885282297193648E-5;
1657 Y = sinth*pow(costh2-1.0,2.0)*(costh*1.6891875E+4-(costh*costh2)*1.6891875E+5+(costh*costh2*costh2)*2.87161875E+5)*2.414000363328839E-4;
1660 Y = sinth*pow(costh2*-1.0+1.0,3.0/2.0)*((costh2)*8.4459375E+3-(costh2*costh2)*4.22296875E+4+(costh2*costh2*costh2)*4.78603125E+4-2.165625E+2)*2.131987394015766E-3;
1663 Y = sinth*(costh2-1.0)*(costh*2.165625E+2-(costh*costh2)*2.8153125E+3+(costh*costh2*costh2)*8.4459375E+3-(costh*costh2*costh2*costh2)*6.8371875E+3)*1.953998722751749E-2;
1666 Y = sinth*
sqrt(costh2*-1.0+1.0)*(costh2*-1.0828125E+2+(costh2*costh2)*7.03828125E+2-(costh2*costh2*costh2)*1.40765625E+3+(costh2*costh2*costh2*costh2)*8.546484375E+2+2.4609375)*1.833013280775049E-1;
1669 Y = costh*3.026024588281871-(costh*costh2)*4.438169396144804E+1+(costh*costh2*costh2)*1.730886064497754E+2-(costh*costh2*costh2*costh2)*2.472694377852604E+2+(costh*costh2*costh2*costh2*costh2)*1.167661233986728E+2;
1672 Y = cosph*
sqrt(costh2*-1.0+1.0)*(costh2*-1.0828125E+2+(costh2*costh2)*7.03828125E+2-(costh2*costh2*costh2)*1.40765625E+3+(costh2*costh2*costh2*costh2)*8.546484375E+2+2.4609375)*1.833013280775049E-1;
1675 Y = cosph*(costh2-1.0)*(costh*2.165625E+2-(costh*costh2)*2.8153125E+3+(costh*costh2*costh2)*8.4459375E+3-(costh*costh2*costh2*costh2)*6.8371875E+3)*1.953998722751749E-2;
1678 Y = cosph*pow(costh2*-1.0+1.0,3.0/2.0)*(costh2*8.4459375E+3-(costh2*costh2)*4.22296875E+4+(costh2*costh2*costh2)*4.78603125E+4-2.165625E+2)*2.131987394015766E-3;
1681 Y = cosph*pow(costh2-1.0,2.0)*(costh*1.6891875E+4-(costh*costh2)*1.6891875E+5+(costh*costh2*costh2)*2.87161875E+5)*2.414000363328839E-4;
1684 Y = cosph*pow(costh2*-1.0+1.0,5.0/2.0)*(costh2*-5.0675625E+5+(costh2*costh2)*1.435809375E+6+1.6891875E+4)*2.885282297193648E-5;
1687 Y = cosph*(costh*1.0135125E+6-(costh*costh2)*5.7432375E+6)*pow(costh2-1.0,3.0)*3.724883428715686E-6;
1690 Y = cosph*pow(costh2*-1.0+1.0,7.0/2.0)*(costh2*1.72297125E+7-1.0135125E+6)*5.376406125665728E-7;
1693 Y = cosph*costh*pow(costh2-1.0,4.0)*3.17731764895143;
1696 Y = cosph*pow(costh2*-1.0+1.0,9.0/2.0)*7.489009518540115E-1;
1709 case 0:
return ZernikeSphericalHarmonics<0, 0>(
n,
m, xr, yr, zr, r);
1710 case 1:
return ZernikeSphericalHarmonics<0, 1>(
n,
m, xr, yr, zr, r);
1711 case 2:
return ZernikeSphericalHarmonics<0, 2>(
n,
m, xr, yr, zr, r);
1712 case 3:
return ZernikeSphericalHarmonics<0, 3>(
n,
m, xr, yr, zr, r);
1713 case 4:
return ZernikeSphericalHarmonics<0, 4>(
n,
m, xr, yr, zr, r);
1714 case 5:
return ZernikeSphericalHarmonics<0, 5>(
n,
m, xr, yr, zr, r);
1715 case 6:
return ZernikeSphericalHarmonics<0, 6>(
n,
m, xr, yr, zr, r);
1716 case 7:
return ZernikeSphericalHarmonics<0, 7>(
n,
m, xr, yr, zr, r);
1717 case 8:
return ZernikeSphericalHarmonics<0, 8>(
n,
m, xr, yr, zr, r);
1718 case 9:
return ZernikeSphericalHarmonics<0, 9>(
n,
m, xr, yr, zr, r);
1724 case 0:
return ZernikeSphericalHarmonics<1, 0>(
n,
m, xr, yr, zr, r);
1725 case 1:
return ZernikeSphericalHarmonics<1, 1>(
n,
m, xr, yr, zr, r);
1726 case 2:
return ZernikeSphericalHarmonics<1, 2>(
n,
m, xr, yr, zr, r);
1727 case 3:
return ZernikeSphericalHarmonics<1, 3>(
n,
m, xr, yr, zr, r);
1728 case 4:
return ZernikeSphericalHarmonics<1, 4>(
n,
m, xr, yr, zr, r);
1729 case 5:
return ZernikeSphericalHarmonics<1, 5>(
n,
m, xr, yr, zr, r);
1730 case 6:
return ZernikeSphericalHarmonics<1, 6>(
n,
m, xr, yr, zr, r);
1731 case 7:
return ZernikeSphericalHarmonics<1, 7>(
n,
m, xr, yr, zr, r);
1732 case 8:
return ZernikeSphericalHarmonics<1, 8>(
n,
m, xr, yr, zr, r);
1733 case 9:
return ZernikeSphericalHarmonics<1, 9>(
n,
m, xr, yr, zr, r);
1739 case 0:
return ZernikeSphericalHarmonics<2, 0>(
n,
m, xr, yr, zr, r);
1740 case 1:
return ZernikeSphericalHarmonics<2, 1>(
n,
m, xr, yr, zr, r);
1741 case 2:
return ZernikeSphericalHarmonics<2, 2>(
n,
m, xr, yr, zr, r);
1742 case 3:
return ZernikeSphericalHarmonics<2, 3>(
n,
m, xr, yr, zr, r);
1743 case 4:
return ZernikeSphericalHarmonics<2, 4>(
n,
m, xr, yr, zr, r);
1744 case 5:
return ZernikeSphericalHarmonics<2, 5>(
n,
m, xr, yr, zr, r);
1745 case 6:
return ZernikeSphericalHarmonics<2, 6>(
n,
m, xr, yr, zr, r);
1746 case 7:
return ZernikeSphericalHarmonics<2, 7>(
n,
m, xr, yr, zr, r);
1747 case 8:
return ZernikeSphericalHarmonics<2, 8>(
n,
m, xr, yr, zr, r);
1748 case 9:
return ZernikeSphericalHarmonics<2, 9>(
n,
m, xr, yr, zr, r);
1754 case 0:
return ZernikeSphericalHarmonics<3, 0>(
n,
m, xr, yr, zr, r);
1755 case 1:
return ZernikeSphericalHarmonics<3, 1>(
n,
m, xr, yr, zr, r);
1756 case 2:
return ZernikeSphericalHarmonics<3, 2>(
n,
m, xr, yr, zr, r);
1757 case 3:
return ZernikeSphericalHarmonics<3, 3>(
n,
m, xr, yr, zr, r);
1758 case 4:
return ZernikeSphericalHarmonics<3, 4>(
n,
m, xr, yr, zr, r);
1759 case 5:
return ZernikeSphericalHarmonics<3, 5>(
n,
m, xr, yr, zr, r);
1760 case 6:
return ZernikeSphericalHarmonics<3, 6>(
n,
m, xr, yr, zr, r);
1761 case 7:
return ZernikeSphericalHarmonics<3, 7>(
n,
m, xr, yr, zr, r);
1762 case 8:
return ZernikeSphericalHarmonics<3, 8>(
n,
m, xr, yr, zr, r);
1763 case 9:
return ZernikeSphericalHarmonics<3, 9>(
n,
m, xr, yr, zr, r);
1769 case 0:
return ZernikeSphericalHarmonics<4, 0>(
n,
m, xr, yr, zr, r);
1770 case 1:
return ZernikeSphericalHarmonics<4, 1>(
n,
m, xr, yr, zr, r);
1771 case 2:
return ZernikeSphericalHarmonics<4, 2>(
n,
m, xr, yr, zr, r);
1772 case 3:
return ZernikeSphericalHarmonics<4, 3>(
n,
m, xr, yr, zr, r);
1773 case 4:
return ZernikeSphericalHarmonics<4, 4>(
n,
m, xr, yr, zr, r);
1774 case 5:
return ZernikeSphericalHarmonics<4, 5>(
n,
m, xr, yr, zr, r);
1775 case 6:
return ZernikeSphericalHarmonics<4, 6>(
n,
m, xr, yr, zr, r);
1776 case 7:
return ZernikeSphericalHarmonics<4, 7>(
n,
m, xr, yr, zr, r);
1777 case 8:
return ZernikeSphericalHarmonics<4, 8>(
n,
m, xr, yr, zr, r);
1778 case 9:
return ZernikeSphericalHarmonics<4, 9>(
n,
m, xr, yr, zr, r);
1784 case 0:
return ZernikeSphericalHarmonics<5, 0>(
n,
m, xr, yr, zr, r);
1785 case 1:
return ZernikeSphericalHarmonics<5, 1>(
n,
m, xr, yr, zr, r);
1786 case 2:
return ZernikeSphericalHarmonics<5, 2>(
n,
m, xr, yr, zr, r);
1787 case 3:
return ZernikeSphericalHarmonics<5, 3>(
n,
m, xr, yr, zr, r);
1788 case 4:
return ZernikeSphericalHarmonics<5, 4>(
n,
m, xr, yr, zr, r);
1789 case 5:
return ZernikeSphericalHarmonics<5, 5>(
n,
m, xr, yr, zr, r);
1790 case 6:
return ZernikeSphericalHarmonics<5, 6>(
n,
m, xr, yr, zr, r);
1791 case 7:
return ZernikeSphericalHarmonics<5, 7>(
n,
m, xr, yr, zr, r);
1792 case 8:
return ZernikeSphericalHarmonics<5, 8>(
n,
m, xr, yr, zr, r);
1793 case 9:
return ZernikeSphericalHarmonics<5, 9>(
n,
m, xr, yr, zr, r);
1799 case 0:
return ZernikeSphericalHarmonics<6, 0>(
n,
m, xr, yr, zr, r);
1800 case 1:
return ZernikeSphericalHarmonics<6, 1>(
n,
m, xr, yr, zr, r);
1801 case 2:
return ZernikeSphericalHarmonics<6, 2>(
n,
m, xr, yr, zr, r);
1802 case 3:
return ZernikeSphericalHarmonics<6, 3>(
n,
m, xr, yr, zr, r);
1803 case 4:
return ZernikeSphericalHarmonics<6, 4>(
n,
m, xr, yr, zr, r);
1804 case 5:
return ZernikeSphericalHarmonics<6, 5>(
n,
m, xr, yr, zr, r);
1805 case 6:
return ZernikeSphericalHarmonics<6, 6>(
n,
m, xr, yr, zr, r);
1806 case 7:
return ZernikeSphericalHarmonics<6, 7>(
n,
m, xr, yr, zr, r);
1807 case 8:
return ZernikeSphericalHarmonics<6, 8>(
n,
m, xr, yr, zr, r);
1808 case 9:
return ZernikeSphericalHarmonics<6, 9>(
n,
m, xr, yr, zr, r);
1814 case 0:
return ZernikeSphericalHarmonics<7, 0>(
n,
m, xr, yr, zr, r);
1815 case 1:
return ZernikeSphericalHarmonics<7, 1>(
n,
m, xr, yr, zr, r);
1816 case 2:
return ZernikeSphericalHarmonics<7, 2>(
n,
m, xr, yr, zr, r);
1817 case 3:
return ZernikeSphericalHarmonics<7, 3>(
n,
m, xr, yr, zr, r);
1818 case 4:
return ZernikeSphericalHarmonics<7, 4>(
n,
m, xr, yr, zr, r);
1819 case 5:
return ZernikeSphericalHarmonics<7, 5>(
n,
m, xr, yr, zr, r);
1820 case 6:
return ZernikeSphericalHarmonics<7, 6>(
n,
m, xr, yr, zr, r);
1821 case 7:
return ZernikeSphericalHarmonics<7, 7>(
n,
m, xr, yr, zr, r);
1822 case 8:
return ZernikeSphericalHarmonics<7, 8>(
n,
m, xr, yr, zr, r);
1823 case 9:
return ZernikeSphericalHarmonics<7, 9>(
n,
m, xr, yr, zr, r);
1829 case 0:
return ZernikeSphericalHarmonics<8, 0>(
n,
m, xr, yr, zr, r);
1830 case 1:
return ZernikeSphericalHarmonics<8, 1>(
n,
m, xr, yr, zr, r);
1831 case 2:
return ZernikeSphericalHarmonics<8, 2>(
n,
m, xr, yr, zr, r);
1832 case 3:
return ZernikeSphericalHarmonics<8, 3>(
n,
m, xr, yr, zr, r);
1833 case 4:
return ZernikeSphericalHarmonics<8, 4>(
n,
m, xr, yr, zr, r);
1834 case 5:
return ZernikeSphericalHarmonics<8, 5>(
n,
m, xr, yr, zr, r);
1835 case 6:
return ZernikeSphericalHarmonics<8, 6>(
n,
m, xr, yr, zr, r);
1836 case 7:
return ZernikeSphericalHarmonics<8, 7>(
n,
m, xr, yr, zr, r);
1837 case 8:
return ZernikeSphericalHarmonics<8, 8>(
n,
m, xr, yr, zr, r);
1838 case 9:
return ZernikeSphericalHarmonics<8, 9>(
n,
m, xr, yr, zr, r);
1844 case 0:
return ZernikeSphericalHarmonics<9, 0>(
n,
m, xr, yr, zr, r);
1845 case 1:
return ZernikeSphericalHarmonics<9, 1>(
n,
m, xr, yr, zr, r);
1846 case 2:
return ZernikeSphericalHarmonics<9, 2>(
n,
m, xr, yr, zr, r);
1847 case 3:
return ZernikeSphericalHarmonics<9, 3>(
n,
m, xr, yr, zr, r);
1848 case 4:
return ZernikeSphericalHarmonics<9, 4>(
n,
m, xr, yr, zr, r);
1849 case 5:
return ZernikeSphericalHarmonics<9, 5>(
n,
m, xr, yr, zr, r);
1850 case 6:
return ZernikeSphericalHarmonics<9, 6>(
n,
m, xr, yr, zr, r);
1851 case 7:
return ZernikeSphericalHarmonics<9, 7>(
n,
m, xr, yr, zr, r);
1852 case 8:
return ZernikeSphericalHarmonics<9, 8>(
n,
m, xr, yr, zr, r);
1853 case 9:
return ZernikeSphericalHarmonics<9, 9>(
n,
m, xr, yr, zr, r);
1859 case 0:
return ZernikeSphericalHarmonics<10, 0>(
n,
m, xr, yr, zr, r);
1860 case 1:
return ZernikeSphericalHarmonics<10, 1>(
n,
m, xr, yr, zr, r);
1861 case 2:
return ZernikeSphericalHarmonics<10, 2>(
n,
m, xr, yr, zr, r);
1862 case 3:
return ZernikeSphericalHarmonics<10, 3>(
n,
m, xr, yr, zr, r);
1863 case 4:
return ZernikeSphericalHarmonics<10, 4>(
n,
m, xr, yr, zr, r);
1864 case 5:
return ZernikeSphericalHarmonics<10, 5>(
n,
m, xr, yr, zr, r);
1865 case 6:
return ZernikeSphericalHarmonics<10, 6>(
n,
m, xr, yr, zr, r);
1866 case 7:
return ZernikeSphericalHarmonics<10, 7>(
n,
m, xr, yr, zr, r);
1867 case 8:
return ZernikeSphericalHarmonics<10, 8>(
n,
m, xr, yr, zr, r);
1868 case 9:
return ZernikeSphericalHarmonics<10, 9>(
n,
m, xr, yr, zr, r);
1874 case 0:
return ZernikeSphericalHarmonics<11, 0>(
n,
m, xr, yr, zr, r);
1875 case 1:
return ZernikeSphericalHarmonics<11, 1>(
n,
m, xr, yr, zr, r);
1876 case 2:
return ZernikeSphericalHarmonics<11, 2>(
n,
m, xr, yr, zr, r);
1877 case 3:
return ZernikeSphericalHarmonics<11, 3>(
n,
m, xr, yr, zr, r);
1878 case 4:
return ZernikeSphericalHarmonics<11, 4>(
n,
m, xr, yr, zr, r);
1879 case 5:
return ZernikeSphericalHarmonics<11, 5>(
n,
m, xr, yr, zr, r);
1880 case 6:
return ZernikeSphericalHarmonics<11, 6>(
n,
m, xr, yr, zr, r);
1881 case 7:
return ZernikeSphericalHarmonics<11, 7>(
n,
m, xr, yr, zr, r);
1882 case 8:
return ZernikeSphericalHarmonics<11, 8>(
n,
m, xr, yr, zr, r);
1883 case 9:
return ZernikeSphericalHarmonics<11, 9>(
n,
m, xr, yr, zr, r);
1889 case 0:
return ZernikeSphericalHarmonics<12, 0>(
n,
m, xr, yr, zr, r);
1890 case 1:
return ZernikeSphericalHarmonics<12, 1>(
n,
m, xr, yr, zr, r);
1891 case 2:
return ZernikeSphericalHarmonics<12, 2>(
n,
m, xr, yr, zr, r);
1892 case 3:
return ZernikeSphericalHarmonics<12, 3>(
n,
m, xr, yr, zr, r);
1893 case 4:
return ZernikeSphericalHarmonics<12, 4>(
n,
m, xr, yr, zr, r);
1894 case 5:
return ZernikeSphericalHarmonics<12, 5>(
n,
m, xr, yr, zr, r);
1895 case 6:
return ZernikeSphericalHarmonics<12, 6>(
n,
m, xr, yr, zr, r);
1896 case 7:
return ZernikeSphericalHarmonics<12, 7>(
n,
m, xr, yr, zr, r);
1897 case 8:
return ZernikeSphericalHarmonics<12, 8>(
n,
m, xr, yr, zr, r);
1898 case 9:
return ZernikeSphericalHarmonics<12, 9>(
n,
m, xr, yr, zr, r);
1904 case 0:
return ZernikeSphericalHarmonics<13, 0>(
n,
m, xr, yr, zr, r);
1905 case 1:
return ZernikeSphericalHarmonics<13, 1>(
n,
m, xr, yr, zr, r);
1906 case 2:
return ZernikeSphericalHarmonics<13, 2>(
n,
m, xr, yr, zr, r);
1907 case 3:
return ZernikeSphericalHarmonics<13, 3>(
n,
m, xr, yr, zr, r);
1908 case 4:
return ZernikeSphericalHarmonics<13, 4>(
n,
m, xr, yr, zr, r);
1909 case 5:
return ZernikeSphericalHarmonics<13, 5>(
n,
m, xr, yr, zr, r);
1910 case 6:
return ZernikeSphericalHarmonics<13, 6>(
n,
m, xr, yr, zr, r);
1911 case 7:
return ZernikeSphericalHarmonics<13, 7>(
n,
m, xr, yr, zr, r);
1912 case 8:
return ZernikeSphericalHarmonics<13, 8>(
n,
m, xr, yr, zr, r);
1913 case 9:
return ZernikeSphericalHarmonics<13, 9>(
n,
m, xr, yr, zr, r);
1919 case 0:
return ZernikeSphericalHarmonics<14, 0>(
n,
m, xr, yr, zr, r);
1920 case 1:
return ZernikeSphericalHarmonics<14, 1>(
n,
m, xr, yr, zr, r);
1921 case 2:
return ZernikeSphericalHarmonics<14, 2>(
n,
m, xr, yr, zr, r);
1922 case 3:
return ZernikeSphericalHarmonics<14, 3>(
n,
m, xr, yr, zr, r);
1923 case 4:
return ZernikeSphericalHarmonics<14, 4>(
n,
m, xr, yr, zr, r);
1924 case 5:
return ZernikeSphericalHarmonics<14, 5>(
n,
m, xr, yr, zr, r);
1925 case 6:
return ZernikeSphericalHarmonics<14, 6>(
n,
m, xr, yr, zr, r);
1926 case 7:
return ZernikeSphericalHarmonics<14, 7>(
n,
m, xr, yr, zr, r);
1927 case 8:
return ZernikeSphericalHarmonics<14, 8>(
n,
m, xr, yr, zr, r);
1928 case 9:
return ZernikeSphericalHarmonics<14, 9>(
n,
m, xr, yr, zr, r);
1934 case 0:
return ZernikeSphericalHarmonics<15, 0>(
n,
m, xr, yr, zr, r);
1935 case 1:
return ZernikeSphericalHarmonics<15, 1>(
n,
m, xr, yr, zr, r);
1936 case 2:
return ZernikeSphericalHarmonics<15, 2>(
n,
m, xr, yr, zr, r);
1937 case 3:
return ZernikeSphericalHarmonics<15, 3>(
n,
m, xr, yr, zr, r);
1938 case 4:
return ZernikeSphericalHarmonics<15, 4>(
n,
m, xr, yr, zr, r);
1939 case 5:
return ZernikeSphericalHarmonics<15, 5>(
n,
m, xr, yr, zr, r);
1940 case 6:
return ZernikeSphericalHarmonics<15, 6>(
n,
m, xr, yr, zr, r);
1941 case 7:
return ZernikeSphericalHarmonics<15, 7>(
n,
m, xr, yr, zr, r);
1942 case 8:
return ZernikeSphericalHarmonics<15, 8>(
n,
m, xr, yr, zr, r);
1943 case 9:
return ZernikeSphericalHarmonics<15, 9>(
n,
m, xr, yr, zr, r);
1953 double ALegendreSphericalHarmonics(
int l,
int m,
double xr,
double yr,
double zr,
double r)
1956 double rp=2.0*r-1.0;
1957 double rp2=rp*rp,xr2=xr*xr,yr2=yr*yr,zr2=zr*zr;
1958 double pol=
sqrt(1.0-rp2);
1959 double pol2=pol*pol;
1986 R=(1.0/(2.0*24.0))*3.0*pol2;
1989 R=(1.0/12.0)*rp*pol;
1992 R=(1.0/4.0)*(3*rp2-1.0);
2004 R=(1.0/(2.0*720.0))*15.0*pol2*pol;
2007 R=(1.0/240.0)*15.0*rp*pol2;
2010 R=(1.0/24.0)*(3.0/2.0)*(5.0*rp2-1.0)*pol;
2013 R=(1.0/4.0)*(5.0*rp2*rp-3.0*rp);
2016 R=-(3.0/4.0)*(5.0*rp2-1.0)*pol;
2019 R=(15.0/2.0)*rp*pol2;
2029 R=(1.0/(2.0*40320.0))*105.0*pol2*pol2;
2032 R=(1.0/(5040.0*2.0))*105.0*rp*pol2*pol;
2035 R=(1.0/(2.0*360.0))*(15.0/2.0)*(7.0*rp2-1.0)*pol2;
2038 R=(1.0/40.0)*(5.0/2.0)*(7.0*rp2*rp-3.0*rp)*pol;
2041 R=(1.0/16.0)*(35.0*rp2*rp2-30.0*rp2+3.0);
2044 R=-(5.0/4.0)*(7.0*rp2*rp-3*rp)*pol;
2047 R=(15.0/4.0)*(7.0*rp2-1)*pol2;
2050 R=-(105.0/2.0)*rp*pol2*pol;
2053 R=(105.0/2.0)*pol2*pol2;
2063 Y = (1.0/2.0)*
sqrt(1.0/
PI);
2069 Y =
sqrt(3.0/(4.0*
PI))*yr;
2072 Y =
sqrt(3.0/(4.0*
PI))*zr;
2075 Y =
sqrt(3.0/(4.0*
PI))*xr;
2082 Y =
sqrt(15.0/(4.0*
PI))*xr*yr;
2085 Y =
sqrt(15.0/(4.0*
PI))*zr*yr;
2088 Y =
sqrt(5.0/(16.0*
PI))*(-xr2-yr2+2.0*zr2);
2091 Y =
sqrt(15.0/(4.0*
PI))*xr*zr;
2094 Y =
sqrt(15.0/(16.0*
PI))*(xr2-yr2);
2101 Y =
sqrt(35.0/(16.0*2.0*
PI))*yr*(3.0*xr2-yr2);
2104 Y =
sqrt(105.0/(4.0*
PI))*zr*yr*xr;
2107 Y =
sqrt(21.0/(16.0*2.0*
PI))*yr*(4.0*zr2-xr2-yr2);
2110 Y =
sqrt(7.0/(16.0*
PI))*zr*(2.0*zr2-3.0*xr2-3.0*yr2);
2113 Y =
sqrt(21.0/(16.0*2.0*
PI))*xr*(4.0*zr2-xr2-yr2);
2116 Y =
sqrt(105.0/(16.0*
PI))*zr*(xr2-yr2);
2119 Y =
sqrt(35.0/(16.0*2.0*
PI))*xr*(xr2-3.0*yr2);
2126 Y =
sqrt((35.0*9.0)/(16.0*
PI))*yr*xr*(xr2-yr2);
2129 Y =
sqrt((9.0*35.0)/(16.0*2.0*
PI))*yr*zr*(3.0*xr2-yr2);
2132 Y =
sqrt((9.0*5.0)/(16.0*
PI))*yr*xr*(7.0*zr2-(xr2+yr2+zr2));
2135 Y =
sqrt((9.0*5.0)/(16.0*2.0*
PI))*yr*zr*(7.0*zr2-3.0*(xr2+yr2+zr2));
2138 Y =
sqrt(9.0/(16.0*16.0*
PI))*(35.0*zr2*zr2-30.0*zr2+3.0);
2141 Y =
sqrt((9.0*5.0)/(16.0*2.0*
PI))*xr*zr*(7.0*zr2-3.0*(xr2+yr2+zr2));
2144 Y =
sqrt((9.0*5.0)/(8.0*8.0*
PI))*(xr2-yr2)*(7.0*zr2-(xr2+yr2+zr2));
2147 Y =
sqrt((9.0*35.0)/(16.0*2.0*
PI))*xr*zr*(xr2-3.0*yr2);
2150 Y =
sqrt((9.0*35.0)/(16.0*16.0*
PI))*(xr2*(xr2-3.0*yr2)-yr2*(3.0*xr2-yr2));
2161 auto numR =
static_cast<int>(
std::floor((4+4*max_l1+std::pow(max_l1,2))/4));
2162 double aux_id =
std::floor(idx-(idx/numR)*numR);
2164 n =
static_cast<int>(std::ceil((4.0*aux_id - l1*(l1+2.0))/2.0));
2166 m =
static_cast<int>(
std::floor(idx/numR)-l2*(l2+1));
2171 auto numR =
static_cast<int>(
std::floor((4+4*max_l1+std::pow(max_l1,2))/4));
2172 int id_SH = l2*(l2+1)+m;
2173 auto id_R =
static_cast<int>(
std::floor((2*n + l1*(l1 + 2))/4));
2174 int id_Z = id_SH*numR+id_R;
2178 template<
typename T>
2204 for (
int i = 0;
i < w.
size();
i++)
2205 if (
w(
i) < tolerance)
2214 svbksb(u, w, v, bd, result);
2217 template<
typename T>
2238 template void solve<double>(Matrix2D<double>
const&, Matrix2D<double>
const&, Matrix2D<double>&);
#define FOR_ALL_ELEMENTS_IN_MATRIX2D(m)
void cholsl(double *a, int n, double *p, double *b, double *x)
void min(Image< double > &op1, const Image< double > &op2)
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
__host__ __device__ float2 floor(const float2 v)
#define REPORT_ERROR(nerr, ErrormMsg)
virtual ~DESolver(void)
Destructor.
void fromVector(const Matrix1D< T > &op1)
Problem with matrix size.
void initRandom(double op1, double op2, RandomMode mode=RND_UNIFORM)
void sqrt(Image< double > &op)
There is not enough memory for allocation.
void choldc(double *a, int n, double *p)
void toVector(Matrix1D< T > &op1) const
void inv(Matrix2D< T > &result) const
void abs(Image< double > &op)
Matrix2D< T > transpose() const
virtual bool Solve(int maxGenerations)
T * adaptForNumericalRecipes2() const
StrategyFunction calcTrialSolution
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
void gaussj(T *a, int n, T *b, int m)
virtual double EnergyFunction(double testSolution[], bool &bAtSolution)=0
#define FOR_ALL_ELEMENTS_IN_MATRIX1D(v)
void cfsqp(nparam, nf, nfsr, nineqn, nineq, neqn, neq, ncsrl, ncsrn, mesh_pts, mode, iprint, miter, inform, bigbnd, eps, epseqn, udelta, bl, bu, x, f, g, lambda, obj, constr, gradob, gradcn, cd) int nparam
Problem with matrix dimensions.
Incorrect argument received.
DESolver(int dim, int popSize)
Empty constructor.
void resize(size_t Xdim, bool copy=true)
quaternion_type< T > normalize(quaternion_type< T > q)
void max(Image< double > &op1, const Image< double > &op2)
void powell(double *p, double *xi, int n, double ftol, int &iter, double &fret, double(*func)(double *, void *), void *prm, bool show)
void Setup(double min[], double max[], int deStrategy, double diffScale, double crossoverProb)
Setup() must be called before solve to set min, max, strategy etc.
void matrixOperation_Ax(const Matrix2D< double > &A, const Matrix1D< double > &x, Matrix1D< double > &y)
void svdcmp(const Matrix2D< T > &a, Matrix2D< double > &u, Matrix1D< double > &w, Matrix2D< double > &v)
#define FOR_ALL_ELEMENTS_IN_ARRAY1D(v)
#define MATRIX1D_ARRAY(v)
int nnls(double *a, int m, int n, double *b, double *x, double *rnorm, double *wp, double *zzp, int *indexp)
void typeCast(const Matrix1D< T1 > &v1, Matrix1D< T2 > &v2)
void initialize(double xmax, int N, bool normalize=true)
void SelectSamples(int candidate, int *r1, int *r2=nullptr, int *r3=nullptr, int *r4=nullptr, int *r5=nullptr)
std::string to_string(bond_type bondType)
void initZeros(const MultidimArray< T1 > &op)
unsigned int randomize_random_generator()
T * adaptForNumericalRecipes() const
#define MATRIX2D_ARRAY(m)
void indexSort(MultidimArray< int > &indx) const
void svbksb(Matrix2D< double > &u, Matrix1D< double > &w, Matrix2D< double > &v, Matrix1D< double > &b, Matrix1D< double > &x)