Actually, the problem I have is solving a homogeneous linear equation system Ax = 0
, with A
being large and sparse while constraining some entries of the solution vector x
to specific values.
This is equivalent to finding the nullspace of A
which is, as I assume it to be, a more common problem. Thus, to achieve this, I try to compute the solution to Ax = 0
using some solvers provided by scipy.sparse but this only returns the trivial result 0.
Until now, I've tried solving it with the least squares solver from scipy.sparse and prior to this approach, I looked into another stackoverflow post which had a similar problem to the former one I described above, but this person worked with a normal numpy array. Unfortunately, I can't seem to find this post any more and don't really know, if it would work for scipy.sparse matrices anyway.
A = sparse.rand(10000, 5000, format="csc")
b = csr_matrix((10000, 1), dtype=np.float64).toarray()
b = b.reshape((-1,))
x = linalg.lsqr(A, b)
Returns The exact solution is x = 0