Reference

​

Contents

​

​

Index

​

​

NLPModels.grad! — Method
g = grad!(nlp, x, g)

Evaluate ∇f(x), the gradient of the objective function at x in place.

source
NLPModels.grad! — Method
g = grad!(nlp, x, g)

Evaluate ∇f(x), the gradient of the objective function at x in place.

source
NLPModels.grad — Method
g = grad(nlp, x)

Evaluate ∇f(x), the gradient of the objective function at x.

source
NLPModels.grad — Method
g = grad(nlp, x)

Evaluate ∇f(x), the gradient of the objective function at x.

source
NLPModels.hprod! — Method
hprod!(nlp::AbstractPQNNLPModel, x::AbstractVector, v::AbstractVector, Hv::AbstractVector; obj_weight=1.)

Evaluate the product of the objective Hessian at x with the vector v, with objective function scaled by obj_weight.

source
NLPModels.hprod! — Method
hprod!(nlp::AbstractPartiallySeparableNLPModel, x::AbstractVector, v::AbstractVector, Hv::AbstractVector; obj_weight=1.)

Evaluate the product of the objective Hessian at x with the vector v, with objective function scaled by obj_weight.

source
NLPModels.hprod — Method
hprod!(nlp::AbstractPQNNLPModel, x::AbstractVector, v::AbstractVector, Hv::AbstractVector; obj_weight=1.)

Evaluate the product of the objective Hessian at x with the vector v, with objective function scaled by obj_weight.

source
NLPModels.hprod — Method
hprod!(nlp::AbstractPartiallySeparableNLPModel, x::AbstractVector, v::AbstractVector, Hv::AbstractVector; obj_weight=1.)

Evaluate the product of the objective Hessian at x with the vector v, with objective function scaled by obj_weight.

source
NLPModels.obj — Method
f = obj(nlp, x)

Evaluate f(x), the objective function of nlp at x.

source
NLPModels.obj — Method
f = obj(nlp, x)

Evaluate f(x), the objective function of nlp at x.

source
PartiallySeparableNLPModels.ModAbstractPSNLPModels.ElementFunction — Type
ElementFunction

A type that gathers the information indentifying an element function in a PartiallySeparableNLPModel, and its properties. ElementFunction has fields:

  • i: the index of the element function;
  • index_element_tree: the index occupied in the element-function vector after the deletion of redundant element functions;
  • variable_indices: list of elemental variables of ElementFunction;
  • type: constant, linear, quadratic, cubic or general;
  • convexity_status: constant, linear, convex, concave or unknown.
source
PartiallySeparableNLPModels.Utils.distinct_element_expr_tree — Method
(element_expr_trees, indices_element_tree) = distinct_element_expr_tree(vec_element_expr_tree::Vector{T}, vec_element_variables::Vector{Vector{Int}}; N::Int = length(vec_element_expr_tree)) where {T}

In practice, there may have several element functions having the same expression tree. distinct_element_expr_tree filters the vector vec_element_expr_tree to return element_expr_trees the distincts element functions. length(element_expr_trees) == M < N == length(vec_element_expr_tree). In addition it returns indices_element_tree, who records the index (1 <= i <= M) related ot the expression tree of each element function.

source
PartiallySeparableNLPModels.Utils.merge_linear_elements — Method
(vec_element_functions, N, linear_vector) = merge_linear_elements(vec_element_functions::Vector{ExpressionTreeForge.Type_expr_tree}, N::Int)

Merge every linear element function from vec_element_functions into a single one. Return the new adequate vec_element_functions, N and linear_vector::Vector{Bool} of size N indicating with true which element is linear. If the method runs correctly, only linear_vector[N] may be set to true.

source
PartiallySeparableNLPModels.Utils.partitioned_structure — Method
partitioned_structure = build_PartitionedDataTRPQN(expr_tree, n)

Return the structure required to run a partitioned quasi-Newton trust-region method. It finds the partially-separable structure of an expression tree expr_tree representing f(x) = ∑fᵢ(xᵢ). Then it allocates the partitioned structures required. To define properly the sparse matrix of the partitioned matrix we need the size of the problem: n.

