Skip to content

Commit 2734280

Browse files
committed
Merge branch 'master' into equiv-vii
2 parents 491f699 + 9bee8a8 commit 2734280

File tree

86 files changed

+4235
-2218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+4235
-2218
lines changed

.travis-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ "${SAGE_AGE}" == "-1" ]; then
1313
mkdir -p SageMath
1414
sudo sage -pip install sphinxcontrib-websupport
1515
else
16-
SAGE_IMAGE=`python2 -c "import sage_version; print sage_version.get_all_version_names('${SAGE_SERVER}index.html',${SAGE_AGE})"`
16+
SAGE_IMAGE=`python2 -c "import sage_version; print sage_version.get_all_version_names('${SAGE_SERVER}',${SAGE_AGE})"`
1717
cd $HOME
1818
echo "Obtaining Sage image:" ${SAGE_IMAGE}
1919
if [ ! -x SageMath/sage ] ; then

.travis-test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
22
set -e
3+
$HOME/SageMath/sage -pip -vvv install --upgrade .
34
make check-long SAGE="$HOME/SageMath/sage" #SAGE_CHECK_FLAGS="--verbose"
45
make doc SAGE="$HOME/SageMath/sage"

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Dockerfile for binder
2+
# Reference: https://mybinder.readthedocs.io/en/latest/dockerfile.html#preparing-your-dockerfile
3+
4+
FROM sagemath/sagemath:latest
5+
6+
# Copy the contents of the repo in ${HOME}
7+
COPY --chown=sage:sage . ${HOME}
8+
9+
# Install this package and dependencies
10+
RUN sage -pip install .

Makefile

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
SAGE=sage
22

3-
SAGEFILES = \
4-
bug_examples.sage \
5-
compendium_procedures.sage \
6-
continuous_case.sage \
7-
discontinuous_case.sage \
8-
discrete_case.sage \
9-
extreme_functions_in_literature.sage \
10-
extreme_functions_sporadic.sage \
11-
intervals.sage \
12-
real_number_field.sage \
13-
fast_linear.sage \
14-
functions.sage \
15-
parametric.sage \
16-
semialgebraic_mathematica.sage \
17-
simple_extremality_test.sage \
18-
survey_examples.sage \
19-
extreme_functions_mlr_cpl3.sage \
20-
quasi_periodic.sage \
21-
crazy_perturbation_examples.sage \
22-
crazy_perturbation.sage \
23-
kslope_ppl_mip.py \
24-
vertex_enumeration.py \
25-
kslope_pattern.sage \
26-
2q_mip.sage \
27-
kslope_mip.sage \
28-
animation_2d_diagram.sage \
29-
lifting_project.sage
3+
SAGEFILES = \
4+
cutgeneratingfunctionology/igp/bug_examples.sage \
5+
cutgeneratingfunctionology/igp/compendium_procedures.sage \
6+
cutgeneratingfunctionology/igp/continuous_case.sage \
7+
cutgeneratingfunctionology/igp/discontinuous_case.sage \
8+
cutgeneratingfunctionology/igp/discrete_case.sage \
9+
cutgeneratingfunctionology/igp/extreme_functions_in_literature.sage \
10+
cutgeneratingfunctionology/igp/extreme_functions_sporadic.sage \
11+
cutgeneratingfunctionology/igp/intervals.sage \
12+
cutgeneratingfunctionology/igp/real_number_field.sage \
13+
cutgeneratingfunctionology/igp/fast_linear.sage \
14+
cutgeneratingfunctionology/igp/functions.sage \
15+
cutgeneratingfunctionology/igp/parametric.sage \
16+
cutgeneratingfunctionology/igp/semialgebraic_mathematica.sage \
17+
cutgeneratingfunctionology/igp/simple_extremality_test.sage \
18+
cutgeneratingfunctionology/igp/survey_examples.sage \
19+
cutgeneratingfunctionology/igp/extreme_functions_mlr_cpl3.sage \
20+
cutgeneratingfunctionology/igp/quasi_periodic.sage \
21+
cutgeneratingfunctionology/igp/crazy_perturbation_examples.sage \
22+
cutgeneratingfunctionology/igp/crazy_perturbation.sage \
23+
cutgeneratingfunctionology/igp/kslope_ppl_mip.py \
24+
cutgeneratingfunctionology/igp/vertex_enumeration.py \
25+
cutgeneratingfunctionology/igp/kslope_pattern.sage \
26+
cutgeneratingfunctionology/igp/2q_mip.sage \
27+
cutgeneratingfunctionology/igp/kslope_mip.sage \
28+
cutgeneratingfunctionology/igp/animation_2d_diagram.sage \
29+
cutgeneratingfunctionology/igp/lifting_project.sage
3030

3131
## Don't test; currently broken
32-
# parametric_cpl.sage \
32+
# cutgeneratingfunctionology/igp/parametric_cpl.sage \
3333
3434

