Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A MIPVariable's repr should include some useful information #20331

Closed
mkoeppe opened this issue Mar 30, 2016 · 14 comments
Closed

A MIPVariable's repr should include some useful information #20331

mkoeppe opened this issue Mar 30, 2016 · 14 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 30, 2016

sage: p = MixedIntegerLinearProgram(solver="glpk")
sage: bar = p.new_variable(name="bar")
sage: bar
MIPVariable of dimension 1
sage: bar[0]
x_0
sage: bar
MIPVariable of dimension 1
sage: bar[1]
x_1
sage: bar
MIPVariable of dimension 1
sage: p.solve()
0.0
sage: bar.values()
[x_0, x_1]
sage: p.get_values(bar)
{0: 0.0, 1: 0.0}

I think the print method should instead of "dimension 1" (which apparently means tensor order 1, rather than dimension 1 -- see #17643) print some useful information, such as the name of the variable and the dimension (number of components).

MIPVariable bar with 7 binary components

MIPVariable bar with 5 real components, >= 0, <= 17

CC: @dimpase @videlec @jdemeyer @yuan-zhou

Component: numerical

Author: Yuan Zhou

Branch/Commit: b2b9b36

Reviewer: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/20331

@mkoeppe mkoeppe added this to the sage-7.2 milestone Mar 30, 2016
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title MIPVariable misreports its dimension (always 1) A MIPVariable's repr should include some useful information Apr 3, 2016
@mkoeppe mkoeppe modified the milestones: sage-7.2, sage-9.4 Apr 28, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@yuan-zhou
Copy link

@yuan-zhou
Copy link

Author: Yuan Zhou

@yuan-zhou
Copy link

New commits:

dbe38b2change MIPVariable's repr to include useful info

@yuan-zhou
Copy link

Commit: dbe38b2

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 13, 2021

comment:10

It should be "0 real components" (plural)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 13, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

b2b9b36zero is followed by plural countable nouns

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 13, 2021

Changed commit from dbe38b2 to b2b9b36

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 13, 2021

Reviewer: Matthias Koeppe

@vbraun
Copy link
Member

vbraun commented Jun 6, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants