From: Michael Orlitzky Date: Sat, 18 May 2024 20:57:39 +0000 (-0400) Subject: mjo/cone/trivial_cone.py: bye, use sage's cones.trivial() instead X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=5a2300f7d7e72b159295ab64de2b93d15747f2fd;p=sage.d.git mjo/cone/trivial_cone.py: bye, use sage's cones.trivial() instead --- diff --git a/mjo/cone/all.py b/mjo/cone/all.py index a8d0eb3..7dd3c94 100644 --- a/mjo/cone/all.py +++ b/mjo/cone/all.py @@ -10,4 +10,3 @@ from mjo.cone.permutation_invariant import * from mjo.cone.rearrangement import * from mjo.cone.symmetric_pd import * from mjo.cone.symmetric_psd import * -from mjo.cone.trivial_cone import * diff --git a/mjo/cone/trivial_cone.py b/mjo/cone/trivial_cone.py deleted file mode 100644 index 17c6835..0000000 --- a/mjo/cone/trivial_cone.py +++ /dev/null @@ -1,64 +0,0 @@ -from sage.all import * - -def trivial_cone(n, lattice=None): - r""" - The trivial cone with no generators in ``n`` dimensions. - - INPUT: - - - ``n`` -- the dimension of the ambient space. - - - ``lattice`` -- (default: ``None``) an ambient lattice of rank ``n`` - to be passed to the :func:`Cone` constructor. - - OUTPUT: - - The trivial cone with no generators. - - If a ``lattice`` was specified, then the resulting cone will live in - that lattice unless its rank is incompatible with the dimension - ``n`` (in which case a ``ValueError`` is raised). - - SETUP:: - - sage: from mjo.cone.trivial_cone import trivial_cone - - EXAMPLES:: - - We can construct the trivial cone as the nonnegative orthant in a - trivial ambient space:: - - sage: trivial_cone(0) - 0-d cone in 0-d lattice N - - Or in a nontrivial ambient space:: - - sage: trivial_cone(3) - 0-d cone in 3-d lattice N - - If a ``lattice`` is given, the trivial cone will live in that lattice:: - - sage: L = ToricLattice(3, 'M') - sage: trivial_cone(3, lattice=L) - 0-d cone in 3-d lattice M - - TESTS: - - An error is raised if the rank of the lattice disagrees with ``n``:: - - sage: L = ToricLattice(1, 'M') - sage: trivial_cone(3, lattice=L) - Traceback (most recent call last): - ... - ValueError: lattice rank=1 and dimension n=3 are incompatible - - """ - if lattice is None: - lattice = ToricLattice(n) - - if lattice.rank() != n: - raise ValueError('lattice rank=%d and dimension n=%d are incompatible' - % - (lattice.rank(), n)) - - return Cone([], lattice)