diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 13982f3..b912e81 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-19T17:11:20","documenter_version":"1.1.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-28T11:55:33","documenter_version":"1.1.2"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 86553a7..94375d2 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · NLPModelsJuMP.jl

NLPModelsJuMP.jl documentation

This package defines a NLPModels model using MathOptInterface and JuMP.jl. This documentation is specific for this model. Please refer to the NLPModels documentation if in doubt.

Install

Install NLPModelsJuMP.jl with the following commands.

pkg> add NLPModelsJuMP

Bug reports and discussions

If you think you found a bug, feel free to open an issue. Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.

If you want to ask a question not suited for a bug report, feel free to start a discussion here. This forum is for general discussion about this repository and the JuliaSmoothOptimizers organization, so questions about any of our packages are welcome.

Contents

+Home · NLPModelsJuMP.jl

NLPModelsJuMP.jl documentation

This package defines a NLPModels model using MathOptInterface and JuMP.jl. This documentation is specific for this model. Please refer to the NLPModels documentation if in doubt.

Install

Install NLPModelsJuMP.jl with the following commands.

pkg> add NLPModelsJuMP

Bug reports and discussions

If you think you found a bug, feel free to open an issue. Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.

If you want to ask a question not suited for a bug report, feel free to start a discussion here. This forum is for general discussion about this repository and the JuliaSmoothOptimizers organization, so questions about any of our packages are welcome.

Contents

diff --git a/dev/reference/index.html b/dev/reference/index.html index 11c6c15..58e679d 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -1,2 +1,2 @@ -Reference · NLPModelsJuMP.jl

Reference

Contents

Index

NLPModelsJuMP.MathOptNLPModelMethod
MathOptNLPModel(model, hessian=true, name="Generic")

Construct a MathOptNLPModel from a JuMP model.

hessian should be set to false for multivariate user-defined functions registered without hessian.

source
NLPModelsJuMP.MathOptNLSModelMethod
MathOptNLSModel(model, F, hessian=true, name="Generic")

Construct a MathOptNLSModel from a JuMP model and a container of JuMP GenericAffExpr (generated by @expression) and NonlinearExpression (generated by @NLexpression).

hessian should be set to false for multivariate user-defined functions registered without hessian.

source
NLPModelsJuMP.coo_sym_add_mul!Method
coo_sym_add_mul!(rows, cols, vals, x, y, α)

Update of the form y ← y + αAx where A is a symmetric matrix given by (rows, cols, vals). Only one triangle of A should be passed.

source
NLPModelsJuMP.coo_sym_dotMethod
coo_sym_dot(rows, cols, vals, x, y)

Compute the product xᵀAy of a symmetric matrix A given by (rows, cols, vals). Only one triangle of A should be passed.

source
NLPModelsJuMP.parser_SAFMethod
parser_SAF(fun, set, linrows, lincols, linvals, nlin, lin_lcon, lin_ucon, index_map)

Parse a ScalarAffineFunction fun with its associated set. linrows, lincols, linvals, lin_lcon and lin_ucon are updated.

source
NLPModelsJuMP.parser_VAFMethod
parser_VAF(fun, set, linrows, lincols, linvals, nlin, lin_lcon, lin_ucon, index_map)

Parse a VectorAffineFunction fun with its associated set. linrows, lincols, linvals, lin_lcon and lin_ucon are updated.

source
+Reference · NLPModelsJuMP.jl

Reference

Contents

Index

NLPModelsJuMP.MathOptNLPModelMethod
MathOptNLPModel(model, hessian=true, name="Generic")

Construct a MathOptNLPModel from a JuMP model.

hessian should be set to false for multivariate user-defined functions registered without hessian.

source
NLPModelsJuMP.MathOptNLSModelMethod
MathOptNLSModel(model, F, hessian=true, name="Generic")

Construct a MathOptNLSModel from a JuMP model and a container of JuMP GenericAffExpr (generated by @expression) and NonlinearExpression (generated by @NLexpression).

hessian should be set to false for multivariate user-defined functions registered without hessian.

source
NLPModelsJuMP.coo_sym_add_mul!Method
coo_sym_add_mul!(rows, cols, vals, x, y, α)

Update of the form y ← y + αAx where A is a symmetric matrix given by (rows, cols, vals). Only one triangle of A should be passed.

source
NLPModelsJuMP.coo_sym_dotMethod
coo_sym_dot(rows, cols, vals, x, y)

Compute the product xᵀAy of a symmetric matrix A given by (rows, cols, vals). Only one triangle of A should be passed.

source
NLPModelsJuMP.parser_SAFMethod
parser_SAF(fun, set, linrows, lincols, linvals, nlin, lin_lcon, lin_ucon, index_map)

Parse a ScalarAffineFunction fun with its associated set. linrows, lincols, linvals, lin_lcon and lin_ucon are updated.

source
NLPModelsJuMP.parser_VAFMethod
parser_VAF(fun, set, linrows, lincols, linvals, nlin, lin_lcon, lin_ucon, index_map)

Parse a VectorAffineFunction fun with its associated set. linrows, lincols, linvals, lin_lcon and lin_ucon are updated.

source
diff --git a/dev/tutorial/index.html b/dev/tutorial/index.html index 676a02d..acb4bff 100644 --- a/dev/tutorial/index.html +++ b/dev/tutorial/index.html @@ -1,5 +1,5 @@ -Tutorial · NLPModelsJuMP.jl

