Skip to content

Commit

Permalink
test against tol for lmismatch in geomspace
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Nov 13, 2021
1 parent 37416fb commit a3a1e57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExtendableGrids"
uuid = "cfc395e8-590f-11e8-1f13-43a2532b2fa8"
authors = ["Juergen Fuhrmann <[email protected]>, Christian Merdon <[email protected]>"]
version = "0.8.9"
version = "0.8.10"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
6 changes: 3 additions & 3 deletions src/arraytools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function geomspace(a, b, ha, hb ; tol=1.0e-10, maxiterations=100)
@assert (h0>0.0)
@assert (hl>=h0)
@assert((hl+h0)<l)

# We need to adjust two things:

# The sum of the geometric progression must
Expand Down Expand Up @@ -88,7 +88,6 @@ function geomspace(a, b, ha, hb ; tol=1.0e-10, maxiterations=100)
q*=0.99
ns+=1
end

ql=q*0.9
qr=q*1.1
@assert ns<maxiterations "Unable to determine geomspace data after $(maxiterations) iterations"
Expand All @@ -99,7 +98,7 @@ function geomspace(a, b, ha, hb ; tol=1.0e-10, maxiterations=100)
while abs(qr-ql)>tol && ns<maxiterations
ns+=1
mmm=lmismatch(qm,n)
if abs(mmm)<0
if abs(mmm)<tol
break
elseif lmismatch(ql,n)*mmm<0
qr=qm
Expand All @@ -111,6 +110,7 @@ function geomspace(a, b, ha, hb ; tol=1.0e-10, maxiterations=100)
# increase q slightly to increase probability
# for last interval to be <=hl
q=qm*(1.0+tol)

@assert ns<maxiterations "Unable to determine geomspace data after $(maxiterations) iterations"
hmiss=hmismatch(q,n)
if hmiss>1.0+tol
Expand Down

2 comments on commit a3a1e57

@j-fu
Copy link
Member Author

@j-fu j-fu commented on a3a1e57 Nov 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/48740

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.10 -m "<description of version>" a3a1e571ede1c25aff5b5d2ae73918b093a7d3b0
git push origin v0.8.10

Please sign in to comment.