Skip to content

Commit

Permalink
Merge pull request #75 from abelsiqueira/docs
Browse files Browse the repository at this point in the history
CUTEst docs
  • Loading branch information
dpo committed Sep 20, 2016
2 parents e15f54d + 5b7a6e5 commit 548c42e
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

deps/*
!deps/build.jl

docs/build
docs/site
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ script:
- julia --check-bounds=yes -E 'Pkg.test("CUTEst"; coverage=true)'

after_success:
- julia -e 'Pkg.add("Documenter")'
- julia -e 'cd(Pkg.dir("CUTEst")); include(joinpath("docs", "make.jl"))'
- julia -e 'cd(Pkg.dir("CUTEst")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/JuliaSmoothOptimizers/CUTEst.jl.svg?branch=develop)](https://travis-ci.org/JuliaSmoothOptimizers/CUTEst.jl)
[![Coverage Status](https://coveralls.io/repos/JuliaSmoothOptimizers/CUTEst.jl/badge.svg?branch=develop)](https://coveralls.io/r/JuliaSmoothOptimizers/CUTEst.jl?branch=develop)
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaSmoothOptimizers.github.io/CUTEst.jl/latest)


This is a work in progress to create an interface to CUTEst, a repository of
Expand Down
Binary file added docs/.documenter.enc
Binary file not shown.
11 changes: 11 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Documenter, CUTEst, NLPModels

makedocs(
modules = [CUTEst]
)

deploydocs(deps = Deps.pip("pygments", "mkdocs", "mkdocs-material", "python-markdown-math"),
repo = "github.com/JuliaSmoothOptimizers/CUTEst.jl.git",
julia = "release",
latest = "develop"
)
33 changes: 33 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
site_name: CUTEst.jl
repo_url: https://github.com/JuliaSmoothOptimizers/CUTEst.jl
site_description: Nonlinear Programming Models
site_author: JuliaSmoothOptimizers

theme: material

extra:
palette:
primary: 'orange'
accent: 'indigo'
author:
github: JuliaSmoothOptimizers

extra_css:
- assets/Documenter.css
- assets/style.css

extra_javascript:
- https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML
- assets/mathjaxhelper.js

markdown_extensions:
- extra
- tables
- fenced_code
- mdx_math

docs_dir: 'build'

pages:
- Home: index.md
- API: api.md
21 changes: 21 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# API

## NLPModels API

```@eval
using NLPModels
using Base.Markdown
s = []
mtds = [obj, grad, grad!, cons, cons!, jac_coord, jac, jprod, jprod!,
jtprod, jtprod!, hess_coord, hess, hprod, hprod!, NLPtoMPB, reset!]
for i = 1:length(mtds)
name = split(string(mtds[i]), ".")[2]
push!(s, md"### $name")
push!(s, @doc mtds[i])
sout = []
end
s
```
47 changes: 47 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# CUTEst.jl documentation

This package provides access interfaces to
[CUTEst](http://ccpforge.cse.rl.ac.uk/gf/project/cutest/wiki),
the Constrained and Unconstrained Test Environment with safe threads
for nonlinear optimization.

This package uses
[NLPModels.jl](https://github.com/JuliaSmoothOptimizers/NLPModels.jl), but it
also gives a different interface for accessing the problems.

## Installing

Currently, this package builds its own version of CUTEst, if you have your own
version of CUTEst, this will conflict with it. Check the issues for a fix, or
open one for help.

The following commands should automatically download NLPModels.jl and CUTEst,
and install them.
````julia
Pkg.clone("https://github.com/JuliaSmoothOptimizers/NLPModels.jl.git")
Pkg.checkout("NLPModels", "develop")
Pkg.clone("https://github.com/JuliaSmoothOptimizers/CUTEst.jl.git")
Pkg.checkout("CUTEst", "develop")
Pkg.build("CUTEst")
````

## Usage

The simples use of CUTEst is using the interface of NLPModels.jl

```@example
using CUTEst
nlp = CUTEstModel("ROSENBR")
println("x0 = $(nlp.meta.x0)")
println("fx = $( obj(nlp, nlp.meta.x0) )")
println("gx = $( grad(nlp, nlp.meta.x0) )")
println("Hx = $( hess(nlp, nlp.meta.x0) )")
cutest_finalize(nlp)
```

Check the [API](api/#nlpmodels-api)

There is also a specialized API which provides a more CUTEst-like interface, and
a core API which is only a wrapper for CUTEst.
The documentation of these is under construction.

0 comments on commit 548c42e

Please sign in to comment.