termoshtt / eom

Configurable ODE/PDE solver
MIT License
59 stars 8 forks source link

TimeEvolution with buffer #32

Closed termoshtt closed 7 years ago

termoshtt commented 7 years ago

I drop "self-consuming" style API, which was originally introduced in order to accept KSE code in rust-spectral. It is hard to use same interface among &self and &mut self time-evolution operator.

This PR introduces Buffer type which can be mutable while the EOM itself immutable.

termoshtt commented 7 years ago

master

cargo run --release --bin bench  16.15s user 0.21s system 100% cpu 16.200 total

buffered

cargo run --release --bin bench  9.30s user 0.24s system 101% cpu 9.383 total

almost twice faster (/・ω・)/

termoshtt commented 7 years ago
cargo run --release --bin bench  8.15s user 0.22s system 102% cpu 8.193 total
termoshtt commented 7 years ago

Constructor of RK4Buffer may be more simple like

let buf = teo.new_buffer();

But it needs breaking change. It postponed another PR.