Reputation: 135
I am writing a constraint based particle system based on this paper. The Jacobian of the constraints C scales with the number of particles in the system and the number of constraints. Because each constraint generally has only a few particles that depend on it, the matrix will be extremely sparse. I thought it might be beneficial to use a sparse matrix in Eigen to solve the system. Per the Eigen reference material, there seems to be several different methods for solving these sparse matrix equations. My questions are:
Upvotes: 3
Views: 848
Reputation: 29205
If N if smaller than, say, 1000 then you might go with a dense storage, otherwise better use a sparse representation. The number of non-zeros per row should be very small, say around 10 and no more than 100 to keep the efficiency of the solvers. The complexity of sparse solvers is in practice smaller than O(N*K) where K is the number of nonzeros. Therefore they can be several orders of magnitudes faster than dense solvers for very sparse matrices.
Upvotes: 1