Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hypertiling
hypertiling
Commits
23d429a9
Commit
23d429a9
authored
May 24, 2022
by
Florian Goth
Browse files
improve docs of CenterContainer
parent
fe5644a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
hypertiling/CenterContainer.py
View file @
23d429a9
...
...
@@ -45,34 +45,34 @@ try:
# Note to self, think of numpy in the alternative implementation
self
.
maxlinlength
=
linlength
# the maximum linear length
self
.
dangle
=
0.1
# controls the width of the angle interval and is adapted by repeated searches
self
.
centers
=
SortedList
([
HTCenter
(
r
,
phi
)])
def
add
(
self
,
z
):
'''
Add z to the container.
Parameters:
z (complex) A complex number. should not be 0+0*I...
z (complex)
:
A complex number. should not be 0+0*I...
'''
self
.
centers
.
add
(
HTCenter
(
z
))
def
__len__
(
self
):
'''
Returns the length of the container and should enable use of the len() builtin on this container.
'''
return
len
(
self
.
centers
)
def
fp_has
(
self
,
z
):
'''
Checks whether a representative of z has already been stored.
Parameter:
z (complex): the number to check.
Returns:
true if a number that is as close as 1E-12 to z has already been stored
else false.
else false.
1E-12 is deemed sufficient since on the hyperbolic lattice the numbers pile up near |z| ~ 1
'''
nangle
=
math
.
atan2
(
z
.
imag
,
z
.
real
)
centerarray_iterator
=
self
.
centers
.
irange
(
HTCenter
(
1
,
nangle
*
(
1
-
self
.
dangle
)),
HTCenter
(
1
,
nangle
*
(
1
+
self
.
dangle
)))
...
...
@@ -105,7 +105,7 @@ except ImportError:
Add z to the container
Parameters:
z (complex) A complex number. should not be 0+0*I...
z (complex)
:
A complex number.
It
should not be 0+0*I...
'''
temp
=
HTCenter
(
z
)
pos
=
bisect
.
bisect_left
(
self
.
centers
,
temp
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment