From fbaecc56ec029d6f813d76e26bd8891a41416bf0 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 17 Sep 2015 01:12:40 -0400 Subject: [PATCH] Add the is_lyapunov_like() function to the cone.cone module. --- mjo/cone/cone.py | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/mjo/cone/cone.py b/mjo/cone/cone.py index 7374fcf..f3543a1 100644 --- a/mjo/cone/cone.py +++ b/mjo/cone/cone.py @@ -685,3 +685,52 @@ def lyapunov_rank(K): beta += len(LL(K)) return beta + + + +def is_lyapunov_like(L,K): + r""" + Determine whether or not ``L`` is Lyapunov-like on ``K``. + + We say that ``L`` is Lyapunov-like on ``K`` if `\left\langle + L\left\lparenx\right\rparen,s\right\rangle = 0` for all pairs + `\left\langle x,s \right\rangle` in the complementarity set of + ``K``. It is known [Orlitzky]_ that this property need only be + checked for generators of ``K`` and its dual. + + INPUT: + + - ``L`` -- A linear transformation or matrix. + + - ``K`` -- A polyhedral closed convex cone. + + OUTPUT: + + ``True`` if it can be proven that ``L`` is Lyapunov-like on ``K``, + and ``False`` otherwise. + + .. WARNING:: + + If this function returns ``True``, then ``L`` is Lyapunov-like + on ``K``. However, if ``False`` is returned, that could mean one + of two things. The first is that ``L`` is definitely not + Lyapunov-like on ``K``. The second is more of an "I don't know" + answer, returned (for example) if we cannot prove that an inner + product is zero. + + REFERENCES: + + .. [Orlitzky] M. Orlitzky. The Lyapunov rank of an + improper cone (preprint). + + EXAMPLES: + + todo. + + TESTS: + + todo. + + """ + return all([(L*x).inner_product(s) == 0 + for (x,s) in discrete_complementarity_set(K)]) -- 2.44.2