Method for finding strictly greater-than-zero solution for Python's Scipy Linear Programing
问题 Scipy NNLS perform this: Solve argmin_x || Ax - b ||_2 for x>=0. What's the alternative way to do it if I seek strictly non-zero solution (i.e. x > 0 ) ? Here is my LP code using Scipy's NNLS: import numpy as np from numpy import array from scipy.optimize import nnls def by_nnls(A=None, B=None): """ Linear programming by NNLS """ #print "NOF row = ", A.shape[0] A = np.nan_to_num(A) B = np.nan_to_num(B) x, rnorm = nnls(A,B) x = x / x.sum() # print repr(x) return x B1 = array([ 22.133, 197.087,