// Scientific caller linked to the separately downloaded LGPL-3.0 reference. #include #include "VBBinaryLensingLibrary.h" extern "C" int ac23_magnifications(int count, double separation, double massRatio, double radius, const double* sourceX, const double* sourceY, const double* gamma, double tolerance, double* output) { VBBinaryLensing calculator; calculator.Tol = tolerance; calculator.RelTol = tolerance; for (int index = 0; index < count; ++index) { calculator.a1 = 3 * gamma[index] / (2 + gamma[index]); output[index] = radius == 0 ? calculator.BinaryMag0(separation, massRatio, sourceX[index], sourceY[index]) : calculator.BinaryMag2(separation, massRatio, sourceX[index], sourceY[index], radius); if (!(std::isfinite(output[index]) && output[index] > 0)) return index + 1; } return 0; }