dilevin / computer-graphics-mass-spring-systems

Computer Graphics Assignment – Mass Spring Systems
1 stars 2 forks source link

Q in sparce precomputation #29

Open jarenworme opened 12 months ago

jarenworme commented 12 months ago

Hey quick question, can we calculate Q as normal (as in dense) since the code already implemented in the file fast_mass_springs_precomputation_sparse.cpp is given to us to build Q or do we have to change that code to build Q using A, M and C before we use Q.setFromTriplets()?

Also, since there are no zero elements in d and l in step sparse, do we need to change anything between the dense and sparse implementations for that function?

panuelosj commented 12 months ago

When using the Eigen::SparseMatrix datastructure, as long as every component matrix is sparse (or a scalar) then you can write into a sparse matrix. ie, if A, B are sparse matrices, then you can write A*B into a sparse matrix datatype.