pockit.base.easyderiv

class Node:

Node in the computation graph to generate derivatives.

g: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]

Local gradient value.

g_i: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]]

Local gradient indices.

G: numba.typed.typedlist.List

Global gradient values.

G_i: numba.typed.typedlist.List

Global gradient indices.

h: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]

Local Hessian value.

h_i_row: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]]

Local Hessian row indices.

h_i_col: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]]

Local Hessian column indices.

H: numba.typed.typedlist.List

Global Hessian values.

H_i_row: numba.typed.typedlist.List

Global Hessian row indices.

H_i_col: numba.typed.typedlist.List

Global Hessian column indices.

l: int

Length of the variables of the node.

args: list[typing.Self]

List of Nodes of the function's arguments.

def set_G( self, G: Iterable[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]) -> None:

Set the node's global gradient values.

def set_G_i( self, G_i: Iterable[numpy.ndarray[Any, numpy.dtype[numpy.int32]]]) -> None:

Set the node's global gradient indices.

def set_H( self, H: Iterable[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]) -> None:

Set the node's global Hessian values.

def set_H_i_row( self, H_i_row: Iterable[numpy.ndarray[Any, numpy.dtype[numpy.int32]]]) -> None:

Set the node's global Hessian row indices.

def set_H_i_col( self, H_i_col: Iterable[numpy.ndarray[Any, numpy.dtype[numpy.int32]]]) -> None:

Set the node's global Hessian column indices.

@nb.njit
def composite_gradient_i( arg_G_i: numba.typed.typedlist.List, l: int) -> numba.typed.typedlist.List:

Composite the global gradient indices of a node from the arguments' global gradient indices.

def forward_gradient_i(nodes: list[Node]) -> None:

Compute the global gradient indices of the nodes iteratively.

@nb.njit
def composite_gradient_v( arg_G: numba.typed.typedlist.List, node_g: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], l: int) -> numba.typed.typedlist.List:

Composite the global gradient values of a node from the arguments' global gradient values.

def forward_gradient_v(nodes: list[Node]) -> None:

Compute the global gradient values of the nodes iteratively.

@nb.njit
def composite_hessian_i_h( arg_H_i_row: numba.typed.typedlist.List, arg_H_i_col: numba.typed.typedlist.List, l: int) -> tuple[numba.typed.typedlist.List, numba.typed.typedlist.List]:

Composite the global Hessian indices, the g-H part.

@nb.njit
def composite_hessian_phase_i_g( arg_G_i_row: numba.typed.typedlist.List, arg_G_i_col: numba.typed.typedlist.List, diag: numba.typed.typedlist.List, l: int) -> tuple[numba.typed.typedlist.List, numba.typed.typedlist.List]:

Composite the global Hessian indices for phase nodes, the h-G part.

def forward_hessian_phase_i(nodes: list[Node]) -> None:

Compute the global Hessian indices of the phase nodes iteratively.

@nb.njit
def composite_hessian_v_h( arg_H: numba.typed.typedlist.List, node_g: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], l: int) -> numba.typed.typedlist.List:

Composite the global Hessian values, the g-H part.

@nb.njit
def composite_hessian_phase_v_g( arg_G_i_row: numba.typed.typedlist.List, arg_G_i_col: numba.typed.typedlist.List, arg_G_row: numba.typed.typedlist.List, arg_G_col: numba.typed.typedlist.List, diag: numba.typed.typedlist.List, node_h: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], l: int) -> numba.typed.typedlist.List:

Composite the global Hessian values for phase nodes, the h-G part.

def forward_hessian_phase_v(nodes: list[Node]) -> None:

Compute the global Hessian values of the phase nodes iteratively.

@nb.njit
def composite_hessian_system_i_g( arg_G_i_row: numba.typed.typedlist.List, arg_G_i_col: numba.typed.typedlist.List, diag: numba.typed.typedlist.List, l: int) -> tuple[numba.typed.typedlist.List, numba.typed.typedlist.List]:

Composite the global Hessian indices for system nodes, the h-G part.

def forward_hessian_system_i(nodes: list[Node]) -> None:

Compute the global Hessian indices of the system nodes iteratively.

@nb.njit
def composite_hessian_system_v_g( arg_G_i_row: numba.typed.typedlist.List, arg_G_i_col: numba.typed.typedlist.List, arg_G_row: numba.typed.typedlist.List, arg_G_col: numba.typed.typedlist.List, diag: numba.typed.typedlist.List, node_h: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], l: int) -> numba.typed.typedlist.List:

Composite the global Hessian values for system nodes, the h-G part.

def forward_hessian_system_v(nodes: list[Node]) -> None:

Compute the global Hessian values of the system nodes iteratively.