X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Fcone%2Fcone.py;h=ae3ec48cddc9700d4f63ae378fc01b178dee6e3b;hb=8353d776d562e16cdbccfd10881662fc542c8d6f;hp=d33a1c5bc317bf7a627f964ca11b78c45045b08a;hpb=9d6b29ab0aa0c8c6395834d316d48aa90b3b6c45;p=sage.d.git diff --git a/mjo/cone/cone.py b/mjo/cone/cone.py index d33a1c5..ae3ec48 100644 --- a/mjo/cone/cone.py +++ b/mjo/cone/cone.py @@ -179,12 +179,6 @@ def positive_operator_gens(K): EXAMPLES: - The trivial cone in a trivial space has no positive operators:: - - sage: K = Cone([], ToricLattice(0)) - sage: positive_operator_gens(K) - [] - Positive operators on the nonnegative orthant are nonnegative matrices:: sage: K = Cone([(1,)]) @@ -198,6 +192,27 @@ def positive_operator_gens(K): [0 0], [0 0], [1 0], [0 1] ] + The trivial cone in a trivial space has no positive operators:: + + sage: K = Cone([], ToricLattice(0)) + sage: positive_operator_gens(K) + [] + + Every operator is positive on the trivial cone:: + + sage: K = Cone([(0,)]) + sage: positive_operator_gens(K) + [[1], [-1]] + + sage: K = Cone([(0,0)]) + sage: K.is_trivial() + True + sage: positive_operator_gens(K) + [ + [1 0] [-1 0] [0 1] [ 0 -1] [0 0] [ 0 0] [0 0] [ 0 0] + [0 0], [ 0 0], [0 0], [ 0 0], [1 0], [-1 0], [0 1], [ 0 -1] + ] + Every operator is positive on the ambient vector space:: sage: K = Cone([(1,),(-1,)]) @@ -215,6 +230,16 @@ def positive_operator_gens(K): [0 0], [ 0 0], [0 0], [ 0 0], [1 0], [-1 0], [0 1], [ 0 -1] ] + A non-obvious application is to find the positive operators on the + right half-plane:: + + sage: K = Cone([(1,0),(0,1),(0,-1)]) + sage: positive_operator_gens(K) + [ + [1 0] [0 0] [ 0 0] [0 0] [ 0 0] + [0 0], [1 0], [-1 0], [0 1], [ 0 -1] + ] + TESTS: Each positive operator generator should send the generators of the