From bbe6cc63e0e4443ac89aef6b7dc2b30047a57e2a Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Mon, 19 Sep 2016 14:12:28 -0300 Subject: [PATCH] Start development of the docs --- .gitignore | 3 +++ docs/make.jl | 11 +++++++++++ docs/mkdocs.yml | 33 +++++++++++++++++++++++++++++++++ docs/src/api.md | 21 +++++++++++++++++++++ docs/src/index.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 docs/make.jl create mode 100644 docs/mkdocs.yml create mode 100644 docs/src/api.md create mode 100644 docs/src/index.md diff --git a/.gitignore b/.gitignore index e575673b..4be887e8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ deps/* !deps/build.jl + +docs/build +docs/site diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 00000000..5adfe3e6 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,11 @@ +using Documenter, CUTEst, NLPModels + +makedocs( + modules = [CUTEst] +) + +deploydocs(deps = Deps.pip("pygmenters", "mkdocs", "mkdocs-material", "python-markdown-math"), + repo = "github.com/JuliaSmoothOptimizers/CUTEst.jl.git", + julia = "release", + latest = "develop" +) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 00000000..473b0124 --- /dev/null +++ b/docs/mkdocs.yml @@ -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: 'light blue' + 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 diff --git a/docs/src/api.md b/docs/src/api.md new file mode 100644 index 00000000..ebbe8243 --- /dev/null +++ b/docs/src/api.md @@ -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 +``` diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 00000000..6d06cfc3 --- /dev/null +++ b/docs/src/index.md @@ -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, +installing it. +````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 os these is under construction.