private static void NormalizeAfterHankelForE(ScalarPlanItem item, InnerResult r) { const double pi2 = 2 * System.Math.PI; for (int i = 0; i < r.I1.Length; i++) { r.I1[i] = -r.I1[i] / (pi2 * item.Rho[i]); } for (int i = 0; i < r.I2.Length; i++) { r.I2[i] = r.I2[i] / (pi2 * item.Rho[i]); } for (int i = 0; i < r.I3.Length; i++) { r.I3[i] = r.I3[i] / (pi2 * item.Rho[i]); } for (int i = 0; i < r.I4.Length; i++) { r.I4[i] = r.I4[i] / (pi2 * item.Rho[i]); } for (int i = 0; i < r.I5.Length; i++) { r.I5[i] = r.I5[i] / (pi2 * item.Rho[i]); } }
public static void CalculateZeroRhoForE(InnerResult target, double rhoStep) { var rho = target.Rho.ToList(); var i1 = target.I1.ToList(); var i2 = target.I2.ToList(); var i3 = target.I3.ToList(); var i4 = target.I4.ToList(); var i5 = target.I5.ToList(); var alphaPow2 = rhoStep * rhoStep; Func <List <Complex>, Complex> interpolate = (f) => (f[1] * alphaPow2 - f[2]) / (alphaPow2 - 1); rho.Insert(0, 0); i1.Insert(0, 0); i2.Insert(0, 0); i3.Insert(0, interpolate(i3)); i4.Insert(0, interpolate(i4)); i5.Insert(0, 0); target.Rho = rho.ToArray(); target.I1 = i1.ToArray(); target.I2 = i2.ToArray(); target.I3 = i3.ToArray(); target.I4 = i4.ToArray(); target.I5 = i5.ToArray(); }
private static void CopyScalarResultValues(int srcIndex, int dstIndex, InnerResult src, SingleGreenScalar dst) { if (src.I1.Length != 0) { dst.I1[dstIndex] = src.I1[srcIndex]; } if (src.I2.Length != 0) { dst.I2[dstIndex] = src.I2[srcIndex]; } if (src.I3.Length != 0) { dst.I3[dstIndex] = src.I3[srcIndex]; } if (src.I4.Length != 0) { dst.I4[dstIndex] = src.I4[srcIndex]; } if (src.I5.Length != 0) { dst.I5[dstIndex] = src.I5[srcIndex]; } }