csnlp.core#

This module contains the core components, aside csnlp.Nlp and its base classes, that are used to build the package.

Overview#

It contains the following submodules:

  • csnlp.core.cache: a collection of methods to handle caching in the package. In particular, it offers a decorator invalidate_cache that allows to invalidate the cache of a given set of other cached properties or methods when the decorated method is invoked, as well as a function invalidate_caches_of that allows to invalidate the cache of a given object on the fly.

  • csnlp.core.data: a collection of functions for manipulating data in CasADi, in particular, on how to convert to and from numpy arrays and CasADi symbolic variables, and how to find the indices of a symbolic variable in a vector of symbols.

  • csnlp.core.debug: scontains classes for storing debug information on the parameters, variables and constraints in an instance of the csnlp.Nlp class.

  • csnlp.core.derivatives: a collection of two methods for computing higher-order sensitivities (i.e., Jacobian and Hessian) w.r.t. CasADi symbolic variables. Natively, CasADi does not support jacobian or hessian for matrices (or at least, they will be flattened). These “higher-order” functions allows to compute the jacobian and hessian of a matrix w.r.t. another matrix.

  • csnlp.core.scaling: a collection of classes to perform scaling of variables in an csnlp.Nlp instance wrapped with csnlp.wrappers.NlpScaling. The classes in this module inform the wrapper on which variables or parameters to scale and how to scale them.

  • csnlp.core.solutions: contains classes and methods to store the solution of an NLP problem after a call to csnlp.Nlp.solve or csnlp.multistart.MultistartNlp.solve_multi.

Submodules#

cache

A collection of methods to handle caching in the package.

data

A collection of functions for manipulating data in CasADi, in particular, on how to convert to and from numpy arrays and CasADi symbolic variables, and how to find the indices of a symbolic variable in a vector of symbols.

debug

Contains classes for storing debug information on the parameters, variables and constraints in an instance of the csnlp.Nlp class.

derivatives

A collection of two methods for computing higher-order sensitivities (i.e., Jacobian and Hessian) w.r.t.

scaling

A collection of classes to perform scaling of variables in an csnlp.Nlp instance wrapped with csnlp.wrappers.NlpScaling.

solutions

Contains classes and methods to store the solution of an NLP problem after a call to csnlp.Nlp.solve or csnlp.multistart.MultistartNlp.solve_multi.