Skip to content

Commit

Permalink
General maintenance for the move to jump-dev (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Sep 11, 2024
1 parent ae1cedb commit 7c03ce9
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 101 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/CompatHelper.yml

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,36 @@ on:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version: ['1.6', '1'] # Test against LTS and current minor release
version: ['1.6', '1']
os: [ubuntu-latest, macOS-latest, windows-latest]
arch: [x64]
include:
# Also test against 32-bit Linux on LTS.
- version: '1.6'
# Also test against 32-bit Linux.
- version: '1'
os: ubuntu-latest
arch: x86
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Cbc"]
test = ["Cbc", "Test"]
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# PiecewiseLinearOpt

A package for modeling optimization problems containing piecewise linear functions. Current support is for (the graphs of) continuous univariate functions.
[![Build Status](https://github.com/jump-dev/PiecewiseLinearOpt.jl/workflows/CI/badge.svg?branch=master)](https://github.com/jump-dev/PiecewiseLinearOpt.jl/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/jump-dev/PiecewiseLinearOpt.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/jump-dev/PiecewiseLinearOpt.jl)

This package is an accompaniment to a paper entitled [_Nonconvex piecewise linear functions: Advanced formulations and simple modeling tools_](https://arxiv.org/abs/1708.00050), by Joey Huchette and Juan Pablo Vielma.
A package for modeling optimization problems containing piecewise linear
functions. Current support is for (the graphs of) continuous univariate
functions.

[![Build Status](https://travis-ci.org/joehuchette/PiecewiseLinearOpt.jl.svg?branch=master)](https://travis-ci.org/joehuchette/PiecewiseLinearOpt.jl)
This package is an accompaniment to a paper entitled
[_Nonconvex piecewise linear functions: Advanced formulations and simple modeling tools_](https://arxiv.org/abs/1708.00050),
by Joey Huchette and Juan Pablo Vielma.

[![Coverage Status](https://coveralls.io/repos/joehuchette/PiecewiseLinearOpt.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/joehuchette/PiecewiseLinearOpt.jl?branch=master)
This package offers helper functions for the
[JuMP algebraic modeling language](https://github.com/jump-dev/JuMP.jl).

[![codecov.io](http://codecov.io/github/joehuchette/PiecewiseLinearOpt.jl/coverage.svg?branch=master)](http://codecov.io/github/joehuchette/PiecewiseLinearOpt.jl?branch=master)

This package offers helper functions for the [JuMP algebraic modeling language](https://github.com/JuliaOpt/JuMP.jl).

Consider a piecewise linear function. The function is described in terms of the breakpoints between pieces, and the function value at those breakpoints.
Consider a piecewise linear function. The function is described in terms of the
breakpoints between pieces, and the function value at those breakpoints.

Consider a JuMP model

Expand All @@ -22,14 +25,18 @@ m = Model()
@variable(m, x)
```

To model the graph of a piecewise linear function ``f(x)``, take ``d`` as some set of breakpoints along the real line, and ``fd = [f(x) for x in d]`` as the corresponding function values. You can model this function in JuMP using the following function:
To model the graph of a piecewise linear function ``f(x)``, take ``d`` as some
set of breakpoints along the real line, and ``fd = [f(x) for x in d]`` as the
corresponding function values. You can model this function in JuMP using the
following function:

```julia
z = piecewiselinear(m, x, d, fd)
@objective(m, Min, z) # minimize f(x)
```

For another example, think of a piecewise linear approximation for for the function $f(x,y) = exp(x+y)$:
For another example, think of a piecewise linear approximation for the function
$f(x,y) = exp(x+y)$:

```julia
using JuMP, PiecewiseLinearOpt
Expand All @@ -41,7 +48,9 @@ z = piecewiselinear(m, x, y, 0:0.1:1, 0:0.1:1, (u,v) -> exp(u+v))
@objective(m, Min, z)
```

Current support is limited to modeling the graph of a continuous piecewise linear function, either univariate or bivariate, with the goal of adding support for the epigraphs of lower semicontinuous piecewise linear functions.
Current support is limited to modeling the graph of a continuous piecewise
linear function, either univariate or bivariate, with the goal of adding support
for the epigraphs of lower semicontinuous piecewise linear functions.

Supported univariate formulations:

Expand All @@ -60,7 +69,11 @@ Supported bivariate formulations for entire constraint:
* Multiple choice (``:MC``)
* Dissaggregated Logarithmic (``:DisaggLogarithmic``)

Also, you can use any univariate formulation for bivariate functions as well. They will be used to impose two axis-aligned SOS2 constraints, along with the "6-stencil" formulation for the triangle selection portion of the constraint. See the associated paper for more details. In particular, the following are also acceptable bivariate formulation choices:
Also, you can use any univariate formulation for bivariate functions as well.
They will be used to impose two axis-aligned SOS2 constraints, along with the
"6-stencil" formulation for the triangle selection portion of the constraint.
See the associated paper for more details. In particular, the following are also
acceptable bivariate formulation choices:

* Native SOS2 branching (``:SOS2``)
* Incremental (``:Incremental``)
Expand Down
36 changes: 0 additions & 36 deletions appveyor.yml

This file was deleted.

0 comments on commit 7c03ce9

Please sign in to comment.