csnlp.core.debug.NlpDebug#
- class csnlp.core.debug.NlpDebug[source]#
Bases:
objectNLP debug class for information about variables and constraints in an instance of the
csnlp.Nlpclass. In particular, it records information onthe parameters
pthe decision variable
xthe equality constraints
gthe inequality constraints
h.
Methods
g_describe(index)Returns debug information on the constraint at the given
index.h_describe(index)Returns debug information on the constraint at the given
index.p_describe(index)Returns debug information on the parameter at the given
index.register(group, name, shape)Registers debug information on new object name under the specific group.
x_describe(index)Returns debug information on the variable at the given
index.- g_describe(index)[source]#
Returns debug information on the constraint at the given
index.- Parameters:
- indexint
Index of the constraint g to query information about.
- Returns:
- NlpDebugEntry
A class instance containing debug information on the constraint g at the given index.
- Raises:
- IndexError
Index not found, or outside bounds of g.
- Return type:
- h_describe(index)[source]#
Returns debug information on the constraint at the given
index.- Parameters:
- indexint
Index of the constraint h to query information about.
- Returns:
- NlpDebugEntry
A class instance containing debug information on the constraint h at the given index.
- Raises:
- IndexError
Index not found, or outside bounds of h.
- Return type:
- p_describe(index)[source]#
Returns debug information on the parameter at the given
index.- Parameters:
- indexint
Index of the parameter p to query information about.
- Returns:
- NlpDebugEntry
A class instance containing debug information on the parameter p at the given index.
- Raises:
- IndexError
Index not found, or outside bounds of p.
- Return type:
- register(group, name, shape)[source]#
Registers debug information on new object name under the specific group.
- Parameters:
- group{“p”, “x”, “g”, “h”}
Indentifies the group the object belongs to: parameters, variables, equality constraints or inequality constraints.
- namestr
Name of the object.
- shapeTuple[int, …]
Shape of the object.
- Raises:
- AttributeError
Raises in case the given group is invalid.
- Return type:
- x_describe(index)[source]#
Returns debug information on the variable at the given
index.- Parameters:
- indexint
Index of the variable x to query information about.
- Returns:
- NlpDebugEntry
A class instance containing debug information on the variable x at the given index.
- Raises:
- IndexError
Index not found, or outside bounds of x.
- Return type: