1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#[doc(hidden)]
mod integrate;
#[doc(hidden)]
mod leapfrog;
#[doc(hidden)]
mod leapfrog_once;
#[doc(hidden)]
mod yoshida_4th;
#[cfg(test)]
mod test_method;
#[cfg(test)]
mod yoshida_4th_2;
use anyhow::{self, Context};
use nalgebra::DVector;
use numeric_literals::replace_float_literals;
use crate::prepare::prepare;
use crate::{Float, Result, ResultExt, Token};
pub(self) use integrate::integrate;
pub(self) use leapfrog::leapfrog;
pub(self) use leapfrog_once::leapfrog_once;
pub(self) use yoshida_4th::yoshida_4th;
#[cfg(test)]
pub(self) use yoshida_4th_2::yoshida_4th_2;
pub enum Integrators {
Leapfrog,
Yoshida4th,
}
pub trait Integrator<F: Float> {
fn accelerations(&self, t: F, x: &[F]) -> anyhow::Result<Vec<F>>;
integrate!();
leapfrog!();
leapfrog_once!();
prepare!();
yoshida_4th!();
#[cfg(test)]
yoshida_4th_2!();
}