sedumipy.neighborhood¶
Port of iswnbr.c (the real, compiled kernel – iswnbr.m’s own body is just a sedumi_binary_error() stub with dead reference code below it, kept as documentation of the intended algorithm, not what actually runs. NOT bound via ctypes: iswnbr.c’s Q-set sort uses the exact same undefined-behavior pattern already confirmed to cause real, reproducible divergence in sortnnz.c during this port (a comparator declared to return signed char but invoked through qsort() via a cast to an int(*)(const void*,const void*) function pointer type) – ported the algorithm’s clearly-stated intent directly instead (ascending sort of the “inconclusive” set), matching the .m reference’s own sort(wQ) call, which has no such UB.
Also note the dead .m reference is INCOMPLETE: it only implements the 0 < theta < 1 branch. iswnbr.c has a separate, simpler theta==1 special case (1-thetaSQR <= 1e-8) the .m file never shows – and checkpars.m defaults pars.theta=1 for pars.alg==0, so this branch is genuinely reachable, not a dead corner. Ported here from the C source directly.
Functions
|
[delta,h,alpha] = iswnbr(vSQR,thetaSQR): proximity measure w.r.t. |