#16714: Add a matrix of constraints in a LP
-------------------------------------+-------------------------------------
Reporter: ncohen | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.3
Component: linear | Resolution:
programming | Merged in:
Keywords: | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | 846cba629c68e46f274de8d6cbbaabd3cdbb0a99
u/vbraun/add_a_matrix_of_constraints_in_a_lp| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by vbraun):
* commit: => 846cba629c68e46f274de8d6cbbaabd3cdbb0a99
Comment:
I've started with tensors (over the base ring) of linear functions and
free modules. This implements:
{{{
sage: m = matrix([[1,2],[3,4]]); m
[1 2]
[3 4]
sage: p = MixedIntegerLinearProgram()
sage: v = p.new_variable(nonnegative=True)
sage: m.row(0) * v[0] # vector * linear function
(1.0, 2.0)*x_0
sage: m * v[0] # matrix * linear function
[x_0 2*x_0]
[3*x_0 4*x_0]
sage: v * m # MIPVariable * matrix
(3.0, 4.0)*x_1 + (1.0, 2.0)*x_0
}}}
The last multiplication including MIPvariables is incomplete: You can't
write `m * v` since MIPvariables do not fit into the parent/element
framework, so they don't really participate in coercion. This needs to be
fixed, probably best by making MIPvariables the elements of the parent
!MixedIntegerLinearProgram. Once that is done it'll be easy to add
(in)equalities of the new tensor elements.
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=846cba629c68e46f274de8d6cbbaabd3cdbb0a99
846cba6]||{{{Implement tensor product of linear functions and free
modules}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/16714#comment:8>
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.