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

Class GeometricTable

ar.py:526–555  ·  view source on GitHub ↗

Abstract class representing the coefficient matrix (table) A.

Source from the content-addressed store, hash-verified

524
525
526class GeometricTable(Table):
527 """Abstract class representing the coefficient matrix (table) A."""
528
529 def __init__(self, name: str = ''):
530 super().__init__(name)
531 self.v2obj = {}
532
533 def get_name(self, objs: list[Any]) -> list[str]:
534 self.v2obj.update({o.name: o for o in objs})
535 return [o.name for o in objs]
536
537 def map2obj(self, names: list[str]) -> list[Any]:
538 return [self.v2obj[n] for n in names]
539
540 def get_all_eqs_and_why(
541 self, return_quads: bool
542 ) -> Generator[Any, None, None]:
543 for out in super().get_all_eqs_and_why(return_quads):
544 if len(out) == 3:
545 x, y, why = out
546 x, y = self.map2obj([x, y])
547 yield x, y, why
548 if len(out) == 4:
549 x, y, f, why = out
550 x, y = self.map2obj([x, y])
551 yield x, y, f, why
552 if len(out) == 5:
553 a, b, x, y, why = out
554 a, b, x, y = self.map2obj([a, b, x, y])
555 yield a, b, x, y, why
556
557
558class RatioTable(GeometricTable):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected