Skip to content

Commit

Permalink
S1p2 and G3p2. Check that this is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiani committed Oct 25, 2024
1 parent 659fe31 commit 4007f0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/ekore/src/harmonics/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub enum K {
S1ph,
S2ph,
S3ph,
S1p2,
G3p2,
}

/// Hold all cached values.
Expand Down Expand Up @@ -94,6 +96,7 @@ impl Cache {
K::S2mh => w2::S2((self.n - 1.) / 2.),
K::S3mh => w3::S3((self.n - 1.) / 2.),
K::G3 => g_functions::g3(self.n, self.get(K::S1)),
K::G3p2 => g_functions::g3(self.n + 2., self.get(K::S1p2)),
K::Sm1e => w1::Sm1e(self.get(K::S1), self.get(K::S1h)),
K::Sm1o => w1::Sm1o(self.get(K::S1), self.get(K::S1mh)),
K::Sm2e => w2::Sm2e(self.get(K::S2), self.get(K::S2h)),
Expand All @@ -105,6 +108,7 @@ impl Cache {
K::S1ph => recursive_harmonic_sum(self.get(K::S1mh), (self.n - 1.) / 2., 1, 1),
K::S2ph => recursive_harmonic_sum(self.get(K::S2mh), (self.n - 1.) / 2., 1, 2),
K::S3ph => recursive_harmonic_sum(self.get(K::S3mh), (self.n - 1.) / 2., 1, 3),
K::S1p2 => recursive_harmonic_sum(self.get(K::S1), self.n, 2, 1),
};
// insert
self.m.insert(k, val);
Expand Down

0 comments on commit 4007f0d

Please sign in to comment.