source
PartiallySeparableNLPModels.ModPBFGSNLPModels.PBFGSNLPModel — Type
PBFGSNLPModel{G, T, S, M <: AbstractNLPModel{T, S}, Meta <: AbstractNLPModelMeta{T, S},} <: AbstractPQNNLPModel{T,S}

Deduct and allocate the partitioned structures of a NLPModel using partitioned BFGS Hessian approximation. PBFGSNLPModel has fields:

  • model: the original model;
  • meta: gather information about the PBFGSNLPModel;
  • counters: count how many standards methods of NLPModels are called;
  • n: the size of the problem;
  • N: the number of element functions;
  • vec_elt_fun: a ElementFunction vector, of size N;
  • M: the number of distinct element-function expression trees;
  • vec_elt_complete_expr_tree: a Complete_expr_tree vector, of size M;
  • element_expr_tree_table: a vector of size M, the i-th element element_expr_tree_table[i]::Vector{Int} informs which element functions use the vec_elt_complete_expr_tree[i] expression tree;
  • index_element_tree: a vector of size N where each component indicates which Complete_expr_tree from vec_elt_complete_expr_tree is used for the corresponding element;
  • vec_compiled_element_gradients: the vector gathering the compiled tapes for every element gradient evaluations;
  • op: the partitioned matrix (main memory cost);
  • name: the name of partitioned quasi-Newton update performed
source
PartiallySeparableNLPModels.ModPCSNLPModels.PCSNLPModel — Type
PCSNLPModel{G, T, S, M <: AbstractNLPModel{T, S}, Meta <: AbstractNLPModelMeta{T, S},} <: AbstractPQNNLPModel{T,S}

Deduct and allocate the partitioned structures of a NLPModel using a PCS Hessian approximation. PCSNLPModel has fields:

  • model: the original model;
  • meta: gather information about the PCSNLPModel;
  • counters: count how many standards methods of NLPModels are called;
  • n: the size of the problem;
  • N: the number of element functions;
  • vec_elt_fun: a ElementFunction vector, of size N;
  • M: the number of distinct element-function expression trees;
  • vec_elt_complete_expr_tree: a Complete_expr_tree vector, of size M;
  • element_expr_tree_table: a vector of size M, the i-th element element_expr_tree_table[i]::Vector{Int} informs which element functions use the vec_elt_complete_expr_tree[i] expression tree;
  • index_element_tree: a vector of size N where each component indicates which Complete_expr_tree from vec_elt_complete_expr_tree is used for the corresponding element;
  • vec_compiled_element_gradients: the vector gathering the compiled tapes for every element gradient evaluations;
  • op: the partitioned matrix (main memory cost);
  • name: the name of partitioned quasi-Newton update performed
source
PartiallySeparableNLPModels.ModPLBFGSNLPModels.PLBFGSNLPModel — Type
PLBFGSNLPModel{G, T, S, M <: AbstractNLPModel{T, S}, Meta <: AbstractNLPModelMeta{T, S},} <: AbstractPQNNLPModel{T,S}

Deduct and allocate the partitioned structures of a NLPModel using a PLBFGS Hessian approximation. PLBFGSNLPModel has fields:

  • model: the original model;
  • meta: gather information about the PLBFGSNLPModel;
  • counters: count how many standards methods of NLPModels are called;
  • n: the size of the problem;
  • N: the number of element functions;
  • vec_elt_fun: a ElementFunction vector, of size N;
  • M: the number of distinct element-function expression trees;
  • vec_elt_complete_expr_tree: a Complete_expr_tree vector, of size M;
  • element_expr_tree_table: a vector of size M, the i-th element element_expr_tree_table[i]::Vector{Int} informs which element functions use the vec_elt_complete_expr_tree[i] expression tree;
  • index_element_tree: a vector of size N where each component indicates which Complete_expr_tree from vec_elt_complete_expr_tree is used for the corresponding element;
  • vec_compiled_element_gradients: the vector gathering the compiled tapes for every element gradient evaluations;
  • op: the partitioned matrix (main memory cost);
  • name: the name of partitioned quasi-Newton update performed
source
PartiallySeparableNLPModels.ModPLSENLPModels.PLSENLPModel — Type
PLSENLPModel{G, T, S, M <: AbstractNLPModel{T, S}, Meta <: AbstractNLPModelMeta{T, S},} <: AbstractPQNNLPModel{T,S}

Deduct and allocate the partitioned structures of a NLPModel using a PLSE Hessian approximation. PLSENLPModel has fields:

  • model: the original model;
  • meta: gather information about the PLSENLPModel;
  • counters: count how many standards methods of NLPModels are called;
  • n: the size of the problem;
  • N: the number of element functions;
  • vec_elt_fun: a ElementFunction vector, of size N;
  • M: the number of distinct element-function expression trees;
  • vec_elt_complete_expr_tree: a Complete_expr_tree vector, of size M;
  • element_expr_tree_table: a vector of size M, the i-th element element_expr_tree_table[i]::Vector{Int} informs which element functions use the vec_elt_complete_expr_tree[i] expression tree;
  • index_element_tree: a vector of size N where each component indicates which Complete_expr_tree from vec_elt_complete_expr_tree is used for the corresponding element;
  • vec_compiled_element_gradients: the vector gathering the compiled tapes for every element gradient evaluations;
  • op: the partitioned matrix (main memory cost);
  • name: the name of partitioned quasi-Newton update performed
source
PartiallySeparableNLPModels.ModPLSR1NLPModels.PLSR1NLPModel — Type
PLSR1NLPModel{G, T, S, M <: AbstractNLPModel{T, S}, Meta <: AbstractNLPModelMeta{T, S},} <: AbstractPQNNLPModel{T,S}

Deduct and allocate the partitioned structures of a NLPModel using a PLSR1 Hessian approximation. PLSR1NLPModel has fields:

  • model: the original model;
  • meta: gather information about the PLSR1NLPModel;
  • counters: count how many standards methods of NLPModels are called;
  • n: the size of the problem;
  • N: the number of element functions;
  • vec_elt_fun: a ElementFunction vector, of size N;
  • M: the number of distinct element-function expression trees;
  • vec_elt_complete_expr_tree: a Complete_expr_tree vector, of size M;
  • element_expr_tree_table: a vector of size M, the i-th element element_expr_tree_table[i]::Vector{Int} informs which element functions use the vec_elt_complete_expr_tree[i] expression tree;
  • index_element_tree: a vector of size N where each component indicates which Complete_expr_tree from vec_elt_complete_expr_tree is used for the corresponding element;
  • vec_compiled_element_gradients: the vector gathering the compiled tapes for every element gradient evaluations;
  • op: the partitioned matrix (main memory cost);
  • name: the name of partitioned quasi-Newton update performed
source
PartiallySeparableNLPModels.ModPSENLPModels.PSENLPModel — Type
PSENLPModel{G, T, S, M <: AbstractNLPModel{T, S}, Meta <: AbstractNLPModelMeta{T, S},} <: AbstractPQNNLPModel{T,S}

Deduct and allocate the partitioned structures of a NLPModel using a PSE Hessian approximation. PSENLPModel has fields:

  • model: the original model;
  • meta: gather information about the PSENLPModel;
  • counters: count how many standards methods of NLPModels are called;
  • n: the size of the problem;
  • N: the number of element functions;
  • vec_elt_fun: a ElementFunction vector, of size N;
  • M: the number of distinct element-function expression trees;
  • vec_elt_complete_expr_tree: a Complete_expr_tree vector, of size M;
  • element_expr_tree_table: a vector of size M, the i-th element element_expr_tree_table[i]::Vector{Int} informs which element functions use the vec_elt_complete_expr_tree[i] expression tree;
  • index_element_tree: a vector of size N where each component indicates which Complete_expr_tree from vec_elt_complete_expr_tree is used for the corresponding element;
  • vec_compiled_element_gradients: the vector gathering the compiled tapes for every element gradient evaluations;
  • op: the partitioned matrix (main memory cost);
  • name: the name of partitioned quasi-Newton update performed
source
PartiallySeparableNLPModels.ModPSNLPModels.PSNLPModel — Type
PSNLPModel{G, T, S, M <: AbstractNLPModel{T, S}, Meta <: AbstractNLPModelMeta{T, S},} <: AbstractPQNNLPModel{T,S}

