Undefined infeasible point in a convex programming package like CVXOPT

141 Views Asked by At

I am using CVXOPT, particularly to solve a nonlinear convex optimization problem. Either the objective function or the constraints involve some functions that are only defined in a strict subset of $\mathbf R^n$. For example, the function is the logarithm $\ln$. It seems that the package may well use symmetric primal dual method which allows infeasible points during the iteration. However, that would generate domain error from the functions. Does extending function to the whole of the Euclidean space help? For the example of the logarithm, I extend it so that $\ln(x)=-\infty$ or $-M$, and $\frac1x=\infty$ or $M$ $\forall x\le0$ for some very large positive $M$. Is this the practice to get around the problem? What are the more efficient ways to handle the problem?


Here is a specific example. Actually, this is modified from the Example: equality constrained analytic centering of CVXOPT User's Guide to make the point of the issue of domain of definition.

import numpy as np
from cvxopt import matrix, log, mul, div, spdiag, solvers


np.random.seed(1)
A = matrix(np.random.randn(2,4))
b = matrix(np.random.randn(2))
m,n = A.size

def F(x=None,z=None):
  if x is None: return 0,matrix(1.0,(n,1))
  #if max(x) >= 0.0: return None
  f = -sum(log(-x))
  Df = ((-x)**-1).T
  if z is None: return f,Df
  H = spdiag(z[0]*(x**-2))
  return f,Df,H

G = spdiag([1.]*n)
h = matrix(0.0,(n,1))

f, Df, H = F(matrix(-1.0,(n,1)), matrix([-2.0]))

sol = solvers.cp(F,G=G,h=h,A=A,b=b)['x']