EXAMPLES:
+ Positive operators on the nonnegative orthant are nonnegative
+ matrices::
+
+ sage: K = Cone([(1,0,0),(0,1,0),(0,0,1)])
+ sage: L = random_matrix(QQ,3).apply_map(abs)
+ sage: is_positive_on(L,K)
+ True
+
+ TESTS:
+
The identity is always positive in a nontrivial space::
sage: set_random_seed()
sage: is_positive_on(L,K)
True
- TESTS:
-
Everything in ``K.positive_operators_gens()`` should be
positive on ``K``::
elif L.base_ring() is SR:
# Fall back to inequality-checking when the entries of ``L``
# might be symbolic.
- return all([ s*(L*x) >= 0 for x in K for s in K ])
+ return all([ s*(L*x) >= 0 for x in K for s in K.dual() ])
else:
# The only inexact ring that we're willing to work with is SR,
# since it can still be exact when working with symbolic
EXAMPLES:
+ Lyapunov-like operators on the nonnegative orthant are diagonal
+ matrices::
+
+ sage: K = Cone([(1,0,0),(0,1,0),(0,0,1)])
+ sage: L = diagonal_matrix(random_vector(QQ,3))
+ sage: is_lyapunov_like_on(L,K)
+ True
+
+ TESTS:
+
The identity is always Lyapunov-like in a nontrivial space::
sage: set_random_seed()
sage: is_lyapunov_like_on(L,K)
True
- TESTS:
-
Everything in ``K.lyapunov_like_basis()`` should be Lyapunov-like
on ``K``::