Deduct and allocate the partitioned structures of a NLPModel using partitioned hessian-vector product. PSNLPModel has fields:

  • model: the original model;
  • meta: gather information about the PSNLPModel;
  • counters: count how many standards methods of NLPModels are called;
  • n: the size of the problem;
  • N: the number of element functions;
  • vec_elt_fun: a ElementFunction vector, of size N;
  • M: the number of distinct element-function expression trees;
  • vec_elt_complete_expr_tree: a Complete_expr_tree vector, of size M;
  • element_expr_tree_table: a vector of size M, the i-th element element_expr_tree_table[i]::Vector{Int} informs which element functions use the vec_elt_complete_expr_tree[i] expression tree;
  • index_element_tree: a vector of size N where each component indicates which Complete_expr_tree from vec_elt_complete_expr_tree is used for the corresponding element;
  • vec_compiled_element_gradients: the vector gathering the compiled tapes for every element gradient evaluations;
  • op: the partitioned matrix (main memory cost);
  • name: the name of partitioned quasi-Newton update performed
source
PartiallySeparableNLPModels.ModPSR1NLPModels.PSR1NLPModel — Type
PSR1NLPModel{G, T, S, M <: AbstractNLPModel{T, S}, Meta <: AbstractNLPModelMeta{T, S},} <: AbstractPQNNLPModel{T,S}

Deduct and allocate the partitioned structures of a NLPModel using partitioned SR1 Hessian approximation. PSR1NLPModel has fields:

  • model: the original model;
  • meta: gather information about the PSR1NLPModel;
  • counters: count how many standards methods of NLPModels are called;
  • n: the size of the problem;
  • N: the number of element functions;
  • vec_elt_fun: a ElementFunction vector, of size N;
  • M: the number of distinct element-function expression trees;
  • vec_elt_complete_expr_tree: a Complete_expr_tree vector, of size M;
  • element_expr_tree_table: a vector of size M, the i-th element element_expr_tree_table[i]::Vector{Int} informs which element functions use the vec_elt_complete_expr_tree[i] expression tree;
  • index_element_tree: a vector of size N where each component indicates which Complete_expr_tree from vec_elt_complete_expr_tree is used for the corresponding element;
  • vec_compiled_element_gradients: the vector gathering the compiled tapes for every element gradient evaluations;
  • op: the partitioned matrix (main memory cost);
  • name: the name of partitioned quasi-Newton update performed
source
PartiallySeparableNLPModels.PartitionedBackends.ElementMOIModelBackend — Type
ElementMOIModelBackend{T}

Composed of:

  • vec_element_evaluators::Vector{MOI.Nonlinear.Evaluator{MOI.Nonlinear.ReverseAD.NLPEvaluator}}, M distinct element function MOI.Nonlinear.Model;
  • index_element_tree::Vector{Int}, from which any of the N element function may associate a gradient tape from vec_element_gradient_tapes.

Each MOI.Nonlinear.Evaluator{MOI.Nonlinear.ReverseAD.NLPEvaluator} accumulates the element-function's contribution in a element-vector of a PartitionedVector.

source
PartiallySeparableNLPModels.PartitionedBackends.ElementReverseDiffGradient — Type
ElementReverseDiffGradient{T}

Composed of:

  • vec_element_gradient_tapes::Vector{ReverseDiff.CompiledTape}, M distinct element function tapes;
  • index_element_tree::Vector{Int}, from which any of the N element function may associate a gradient tape from vec_element_gradient_tapes.

Each ReverseDiff.CompiledTape accumulates the element-function's contribution in a element-vector of a PartitionedVector.

source
PartiallySeparableNLPModels.PartitionedBackends.ElementReverseDiffGradient — Method
gradient_brackend = ElementReverseDiffGradient(vec_elt_expr_tree::Vector, index_element_tree::Vector{Int}; type::Type{T}=Float64) where {T}

Return an ElementReverseDiffGradient from a Vector of expression trees (supported by ExpressionTreeForge.jl) of size length(vec_elt_expr_tree)=M and index_element_tree which redirects each element function i to its corresponding expression tree (1 ≤ index_element_tree[i] ≤ M, 1 ≤ i ≤ N).

