#19332: Add discrete_complementarity_set() method for cones
-------------------------------------+-------------------------------------
Reporter: mjo | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.9
Component: geometry | Resolution:
Keywords: | Merged in:
Authors: Michael Orlitzky | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/mjo/ticket/19332 | 872932952e7db998d013637636ca82124ace544e
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by mjo):
* status: needs_work => needs_review
Comment:
Replying to [comment:2 novoselt]:
> I do not like the implementation at all, why do we need to do
> ...
> when exactly the same is achieved with
> {{{
> sage: [(x, s) for x in self for s in self.dual() if x * s == 0]
> [(N(1, 0), M(0, 1)), (N(0, 1), M(1, 0))]
> }}}
> which uses only memory for tuples (but not their elements) and can be
cached???
[[BR]]
A few months ago, I'm sure I had a reason... but this works just fine now.
I used your implementation and updated all of the doctests. I did use an
explicit `x.inner_product(s)` because it's not easy to figure out what
`x*s` does.
[[BR]]
[[BR]]
> Note also that the result can be achieved using
> ...
> which will not be as short of a code and above, but may be faster if
face lattice is used (and thus computed/cached) for something else.
[[BR]]
You got my hopes up: this is an order of magnitude faster. But it also
outputs the wrong answer =)
{{{
sage: K = Cone([(1,0)])
sage: [[(r, n) for r in f] for f, n in zip(K.facets(), K.facet_normals())]
[[]]
sage: K.discrete_complementarity_set()
[(N(1, 0), M(0, 1)), (N(1, 0), M(0, -1))]
}}}
[[BR]]
[[BR]]
>
> A bipartite graph also seems to be a natural structure for the output
;-)
[[BR]]
Now that it's outputting lattice elements, sure, but can we do anything
cool with the graph? The only thing I ever do with the complementarity set
is loop through it and check properties.
The complementarity set can be huge so I don't want to build a graph
unless I can do something with it.
--
Ticket URL: <http://trac.sagemath.org/ticket/19332#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.