Skip to content

Commit

Permalink
add rotation_order attribute to cyclic groups and so(2) as suggested in
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabri95 committed Jun 21, 2023
1 parent 5c15481 commit 6ab85be
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions escnn/group/groups/cyclicgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,21 @@ def __init__(self, N: int):
Args:
N (int): order of the group
Attributes:
~.rotation_order (int): the number of rotations, i.e. the order of the group
"""

assert (isinstance(N, int) and N > 0), N

super(CyclicGroup, self).__init__("C%d" % N, False, True)

self.N = N


# int: for consistency with the DihedralGroup, store the number of rotations also in this attribute
self.rotation_order = N

self._elements = [self.element(i) for i in range(N)]
# self._elements_names = ['e'] + ['r%d' % i for i in range(1, N)]

Expand Down
1 change: 1 addition & 0 deletions escnn/group/groups/o2group.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def __init__(self, maximum_frequency: int = 6):
Attributes:
~.reflection: the reflection element :math:`(j, \theta) = (1, 0.)`
~.rotation_order (int): this is equal to ``-1``, which means the group contains an infinite number of rotations
"""

Expand Down
6 changes: 5 additions & 1 deletion escnn/group/groups/so2group.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ def __init__(self, maximum_frequency: int = 6):
Args:
maximum_frequency (int, optional): the maximum frequency to consider when building the irreps of the group
Attributes:
~.rotation_order (int): this is equal to ``-1``, which means the group contains an infinite number of rotations
"""

assert (isinstance(maximum_frequency, int) and maximum_frequency >= 0)

super(SO2, self).__init__("SO(2)", True, True)

self._maximum_frequency = maximum_frequency

self.rotation_order = -1

self._identity = self.element(0.)

self._build_representations()
Expand Down

0 comments on commit 6ab85be

Please sign in to comment.