source
PartiallySeparableNLPModels.PartitionedBackends.ElementReverseForwardHprod — Type
ElementReverseForwardHprod{T,G}

Compute the partitioned Hessian-product with partitioned_hessian_prod! by applying successively ReverseDiff and ForwardDiff. It is composed of:

  • vec_elt_complete_expr_tree::Vector{G}, the expression trees of the distinct element functions (of size M);
  • index_element_tree::Vector{Int}, reffering to index in vec_elt_complete_expr_tree of any of the N element function;
source
PartiallySeparableNLPModels.PartitionedBackends.ElementReverseForwardHprod — Method
hprod_backend = ElementReverseForwardHprod(complete_trees::Vector, index_element_tree::Vector{Int}; type=Float64)

Return an ElementReverseForwardHprod from a Vector of expression trees (supported by ExpressionTreeForge.jl) vec_elt_expr_tree of size length(vec_elt_expr_tree)=M and index_element_tree which redirects each element function i to its corresponding expression tree (1 ≤ index_element_tree[i] ≤ M, 1 ≤ i ≤ N).

source
PartiallySeparableNLPModels.PartitionedBackends.ModifiedObjectiveMOIModelBackend — Type
ModifiedObjectiveMOIModelBackend{T}

Composed of:

  • vec_element_evaluators::Vector{MOI.Nonlinear.Evaluator{MOI.Nonlinear.ReverseAD.NLPEvaluator}}, M distinct element function MOI.Nonlinear.Model;
  • index_element_tree::Vector{Int}, from which any of the N element function may associate a gradient tape from vec_element_gradient_tapes.

Each MOI.Nonlinear.Evaluator{MOI.Nonlinear.ReverseAD.NLPEvaluator} accumulates the element-function's contribution in a element-vector of a PartitionedVector.

source
PartiallySeparableNLPModels.PartitionedBackends.ModifiedObjectiveMOIModelBackend — Method
backend = ModifiedObjectiveMOIModelBackend(vec_elt_expr_tree::Vector, index_element_tree::Vector{Int}; type=Float64)

Return an ModifiedObjectiveMOIModelBackend from a Vector of expression trees (supported by ExpressionTreeForge.jl) of size length(vec_elt_expr_tree)=N and their element variables affiliated. Suppose f(x) = f₁(x) + f₂(x) partially-separable considering the element functions f₁(x) = x₁ * x₂ * x₃² and f₂(x) = x₂ * x₃ * x₄ (N=2), ModifiedObjectiveMOIModelBackend defines a MOI.Nonlinear.Model where F(y) = y₁ * y₂ * y₃² + y₄ * y₅ * y₆ and its evaluator. Each partial derivative of F corresponds to a partial derivative of a single element function fᵢ.

source
PartiallySeparableNLPModels.PartitionedBackends.SparseJacobianMoiModelBackend — Type
SparseJacobianMoiModelBackend{T}

Composed of:

  • evaluator::MOI.Nonlinear.Evaluator{MOI.Nonlinear.ReverseAD.NLPEvaluator}, an evaluator of a MOI.Nonlinear.Model constrained by every element functions;
  • sparse_jacobian::Vector{T}, mandatory to store in place the sparse Jacobianwith MathOptInterface;
  • translated_x::PartitionedVector{T}, to handle variables translations, especially when the model doesn't depend on every variable.
source
PartiallySeparableNLPModels.PartitionedBackends.SparseJacobianMoiModelBackend — Method
backend = SparseJacobianMoiModelBackend(vec_elt_expr_tree::Vector, n::Int; elemental_variables::Vector{Vector{Int}}), type=Float64)

Return an SparseJacobianMoiModelBackend from a Vector of expression trees (supported by ExpressionTreeForge.jl) of size length(vec_elt_expr_tree)=N and their element variables affiliated. Suppose f(x) = f₁(x) + f₂(x) partially-separable considering the element functions f₁(x) = x₁ * x₂ * x₃² and f₂(x) = x₂ * x₃ * x₄ (N=2), SparseJacobianMoiModelBackend defines a MOI.Nonlinear.Model having f(x) as the objective f₁ and f₂ as two constraints.

source