csnlp.wrappers.Wrapper#
- class csnlp.wrappers.Wrapper(nlp)[source]#
Bases:
Generic[SymType]Wraps an instance of
csnlp.Nlpto allow a modular transformation of its methods. This class is the base class for all wrappers. The subclass can then override some methods to change the behavior of the original environment without touching the original code.The base class is retroactive, in the sense that it can be applied to any NLP instance that already defines variables, parameters, and/or objective. Use
NonRetroactiveWrapperfor wrappers that need to wrap an NLP before it is defined.- Parameters:
- nlpNlp or subclass
The NLP to wrap.
Methods
is_wrapped(wrapper_type)Gets whether the NLP instance is wrapped or not by the given wrapper type.
Attributes
'Returns the original NLP of the wrapper.
Examples using csnlp.wrappers.Wrapper#
Comparison of CasADi’s and csnlp’s sensitivity computations
A simple example of sensitivity analysis (3d version)