3535
# Dual feasible functions
36-
SAGEFILES += \
37-
dff_functions.sage \
38-
dff_test_plot.sage \
39-
discontinuous_dff.sage \
40-
computer_based_search_naive_dff.sage \
41-
gdff_linear_test.sage
36+
SAGEFILES += \
37+
cutgeneratingfunctionology/dff/dff_functions.sage \
38+
cutgeneratingfunctionology/dff/dff_test_plot.sage \
39+
cutgeneratingfunctionology/dff/discontinuous_dff.sage \
40+
cutgeneratingfunctionology/dff/computer_based_search_naive_dff.sage \
41+
cutgeneratingfunctionology/dff/gdff_linear_test.sage \
42+
cutgeneratingfunctionology/dff/Gomory_conversion.sage
4243

4344
# Multirow
44-
SAGEFILES += \
45-
piecewise_functions.sage \
46-
lifting_region.sage
45+
SAGEFILES += \
46+
cutgeneratingfunctionology/multirow/piecewise_functions.sage \
47+
cutgeneratingfunctionology/multirow/lifting_region.sage
4748

4849
all:
4950
@echo "No need to 'make' anything. Just run it in Sage; see README.rst"
@@ -52,11 +53,11 @@ install:
5253
@echo "No need to install anything. Just run it in Sage; see README.rst"
5354

5455
check: check-encoding
55-
$(SAGE) -tp 4 $(SAGEFILES)
56+
PYTHONPATH=`pwd` $(SAGE) -tp 4 --force_lib $(SAGEFILES)
5657

5758
check-long: check-encoding
5859
cp .check-long-timings.json .tmp_check-long-timings.json
59-
$(SAGE) -tp 4 --long --stats-path .tmp_check-long-timings.json $(SAGE_CHECK_FLAGS) $(SAGEFILES)
60+
PYTHONPATH=`pwd` $(SAGE) -tp 4 --force_lib --long --stats-path .tmp_check-long-timings.json $(SAGE_CHECK_FLAGS) $(SAGEFILES)
6061
rm .tmp_check-long-timings.json
6162

6263
check-encoding:
@@ -83,4 +84,7 @@ clean: clean-doc
8384
clean-doc:
8485
cd docs && $(SAGE) -sh -c "make clean"
8586

87+
demo.ipynb: demo.rst
88+
$(SAGE) -rst2ipynb $< > $@
89+
8690
.PHONY: all build install test coverage sdist pip-install pip-uninstall pip-develop clean clean-doc doc doc-pdf

README.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ License
3030
The code is released under the GNU General Public License, version 2,
3131
or any later version as published by the Free Software Foundation.
3232

33+
Documentation
34+
-------------
35+
36+
http://mkoeppe.github.io/cutgeneratingfunctionology/doc/html/
37+
38+
Run it on mybinder.org
39+
----------------------
40+
41+
.. image:: https://mybinder.org/badge_logo.svg
42+
:target: https://mybinder.org/v2/gh/mkoeppe/cutgeneratingfunctionology/master?filepath=demo.ipynb
43+
44+
3345
How to run the code in a local copy of Sage
3446
-------------------------------------------
3547

@@ -43,9 +55,9 @@ How to run the code in a local copy of Sage
4355

4456
4. At the Sage prompt, type::
4557

46-
import igp; from igp import *
58+
import cutgeneratingfunctionology.igp as igp; from cutgeneratingfunctionology.igp import *
4759

48-
5. Follow the instructions and examples in `<demo.sage>`_.
60+
5. Follow the instructions and examples in `<demo.rst>`_.
4961

5062

5163
How to run the code online via cloud.sagemath.com
@@ -69,7 +81,7 @@ How to run the code online via cloud.sagemath.com
6981

7082
8. Type::
7183

72-
import igp; from igp import *
84+
import cutgeneratingfunctionology.igp as igp; from cutgeneratingfunctionology.igp import *
7385

7486
and hit shift+enter
7587

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0+git
1+
1.2+git
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Module
2+
3+
from __future__ import print_function, absolute_import
4+
5+
del print_function, absolute_import
6+
7+
from . import igp, multirow, dff

Gomory_conversion.sage renamed to cutgeneratingfunctionology/dff/Gomory_conversion.sage

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from six.moves import range
12
def conversion_from_DFF_to_GJ(phi):
23
bkpt=phi.end_points()
34
value=phi.values_at_end_points()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Dual feasible functions
2+
3+
from __future__ import absolute_import
4+
from sage.all import *
5+
from cutgeneratingfunctionology.igp import *
6+
7+
dff_dir = os.path.dirname(__file__)
8+
if dff_dir:
9+
dff_dir += "/"
10+
11+
load(dff_dir + "gdff_linear_test.sage")
12+
load(dff_dir + "dff_functions.sage")
13+
load(dff_dir + "dff_test_plot.sage")
14+
load(dff_dir + "discontinuous_dff.sage")
15+
load(dff_dir + "computer_based_search_naive_dff.sage")
16+
load(dff_dir + "Gomory_conversion.sage")

computer_based_search_naive_dff.sage renamed to cutgeneratingfunctionology/dff/computer_based_search_naive_dff.sage

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# Make sure current directory is in path.
2-
# That's not true while doctesting (sage -t).
3-
if '' not in sys.path:
4-
sys.path = [''] + sys.path
5-
6-
from igp import *
7-
1+
from six.moves import range
82
def search_example_continuous_dff(q):
93
lp = MixedIntegerLinearProgram(base_ring=QQ)
104
x = lp.new_variable()

0 commit comments

Comments
 (0)