ScalarMethod

class desdeo_tools.solver.ScalarMethod(method, method_args=None, use_scipy=False)[source]

Bases: object

A class the define and implement methods for minimizing scalar valued functions.

Methods Summary

__call__(obj_fun, x0, bounds, …)

Minimizes a scalar valued function.

Methods Documentation

__call__(obj_fun, x0, bounds, constraint_evaluator)[source]

Minimizes a scalar valued function.

Parameters
  • obj_fun (Callable) – A callable scalar valued function that

  • a two dimensional numpy array as its first arguments. (accepts) –

  • x0 (np.ndarray) – An initial guess.

  • bounds (np.ndarray) – The upper and lower bounds for each variable

  • by obj_fun. Expects a 2D numpy array with each row (accepted) –

  • the lower and upper bounds of a variable. The first column (representing) –

  • contain the lower bounds and the last column the upper bounds. (should) –

  • np.inf to indicate no bound. (Use) –

  • constraint_evaluator (Callable) – Should accepts exactly the

  • arguments as obj_fun. Returns a scalar value for each constraint (same) –

  • This scalar value should be positive if a constraint holds (present.) –

  • negative (and) –

  • otherwise.

Returns

A dictionary with at least the following entries: ‘x’ indicating the optimal variables found, ‘fun’ the optimal value of the optimized function, and ‘success’ a boolean indicating whether the optimization was conducted successfully.

Return type

Dict