Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ task:
install_script:
- sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)"
build_script:
- julia .github/workflows/install-nlpmodels.jl
- cirrusjl build
test_script:
- cirrusjl test
8 changes: 6 additions & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
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
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
120 changes: 60 additions & 60 deletions .github/workflows/breakage.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
name: Breakage
on:
pull_request:
types: [opened, synchronize, reopened]
# on:
# pull_request:
# types: [opened, synchronize, reopened]

jobs:
break:
name: Breakage of ${{ matrix.pkg }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pkg: [AmplNLReader, CUTEst, CaNNOLeS, NLPModelsIpopt, NLPModelsJuMP, QuadraticModels, SolverTools]
pkgversion: ["master", "stable"]
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: 1
arch: x64
- 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/julia-buildpkg@v1
- name: Breakage test
env:
PKG: ${{ matrix.pkg }}
VERSION: ${{ matrix.pkgversion }}
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using Pkg; pkg"add Git, JSON"; include("test/test-breakage.jl")'
deploy:
needs: break
name: Deploying breakage information
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: 1
arch: x64
- 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/julia-buildpkg@v1
- name: Breakage test
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using Pkg; pkg"add Git, GitHub, JSON"; include("test/test-breakage-deploy.jl")'
# jobs:
# break:
# name: Breakage of ${{ matrix.pkg }}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# pkg: [AmplNLReader, CUTEst, CaNNOLeS, NLPModelsIpopt, NLPModelsJuMP, QuadraticModels, SolverTools]
# pkgversion: ["master", "stable"]
# steps:
# - uses: actions/checkout@v2
# - uses: julia-actions/setup-julia@v1
# with:
# version: 1
# arch: x64
# - 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/julia-buildpkg@v1
# - name: Breakage test
# env:
# PKG: ${{ matrix.pkg }}
# VERSION: ${{ matrix.pkgversion }}
# GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
# run: julia -e 'using Pkg; pkg"add Git, JSON"; include("test/test-breakage.jl")'
# deploy:
# needs: break
# name: Deploying breakage information
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: julia-actions/setup-julia@v1
# with:
# version: 1
# arch: x64
# - 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/julia-buildpkg@v1
# - name: Breakage test
# env:
# GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
# run: julia -e 'using Pkg; pkg"add Git, GitHub, JSON"; include("test/test-breakage-deploy.jl")'
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: using-unmerged-nlpmodels-core
run: julia .github/workflows/install-nlpmodels.jl
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/install-nlpmodels.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using Pkg
pkg"activate ."
pkg"add NLPModels#core"
4 changes: 2 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "Nonlinear Optimization Models for Julia",
"title": "NLPModels.jl",
"description": "Model modifiers for NLPModels",
"title": "NLPModelsModifiers.jl",
"upload_type": "software",
"creators": [
{
Expand Down
9 changes: 4 additions & 5 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
@Misc{orban-siqueira-nlpmodels-2020,
@Misc{orban-siqueira-nlpmodelsmodifiers-2021,
author = {D. Orban and A. S. Siqueira and {contributors}},
title = {{NLPModels.jl}: Data Structures for Optimization Models},
title = {{NLPModelsModifiers.jl}: Model modifiers for NLPModels},
month = {July},
howpublished = {\url{https://github.com/JuliaSmoothOptimizers/NLPModels.jl}},
howpublished = {\url{https://github.com/JuliaSmoothOptimizers/NLPModelsModifiers.jl}},
year = {2020},
DOI = {10.5281/zenodo.2558627},
DOI = {---},
}

4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright (c) 2015-2019: Dominique Orban and Abel Soares Siqueira
Copyright (c) 2015-2021: Dominique Orban and Abel Soares Siqueira

NLPModels.jl is licensed under the [MPL version 2.0](https://www.mozilla.org/MPL/2.0/).
NLPModelsModifiers.jl is licensed under the [MPL version 2.0](https://www.mozilla.org/MPL/2.0/).

## License

Expand Down
16 changes: 10 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
name = "NLPModels"
uuid = "a4795742-8479-5a88-8948-cc11e1c8c1a6"
version = "0.13.2"
name = "NLPModelsModifiers"
uuid = "e01155f1-5c6f-4375-a9d8-616dd036575f"
version = "0.1.0"

[deps]
FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearOperators = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125"
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
FastClosures = "0.2.1, 0.3.0"
ForwardDiff = "0.9.0, 0.10.0"
LinearOperators = "1.1.0"
julia = "^1.3.0"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
121 changes: 22 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,113 +1,36 @@
# NLPModels
# NLPModelsModifiers

This package provides general guidelines to represent optimization problems in Julia and a standardized API to evaluate the functions and their derivatives.
The main objective is to be able to rely on that API when designing optimization solvers in Julia.
This package provides optimization models based on [NLPModels](https://github.com/JuliaSmoothOptimizers/NLPModels.jl).
The API can be found on their [documentation page](https://juliasmoothoptimizers.github.io/NLPModels.jl/dev/api).

The models in this package specialize on modifying existing methods.

## How to Cite

If you use NLPModels.jl in your work, please cite using the format given in [CITATION.bib](https://github.com/JuliaSmoothOptimizers/NLPModels.jl/blob/master/CITATION.bib).
[![DOI](https://zenodo.org/badge/DOI/---.svg)](https://doi.org/---)
[![GitHub release](https://img.shields.io/github/release/JuliaSmoothOptimizers/NLPModelsModifiers.jl.svg)](https://github.com/JuliaSmoothOptimizers/NLPModelsModifiers.jl/releases/latest)
[![](https://img.shields.io/badge/docs-stable-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/NLPModelsModifiers.jl/stable)
[![](https://img.shields.io/badge/docs-latest-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/NLPModelsModifiers.jl/dev)
[![codecov](https://codecov.io/gh/JuliaSmoothOptimizers/NLPModelsModifiers.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaSmoothOptimizers/NLPModelsModifiers.jl)

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2558627.svg)](https://doi.org/10.5281/zenodo.2558627)
[![GitHub release](https://img.shields.io/github/release/JuliaSmoothOptimizers/NLPModels.jl.svg)](https://github.com/JuliaSmoothOptimizers/NLPModels.jl/releases/latest)
[![](https://img.shields.io/badge/docs-stable-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/NLPModels.jl/stable)
[![](https://img.shields.io/badge/docs-latest-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/NLPModels.jl/latest)
[![codecov](https://codecov.io/gh/JuliaSmoothOptimizers/NLPModels.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaSmoothOptimizers/NLPModels.jl)
![CI](https://github.com/JuliaSmoothOptimizers/NLPModelsModifiers.jl/workflows/CI/badge.svg?branch=master)
[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/JuliaSmoothOptimizers/NLPModelsModifiers.jl?logo=Cirrus%20CI)](https://cirrus-ci.com/github/JuliaSmoothOptimizers/NLPModelsModifiers.jl)

![CI](https://github.com/JuliaSmoothOptimizers/NLPModels.jl/workflows/CI/badge.svg?branch=master)
[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/JuliaSmoothOptimizers/NLPModels.jl?logo=Cirrus%20CI)](https://cirrus-ci.com/github/JuliaSmoothOptimizers/NLPModels.jl)
## Models

## Optimization Problems
The following models are implemented.

Optimization problems are represented by an instance of (a subtype of) `AbstractNLPModel`.
Such instances are composed of
* an instance of `NLPModelMeta`, which provides information about the problem, including the number of variables, constraints, bounds on the variables, etc.
* other data specific to the provenance of the problem.
- [`FeasibilityFormNLS`](@ref): Creates residual variables and constraints, so that the residual is linear.
- [`FeasibilityResidual`](@ref): Creates a nonlinear least squares model from an equality constrained problem in which the residual function is the constraints function.
- [`LBFGSModel`](@ref): Creates a model using a LBFGS approximation to the Hessian using an existing NLPModel.
- [`LSR1Model`](@ref): Creates a model using a LSR1 approximation to the Hessian using an existing NLPModel.
- [`SlackModel`](@ref): Creates an equality constrained problem with bounds on the variables using an existing NLPModel.
- [`SlackNLSModel`](@ref): Creates an equality constrained nonlinear least squares problem with bounds on the variables using an existing NLSModel.

See the
[documentation](https://JuliaSmoothOptimizers.github.io/NLPModels.jl/latest) for
details on the models, a tutorial and the API.
See the [documentation](https://JuliaSmoothOptimizers.github.io/NLPModels.jl/dev/) for details on the models.

## Installation

```julia
pkg> add NLPModels
```

## External models

In addition to the models available in this package, there are some external models
for specific needs:

- [AmplNLReader.jl](https://github.com/JuliaSmoothOptimizers/AmplNLReader.jl): Interface
for [AMPL](http://www.ampl.com/);
- [CUTEst.jl](https://github.com/JuliaSmoothOptimizers/CUTEst.jl): Interface for CUTEst
problems;
- [NLPModelsJuMP.jl](https://github.com/JuliaSmoothOptimizers/NLPModelsJuMP.jl):
Converts MathOptInterface/JuMP models to and from NLPModels.

## Main Methods

If `model` is an instance of an appropriate subtype of `AbstractNLPModel`, the following methods are normally defined:

* `obj(model, x)`: evaluate *f(x)*, the objective at `x`
* `cons(model x)`: evaluate *c(x)*, the vector of general constraints at `x`

The following methods are defined if first-order derivatives are available:

* `grad(model, x)`: evaluate *∇f(x)*, the objective gradient at `x`
* `jac(model, x)`: evaluate *J(x)*, the Jacobian of *c* at `x` as a sparse matrix

If Jacobian-vector products can be computed more efficiently than by evaluating the Jacobian explicitly, the following methods may be implemented:

* `jprod(model, x, v)`: evaluate the result of the matrix-vector product *J(x)⋅v*
* `jtprod(model, x, u)`: evaluate the result of the matrix-vector product *J(x)ᵀ⋅u*

The following method is defined if second-order derivatives are available:

* `hess(model, x, y)`: evaluate *∇²L(x,y)*, the Hessian of the Lagrangian at `x` and `y`

If Hessian-vector products can be computed more efficiently than by evaluating the Hessian explicitly, the following method may be implemented:

* `hprod(model, x, v, y)`: evaluate the result of the matrix-vector product *∇²L(x,y)⋅v*

Several in-place variants of the methods above may also be implemented.

The complete list of methods that an interface may implement can be found in the documentation.

## Attributes

`NLPModelMeta` objects have the following attributes:

Attribute | Type | Notes
------------|--------------------|------------------------------------
`nvar` | `Int ` | number of variables
`x0 ` | `Array{Float64,1}` | initial guess
`lvar` | `Array{Float64,1}` | vector of lower bounds
`uvar` | `Array{Float64,1}` | vector of upper bounds
`ifix` | `Array{Int64,1}` | indices of fixed variables
`ilow` | `Array{Int64,1}` | indices of variables with lower bound only
`iupp` | `Array{Int64,1}` | indices of variables with upper bound only
`irng` | `Array{Int64,1}` | indices of variables with lower and upper bound (range)
`ifree` | `Array{Int64,1}` | indices of free variables
`iinf` | `Array{Int64,1}` | indices of visibly infeasible bounds
`ncon` | `Int ` | total number of general constraints
`nlin ` | `Int ` | number of linear constraints
`nnln` | `Int ` | number of nonlinear general constraints
`nnet` | `Int ` | number of nonlinear network constraints
`y0 ` | `Array{Float64,1}` | initial Lagrange multipliers
`lcon` | `Array{Float64,1}` | vector of constraint lower bounds
`ucon` | `Array{Float64,1}` | vector of constraint upper bounds
`lin ` | `Range1{Int64} ` | indices of linear constraints
`nln` | `Range1{Int64} ` | indices of nonlinear constraints (not network)
`nnet` | `Range1{Int64} ` | indices of nonlinear network constraints
`jfix` | `Array{Int64,1}` | indices of equality constraints
`jlow` | `Array{Int64,1}` | indices of constraints of the form c(x) ≥ cl
`jupp` | `Array{Int64,1}` | indices of constraints of the form c(x) ≤ cu
`jrng` | `Array{Int64,1}` | indices of constraints of the form cl ≤ c(x) ≤ cu
`jfree` | `Array{Int64,1}` | indices of "free" constraints (there shouldn't be any)
`jinf` | `Array{Int64,1}` | indices of the visibly infeasible constraints
`nnzj` | `Int ` | number of nonzeros in the sparse Jacobian
`nnzh` | `Int ` | number of nonzeros in the sparse Hessian
`minimize` | `Bool ` | true if `optimize == minimize`
`islp` | `Bool ` | true if the problem is a linear program
`name` | `ASCIIString ` | problem name
```
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "~0.25"
Documenter = "~0.26"
15 changes: 7 additions & 8 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
using Documenter, NLPModels
using Documenter, NLPModelsModifiers

makedocs(
modules = [NLPModels],
modules = [NLPModelsModifiers],
doctest = true,
linkcheck = false,
strict = true,
format = Documenter.HTML(assets = ["assets/style.css"], prettyurls = get(ENV, "CI", nothing) == "true"),
sitename = "NLPModels.jl",
sitename = "NLPModelsModifiers.jl",
pages = ["Home" => "index.md",
"Models" => "models.md",
"Guidelines" => "guidelines.md",
"Tools" => "tools.md",
"Tutorial" => "tutorial.md",
"API" => "api.md",
"Reference" => "reference.md"
]
)

deploydocs(repo = "github.com/JuliaSmoothOptimizers/NLPModels.jl.git")
deploydocs(
repo = "github.com/JuliaSmoothOptimizers/NLPModelsModifiers.jl.git",
push_preview = true
)
Loading