Skip to content

Commit 4041b48

Browse files
fixed find_s hybrid function
1 parent 0b81184 commit 4041b48

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

functions.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,12 @@ def series_element(s):
383383
384384
"""
385385
alpha = 1.001
386+
# alpha = 2
386387
element = 1/(s**alpha)
387388

388389
return element
389390

390-
def find_s(s, weighted_e_squared):
391+
def find_s(s_prev, weighted_e_squared):
391392
""""
392393
This function allows to compute s such that \sum s is convergent;
393394
see the comments after (40) in the paper.
@@ -396,8 +397,9 @@ def find_s(s, weighted_e_squared):
396397
"""
397398

398399
alpha = 1.001
400+
# alpha = 2
399401

400-
s = math.ceil(weighted_e_squared**(-1/alpha))
402+
s = max(math.ceil(weighted_e_squared**(-1/alpha)), s_prev + 1)
401403

402404
return s
403405

@@ -406,6 +408,21 @@ def find_s(s, weighted_e_squared):
406408
# This function allows to compute s such that \sum s is convergent;
407409
# see the comments after (40) in the paper.
408410

411+
# weighted_e_squared = e^T(t_j) P e(t_j)
412+
# """
413+
414+
# alpha = 1.001
415+
# # alpha = 2
416+
417+
# s = math.ceil(weighted_e_squared**(-1/alpha))
418+
419+
# return s
420+
421+
# def find_s(s, weighted_e_squared):
422+
# """"
423+
# This function allows to compute s such that \sum s is convergent;
424+
# see the comments after (40) in the paper.
425+
409426
# weighted_e_squared = e^T(t_j) P e(t_j)
410427
# """
411428
# temporary_s = s+1

0 commit comments

Comments
 (0)