-
-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #27342: py3: some tiny fixes in numerical folder
URL: https://trac.sagemath.org/27342 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Travis Scrimshaw
- Loading branch information
Showing
3 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,23 +8,24 @@ AUTHORS: | |
""" | ||
|
||
#***************************************************************************** | ||
# **************************************************************************** | ||
# Copyright (C) 2010 Nathann Cohen <[email protected]> | ||
# Copyright (C) 2016 Matthias Koeppe <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# http://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
# https://www.gnu.org/licenses/ | ||
# **************************************************************************** | ||
from __future__ import print_function | ||
|
||
from sage.numerical.mip import MIPSolverException | ||
from sage.numerical.interactive_simplex_method import InteractiveLPProblem, default_variable_name | ||
from sage.modules.all import vector | ||
from copy import copy | ||
|
||
|
||
cdef class InteractiveLPBackend: | ||
""" | ||
MIP Backend that works with :class:`InteractiveLPProblem`. | ||
|
@@ -593,7 +594,7 @@ cdef class InteractiveLPBackend: | |
sage: p.nrows() | ||
0 | ||
sage: p.add_linear_constraints(5, 0, None) | ||
sage: p.add_col(range(5), range(5)) | ||
sage: p.add_col(list(range(5)), list(range(5))) | ||
sage: p.nrows() | ||
5 | ||
""" | ||
|
@@ -614,7 +615,7 @@ cdef class InteractiveLPBackend: | |
sage: from sage.numerical.backends.generic_backend import get_solver | ||
sage: p = get_solver(solver = "InteractiveLP") | ||
sage: p.add_linear_constraints(5, 0, None) | ||
sage: p.add_col(range(5), range(5)) | ||
sage: p.add_col(list(range(5)), list(range(5))) | ||
sage: p.solve() | ||
0 | ||
sage: p.objective_coefficient(0,1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,14 +224,14 @@ AUTHORS: | |
- Risan (2012/02): added extension for exact computation | ||
""" | ||
|
||
#***************************************************************************** | ||
# **************************************************************************** | ||
# Copyright (C) 2012 Nathann Cohen <[email protected]> | ||
# | ||
# Distributed under the terms of the GNU General Public License (GPL) | ||
# as published by the Free Software Foundation; either version 2 of | ||
# the License, or (at your option) any later version. | ||
# http://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
# https://www.gnu.org/licenses/ | ||
# **************************************************************************** | ||
from __future__ import print_function | ||
|
||
from copy import copy | ||
|
@@ -241,6 +241,7 @@ from sage.structure.element import is_Matrix | |
from sage.misc.cachefunc import cached_method | ||
from sage.misc.superseded import deprecation | ||
|
||
|
||
cdef class MixedIntegerLinearProgram(SageObject): | ||
r""" | ||
The ``MixedIntegerLinearProgram`` class is the link between Sage, linear | ||
|
@@ -1420,7 +1421,7 @@ cdef class MixedIntegerLinearProgram(SageObject): | |
values for the corresponding variables :: | ||
sage: x_sol = p.get_values(x) | ||
sage: x_sol.keys() | ||
sage: sorted(x_sol.keys()) | ||
[3, 5] | ||
Obviously, it also works with variables of higher dimension:: | ||
|