MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / __init__

Method __init__

graph.py:96–126  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 """Graph data structure representing proof state."""
95
96 def __init__(self):
97 self.type2nodes = {
98 Point: [],
99 Line: [],
100 Segment: [],
101 Circle: [],
102 Direction: [],
103 Length: [],
104 Angle: [],
105 Ratio: [],
106 Measure: [],
107 Value: [],
108 }
109 self._name2point = {}
110 self._name2node = {}
111
112 self.rconst = {} # contains all constant ratios
113 self.aconst = {} # contains all constant angles.
114
115 self.halfpi, _ = self.get_or_create_const_ang(1, 2)
116 self.vhalfpi = self.halfpi.val
117
118 self.atable = ar.AngleTable()
119 self.dtable = ar.DistanceTable()
120 self.rtable = ar.RatioTable()
121
122 # to quick access deps.
123 self.cache = {}
124
125 self._pair2line = {}
126 self._triplet2circle = {}
127
128 def copy(self) -> Graph:
129 """Make a copy of self."""

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected