-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move movement to sparse matrix format #29
Comments
I think the key here is using the setfromtriplets thing to assign the non-zero values to the sparse matrix |
Oh, you might be able to do this easier, and actually just pass it the sparse matrix.... |
Well I'll be damned, chatgpt to the rescue here
from chatgpt Note that this code assumes that the input matrices A and B are already in sparse matrix format. If they are not, you can convert them to sparse matrix format using the sparseMatrix function from the Matrix package in R. Also note that the RcppEigen and Rcpp packages need to be installed and loaded in R before running this code. |
Idea to make movement way faster. Define a propobability of movement threshold, where once it drops be low X, the probability of moving to a cell is zero. Convert all probabilities of movement below that threshold, and make movement a sparse matrix instead of a normal matrix, and voila!
Eigen::SparseMatrix
https://eigen.tuxfamily.org/dox/group__TutorialSparse.html
https://cran.r-project.org/web/packages/RcppEigen/vignettes/RcppEigen-Introduction.pdf
The text was updated successfully, but these errors were encountered: