albersonmiranda / fio

Friendly & Fast Input-Output Matrix Analysis in R, written in Rust.
https://albersonmiranda.github.io/fio/
Other
9 stars 1 forks source link

Use sparse matrix algebra #42

Open albersonmiranda opened 3 months ago

albersonmiranda commented 3 months ago

Use sparse matrix algebra when involving identity matrix arithmatics (I-A; A / x). Expected increase in performance as showed in #41.

albersonmiranda commented 3 months ago

Is there use cases with 2/3 sparsity ratio to justify sparse algebra?

albersonmiranda commented 2 weeks ago

Is there use cases with 2/3 sparsity ratio to justify sparse algebra?

Yes, Exiobase 2022 has 68% of zeros entries. {fio} should use sparse matrix algebra when:

  1. It detects matrix is large enough length(obj) > 1e6
  2. Matrix is sparse (sum(obj == 0) / sum(obj != 0) > 0.66

But only makes sense working on it after #47 , since such matrix sizes appears on multi-region IOTs.