Tutorial

NLPModelsJuMP is a combination of NLPModels and JuMP, as the name implies. Sometimes it may be required to refer to the specific documentation, as we'll present here only the documention specific to NLPModelsJuMP.

MathOptNLPModel

NLPModelsJuMP.MathOptNLPModelType
MathOptNLPModel(model, hessian=true, name="Generic")

Construct a MathOptNLPModel from a JuMP model.

hessian should be set to false for multivariate user-defined functions registered without hessian.

source

MathOptNLPModel is a simple yet efficient model. It uses JuMP to define the problem, and can be accessed through the NLPModels API. An advantage of MathOptNLPModel over simpler models such as ADNLPModels is that they provide sparse derivates.

Let's define the famous Rosenbrock function

\[f(x) = (x_1 - 1)^2 + 100(x_2 - x_1^2)^2,\]

with starting point $x^0 = (-1.2,1.0)$.

using NLPModels, NLPModelsJuMP, JuMP
+Tutorial · NLPModelsJuMP.jl

Tutorial

NLPModelsJuMP is a combination of NLPModels and JuMP, as the name implies. Sometimes it may be required to refer to the specific documentation, as we'll present here only the documention specific to NLPModelsJuMP.

MathOptNLPModel

NLPModelsJuMP.MathOptNLPModelType
MathOptNLPModel(model, hessian=true, name="Generic")

Construct a MathOptNLPModel from a JuMP model.

hessian should be set to false for multivariate user-defined functions registered without hessian.

source

MathOptNLPModel is a simple yet efficient model. It uses JuMP to define the problem, and can be accessed through the NLPModels API. An advantage of MathOptNLPModel over simpler models such as ADNLPModels is that they provide sparse derivates.

Let's define the famous Rosenbrock function

\[f(x) = (x_1 - 1)^2 + 100(x_2 - x_1^2)^2,\]

with starting point $x^0 = (-1.2,1.0)$.

using NLPModels, NLPModelsJuMP, JuMP
 
 x0 = [-1.2; 1.0]
 model = Model() # No solver is required
@@ -107,7 +107,7 @@
 
 println("cx = $(cons(nlp, nlp.meta.x0))")
 println("Jx = $(jac(nlp, nlp.meta.x0))")
cx = [-0.19999999999999996, -2.2]
-Jx = sparse([1, 2, 1, 2], [1, 1, 2, 2], [1.0, 1.0, 1.0, -1.2], 2, 2)

MathOptNLSModel

NLPModelsJuMP.MathOptNLSModelType
MathOptNLSModel(model, F, hessian=true, name="Generic")

Construct a MathOptNLSModel from a JuMP model and a container of JuMP GenericAffExpr (generated by @expression) and NonlinearExpression (generated by @NLexpression).

hessian should be set to false for multivariate user-defined functions registered without hessian.

source

MathOptNLSModel is a model for nonlinear least squares using JuMP, The objective function of NLS problems has the form $f(x) = \tfrac{1}{2}\|F(x)\|^2$, but specialized methods handle $F$ directly, instead of $f$. To use MathOptNLSModel, we define a JuMP model without the objective, and use NLexpressions to define the residual function $F$. For instance, the Rosenbrock function can be expressed in nonlinear least squares format by defining

\[F(x) = \begin{bmatrix} x_1 - 1\\ 10(x_2 - x_1^2) \end{bmatrix},\]

and noting that $f(x) = \|F(x)\|^2$ (the constant $\frac{1}{2}$ is ignored as it doesn't change the solution). We implement this function as

using NLPModels, NLPModelsJuMP, JuMP
+Jx = sparse([1, 2, 1, 2], [1, 1, 2, 2], [1.0, 1.0, 1.0, -1.2], 2, 2)

MathOptNLSModel

NLPModelsJuMP.MathOptNLSModelType
MathOptNLSModel(model, F, hessian=true, name="Generic")

Construct a MathOptNLSModel from a JuMP model and a container of JuMP GenericAffExpr (generated by @expression) and NonlinearExpression (generated by @NLexpression).

hessian should be set to false for multivariate user-defined functions registered without hessian.

source

MathOptNLSModel is a model for nonlinear least squares using JuMP, The objective function of NLS problems has the form $f(x) = \tfrac{1}{2}\|F(x)\|^2$, but specialized methods handle $F$ directly, instead of $f$. To use MathOptNLSModel, we define a JuMP model without the objective, and use NLexpressions to define the residual function $F$. For instance, the Rosenbrock function can be expressed in nonlinear least squares format by defining

\[F(x) = \begin{bmatrix} x_1 - 1\\ 10(x_2 - x_1^2) \end{bmatrix},\]

and noting that $f(x) = \|F(x)\|^2$ (the constant $\frac{1}{2}$ is ignored as it doesn't change the solution). We implement this function as

using NLPModels, NLPModelsJuMP, JuMP
 
 model = Model()
 x0 = [-1.2; 1.0]
@@ -121,4 +121,4 @@
  -2.2
  -4.3999999999999995
jac_residual(nls, nls.meta.x0)
2×2 SparseArrays.SparseMatrixCSC{Float64, Int64} with 3 stored entries:
   1.0    ⋅ 
- 24.0  10.0

NLSProblems

The package NLSProblems provides a collection of problems already defined as MathOptNLSModel.

+ 24.0 10.0

NLSProblems

The package NLSProblems provides a collection of problems already defined as MathOptNLSModel.