From 4007f0dedd5e09869d0cfd449209d6d2d0097be8 Mon Sep 17 00:00:00 2001 From: tgiani Date: Fri, 25 Oct 2024 14:24:11 +0200 Subject: [PATCH] S1p2 and G3p2. Check that this is correct --- crates/ekore/src/harmonics/cache.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ekore/src/harmonics/cache.rs b/crates/ekore/src/harmonics/cache.rs index f8dfd487c..a9dc6ad25 100644 --- a/crates/ekore/src/harmonics/cache.rs +++ b/crates/ekore/src/harmonics/cache.rs @@ -50,6 +50,8 @@ pub enum K { S1ph, S2ph, S3ph, + S1p2, + G3p2, } /// Hold all cached values. @@ -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)), @@ -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);