MCPcopy Create free account
hub / github.com/NanoComp/meep / Jmax

Function Jmax

src/initialize.cpp:64–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62#endif
63}
64static double Jmax(int m, int n) {
65 double rlow, rhigh = Jroot(m, n), rtry;
66 if (n == 0)
67 rlow = 0;
68 else
69 rlow = Jroot(m, n - 1);
70 double jplow = Jprime(m, rlow), jptry;
71 do {
72 rtry = rlow + (rhigh - rlow) * 0.5;
73 jptry = Jprime(m, rtry);
74 if (jplow * jptry < 0)
75 rhigh = rtry;
76 else
77 rlow = rtry;
78 } while (rhigh - rlow > rhigh * 1e-15);
79 return rtry;
80}
81
82static double ktrans, kax;
83static int m_for_J;

Callers 1

Calls 2

JrootFunction · 0.85
JprimeFunction · 0.85

Tested by

no test coverage detected