コード例 #1
0
ファイル: math_classes.py プロジェクト: alinabucur/lmfdb
    def from_cycle_type_to_conjugacy_class_index(self, cycle_type, p):
        try:
            dict_to_use = self._from_cycle_type_to_conjugacy_class_index_dict
        except AttributeError:
            import cyc_alt_res_engine

            self._from_cycle_type_to_conjugacy_class_index_dict = cyc_alt_res_engine.from_cycle_type_to_conjugacy_class_index_dict(
                map(str, self.polynomial()), self.Frobenius_resolvents()
            )
            # self._from_cycle_type_to_conjugacy_class_index_dict is now a dictionary with keys the the cycle types (as tuples),
            # and values functions of the prime that output the conjugacy class index (using different methods depending on local information)
            # cyc_alt_res_engine.from_cycle_type_to_conjugacy_class_index_dict constructs this dictionary,
            # and only needs to know the defining polynomial of the number field and the frobenius resolvent
            # CAUTION: this is not meant to be used for hard primes, even though it would seemingly work
            # This is a consequence of Tim's definition of hard primes.
            dict_to_use = self._from_cycle_type_to_conjugacy_class_index_dict
        try:
            fn_to_use = dict_to_use[cycle_type]
        except KeyError:
            raise KeyError, "Expecting to find key %s, whose entries have type %s, in %s. For info, keys there have entries of type %s" % (
                cycle_type,
                type(cycle_type[0]),
                self._from_cycle_type_to_conjugacy_class_index_dict,
                type(self._from_cycle_type_to_conjugacy_class_index_dict.keys()[0][0]),
            )
        return fn_to_use(p)
コード例 #2
0
ファイル: math_classes.py プロジェクト: rupertm2/lmfdb
 def from_cycle_type_to_conjugacy_class_index(self, cycle_type, p):
     try:
         dict_to_use = self._from_cycle_type_to_conjugacy_class_index_dict
     except AttributeError:
         import cyc_alt_res_engine
         self._from_cycle_type_to_conjugacy_class_index_dict = cyc_alt_res_engine.from_cycle_type_to_conjugacy_class_index_dict(map(str,self.polynomial()), self.Frobenius_resolvents())
         # self._from_cycle_type_to_conjugacy_class_index_dict is now a dictionary with keys the the cycle types (as tuples),
         # and values functions of the prime that output the conjugacy class index (using different methods depending on local information)
         # cyc_alt_res_engine.from_cycle_type_to_conjugacy_class_index_dict constructs this dictionary,
         # and only needs to know the defining polynomial of the number field and the frobenius resolvent
         # CAUTION: this is not meant to be used for hard primes, even though it would seemingly work
         # This is a consequence of Tim's definition of hard primes.
         dict_to_use = self._from_cycle_type_to_conjugacy_class_index_dict
     try:
         fn_to_use = dict_to_use[cycle_type]
     except KeyError:
         raise KeyError, "Expecting to find key %s, whose entries have type %s, in %s. For info, keys there have entries of type %s" % \
             (cycle_type, type(cycle_type[0]), self._from_cycle_type_to_conjugacy_class_index_dict,
              type(self._from_cycle_type_to_conjugacy_class_index_dict.keys()[0][0]))
     return fn_to_use(p)