Internals

Everything on this page is a direct, module-per-.m-file port of original SeDuMi’s own internals (interior-point iteration, cone math, symbolic/numeric factorization, …) and is not a stable public API – this exists for contributors reading or extending the port, not for end users. Each module’s own docstring names the .m/.c file it ports and any deliberate deviations. See Contributing for how these modules fit together into sedumipy.sedumi.sedumi()’s main loop.

sedumipy.amul

Port of Amul.m: y = A*x or A'*x, with a correction for columns that were pulled out of the sparse A into a separate dense matrix (the "dense columns" bookkeeping -- see dense.cols/dense.A, produced by getdense.m, not yet ported; a dense dict with empty cols skips the correction entirely, same as the .m file's own if ~isempty(dense.cols) guard).

sedumipy.cone

Port of SeDuMi's cone-vector-algebra .m files (eigK.m, vec.m, mat.m, eyeK.m, maxeigK.m, mineigK.m, ...): pure NumPy, no C bindings needed -- these files are themselves plain MATLAB using the built-in eig(), not mex functions, in the original source.

sedumipy.deninfac

Port of deninfac.m: factors the dense columns into the PCG preconditioner, producing the product-form rank-1 update Lden (via dpr1fact) that lets wrapPcg/loopPcg apply (L*diag(Ld)*L') + Ad*diag(smult)*Ad' as a preconditioner without ever densifying the sparse Cholesky factor L itself.

sedumipy.getada

Port of getada.m: builds ADA = A*P(d)*A' for LP(+Lorentz) problems directly via sparse linear algebra -- no C kernels, pure NumPy/SciPy.

sedumipy.getada_psd

PSD (K.s != 0) counterpart to getada.py: the one-time pre-main-loop Aord/sparsity-pattern setup (build_aord, mirroring sedumi.m lines ~330-382) and the per-iteration ADA rebuild (getada_psd, mirroring sedumi.m lines ~450-452's getada1->`getada2`->`getada3` sequence).

sedumipy.getdatm

Port of getDAtm.m: computes DAt.q[k,j] = d[k]'*Aj[k] for each Lorentz block k and constraint column j -- the per-iteration "scaled A" quantity loopPcg.m/PopK.m/sddir.m need for the Lorentz part -- plus the dense-Lorentz-block correction DAt.denq (via _native.adendotd), which folds the dense.q blocks' contribution into a separate Woodbury-update term and zeroes their rows out of DAt.q proper.

sedumipy.getdense

Port of getdense.m: the dense-column detection heuristic that feeds the dense-columns optimization (see CONTRIBUTING.md's dense.cols/dense.q notes).

sedumipy.getsymbada

Port of getsymbada.m: builds the one-time (pre-main-loop) 0/1 sparsity pattern of ADA = A*P(d)*A' used for the K.s != 0 path's symbolic Cholesky factorization (symbchol.py).

sedumipy.incorder

Port of incorder.c's real kernel (spPartTransp()+incorder() -- its mexFunction is only argument marshalling).

sedumipy.maxstep

Port of maxstep.m: computes the maximal step length to the boundary of the cone K along direction dx from point x.

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.

sedumipy.optstep

Port of optstep.m: Mehrotra-Ye style optimality-face projection, tried once SeDuMi's iteration enters the superlinear convergence region for a pure-LP problem.

sedumipy.pcg

Port of loopPcg.m and wrapPcg.m: the preconditioned-conjugate-gradient solver for A*P(d)*A' * y = rhs that sits at the heart of every interior- point iteration (sddir.m/sdfactor.m both delegate to wrapPcg), plus sparfwslv.m/sparbwslv.m (thin wrappers SeDuMi itself uses around fwblkslv/bwblkslv -- i.e. this port's own _native.fwsolve/bwsolve).

sedumipy.posttransfo

Port of posttransfo.m: transforms the solution (x,y) from SeDuMi's internal format back into the user's original external format, by applying pretransfo.m's own QR transformation matrix in reverse.

sedumipy.pretransfo

Port of pretransfo.m: converts a user-facing (external) (At,b,c,K) SDP/ SOCP problem into SeDuMi's internal format (real-only, Lorentz cones rearranged into trace+norm-bound blocks, rotated Lorentz cones converted to standard ones, diagonal SDP blocks folded into the LP block, complex SDP coefficients moved to the lower triangle, and a self-dual (x0,z0) variable appended).

sedumipy.sddir

Port of sddir.m: direction decomposition for the Ye-Todd-Mizuno self- dual embedding, given the Lsd factorization from sdfactor.py.

sedumipy.sdfactor

Port of sdfactor.m: factors the self-dual embedding's extra (x0,z0) row/column, producing the Lsd struct sddir.py needs on every iteration.

sedumipy.sdinit

Port of sdinit.m: builds the trivial identity solution on the central path (y=0, v=mu*identity) for SeDuMi's self-dual model, the scaling point d, its Jordan frame vfrm, and the initial residuals R that the rest of the predictor-corrector iteration (sddir/wregion/etc., Phase 3-c) is built around.

sedumipy.stepdif

Port of stepdif.m: primal-dual step-length differentiation for the self-dual model.

sedumipy.symbchol

Port of symbchol.m: one-time ordering + symbolic block-sparse Cholesky factorization of ADA's sparsity pattern.

sedumipy.symbcholden

Port of symbcholden.m: symbolic forward Cholesky of the dense columns, producing the Lden structure deninfac.py's dpr1fact-based numeric factorization will (eventually) consume.

sedumipy.trydif

Port of trydif.m: builds w=D(x)z's spectral values at a trial point and checks its wide-neighborhood membership, falling back to the previous (t=0) point if it isn't close enough.

sedumipy.updtransfo

Port of updtransfo.m: updates the Nesterov-Todd scaling point/frame using a numerically stable method, given w = D(Xscl)*Zscl (from trydif.m/widelen.m, not yet ported) and the previous scaling dIN.

sedumipy.widelen

Port of widelen.m: computes an approximate wide-region neighborhood step length via a bounded bisection line search, doing the extensive search only when it pays off (final rate at most twice the best possible, step length at least half the best possible).

sedumipy.wregion

Port of wregion.m: the Sturm-Zhang wide-region interior-point method -- one full predictor(+corrector) step, tying together nearly every other Phase 3-c piece (sddir, maxstep, widelen, stepdif, trydif) plus several cone.py primitives (tdet, psdfactor, qinvjmul, qjmul, psdjmul, frameit) and the native psdinvjmul binding.