Beware, this will crash for "most instances" because the
constructor below looks wrong.
"""
- if cls is TrivialEJA:
- # The TrivialEJA class doesn't take an "n" argument because
- # there's only one.
- return cls(field)
-
n = ZZ.random_element(cls._max_random_instance_size() + 1)
return cls(n, field, **kwargs)
# largest subalgebra generated by any element.
self.rank.set_cache(0)
+ @classmethod
+ def random_instance(cls, field=AA, **kwargs):
+ # We don't take a "size" argument so the superclass method is
+ # inappropriate for us.
+ return cls(field, **kwargs)
class DirectSumEJA(FiniteDimensionalEuclideanJordanAlgebra):
r"""