odatse.solver.function module#

class odatse.solver.function.Solver(info: Info)[source]#

Bases: SolverBase

Solver class for evaluating functions with given parameters.

Initialize the solver.

Parameters:

info (Info) – Information object containing solver configuration.

__init__(info: Info) None[source]#

Initialize the solver.

Parameters:

info (Info) – Information object containing solver configuration.

evaluate(x: ndarray, args: tuple = ()) float[source]#

Evaluate the function with given parameters.

Parameters:
  • x (np.ndarray) – Input array for the function.

  • args (tuple, optional) – Additional arguments for the function.

Returns:

Result of the function evaluation.

Return type:

float

get_results() float[source]#

Get the results of the function evaluation.

Returns:

Result of the function evaluation.

Return type:

float

prepare(x: ndarray, args=()) None[source]#

Prepare the solver with the given parameters.

Parameters:
  • x (np.ndarray) – Input array for the function.

  • args (tuple, optional) – Additional arguments for the function.

run() None[source]#

Run the function evaluation.

Raises:

RuntimeError – If the function is not set.

set_function(f: Callable[[ndarray], float]) None[source]#

Set the function to be evaluated.

Parameters:

f (Callable[[np.ndarray], float]) – Function to be evaluated.