csnlp.core.debug.NlpDebug#

class csnlp.core.debug.NlpDebug[source]#

Bases: object

NLP debug class for information about variables and constraints in an instance of the csnlp.Nlp class. In particular, it records information on

  • the parameters p

  • the decision variable x

  • the equality constraints g

  • the 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:

NlpDebugEntry

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:

NlpDebugEntry

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:

NlpDebugEntry

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:

None

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:

NlpDebugEntry