from mjo.cone.completely_positive import *
from mjo.cone.doubly_nonnegative import *
from mjo.cone.faces import *
+from mjo.cone.nonnegative_orthant import *
from mjo.cone.permutation_invariant import *
from mjo.cone.rearrangement import *
from mjo.cone.symmetric_psd import *
--- /dev/null
+"""
+The nonnegative orthant in `\mathbb{Z}^{n}`. I'm sick and tired of
+typing it.
+"""
+
+from sage.all import *
+
+def nonnegative_orthant(n):
+ r"""
+ The nonnegative orthant in ``n`` dimensions.
+
+ INPUT:
+
+ - ``n`` -- the dimension of the ambient space.
+
+ OUTPUT:
+
+ The convex cone having ``n`` standard basis vectors as its
+ generators. Each generating ray will have the integer ring as its
+ base ring.
+
+ SETUP::
+
+ sage: from mjo.cone.nonnegative_orthant import nonnegative_orthant
+
+ EXAMPLES::
+
+ sage: nonnegative_orthant(3).rays()
+ N(1, 0, 0),
+ N(0, 1, 0),
+ N(0, 0, 1)
+ in 3-d lattice N
+
+ TESTS:
+
+ We can construct the trivial cone as the nonnegative orthant in a
+ trivial vector space::
+
+ sage: nonnegative_orthant(0)
+ 0-d cone in 0-d lattice N
+
+ The nonnegative orthant is a proper cone::
+
+ sage: set_random_seed()
+ sage: n = ZZ.random_element(10)
+ sage: K = nonnegative_orthant(n)
+ sage: K.is_proper()
+ True
+
+ """
+ I = identity_matrix(ZZ,n)
+ lattice = ToricLattice(n)
+ return Cone(I.rows(), lattice)