Class: Gnm::Solver

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Direct Known Subclasses

IterSolver, SubSolver

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.db_getGLib::SList<Gnm::SolverFactory>

registered solver factories.

Returns:

.db_register(factory) ⇒ nil

Parameters:

Returns:

  • (nil)

.db_unregister(factory) ⇒ nil

Parameters:

Returns:

  • (nil)

.debugBoolean

Returns:

  • (Boolean)

Instance Method Details

#cell_index(cell) ⇒ Integer

Parameters:

  • cell (Gnm::Cell)

Returns:

  • (Integer)

#check_constraintsBoolean

Returns:

  • (Boolean)

#check_timeoutBoolean

Returns:

  • (Boolean)

#compute_gradient(xs) ⇒ Gnm::gnm_float

function takes the flip-sign property into account. This will use analytic gradient, if possible, and a numerical approximation otherwise.

Parameters:

  • xs (Gnm::gnm_float)

    Point to compute gradient at

Returns:

  • (Gnm::gnm_float)

    xxx(transfer full): A vector containing the gradient. This

#compute_hessian(xs) ⇒ Gnm::Matrix

function takes the flip-sign property into account.

Parameters:

  • xs (Gnm::gnm_float)

    Point to compute Hessian at

Returns:

  • (Gnm::Matrix)

    A matrix containing the Hessian. This

#create_report(name) ⇒ nil

Parameters:

  • name (String)

Returns:

  • (nil)

#elapsedFloat

Returns:

  • (Float)

#endtimeFloat

Returns endtime.

Returns:

  • (Float)

    endtime

#endtime=(endtime) ⇒ Float

Parameters:

  • endtime (Float)

Returns:

  • (Float)

    endtime

  • (Float)

    endtime

#finishedBoolean

Returns:

  • (Boolean)

#flip_sign=(flip_sign) ⇒ Boolean

Parameters:

  • flip_sign (Boolean)

Returns:

  • (Boolean)

    flip-sign

  • (Boolean)

    flip-sign

#flip_sign?Boolean

Returns flip-sign.

Returns:

  • (Boolean)

    flip-sign

#get_lp_coeffs(ycell, x1, x2) ⇒ Gnm::gnm_float

Note: this function is not affected by the flip-sign property, even if ycell happens to coincide with the solver target cell.

Parameters:

  • ycell (Gnm::Cell)

    Cell for which to compute coefficients

  • x1 (Gnm::gnm_float)

    first coordinate value

  • x2 (Gnm::gnm_float)

    second coordinate value

Returns:

  • (Gnm::gnm_float)

    xxx(transfer full) (nullable): coordinates, or nil in case of error.

#has_analytic_gradientBoolean

Returns true if the gradient can be computed analytically.

Returns:

  • (Boolean)

    true if the gradient can be computed analytically.

#has_analytic_hessianBoolean

Returns true if the Hessian can be computed analytically.

Returns:

  • (Boolean)

    true if the Hessian can be computed analytically.

#has_solutionBoolean

Returns:

  • (Boolean)

#line_search(x0, dir, try_reverse, step, max_step, eps, py) ⇒ Gnm::gnm_float

Returns optimal step size.

Parameters:

  • x0 (Gnm::gnm_float)

    Starting point

  • dir (Gnm::gnm_float)

    direction

  • try_reverse (Boolean)

    whether to try reverse direction at all

  • step (Gnm::gnm_float)

    initial step size

  • max_step (Gnm::gnm_float)

    largest allowed step

  • eps (Gnm::gnm_float)

    tolerance for optimal step

  • py (Gnm::gnm_float)

    location to store resulting objective function value

Returns:

  • (Gnm::gnm_float)

    optimal step size.

#paramsGnm::SolverParameters

Returns params.

Returns:

#params=(params) ⇒ Gnm::SolverParameters

Parameters:

Returns:

#pick_lp_coords(px1, px2) ⇒ nil

Pick two good values for each coordinate. We prefer 0 and 1 when they are valid.

Parameters:

  • px1 (Gnm::gnm_float)

    first coordinate value

  • px2 (Gnm::gnm_float)

    second coordinate value

Returns:

  • (nil)

#prepare(wbc) ⇒ Boolean

Prepare for solving. Preparation need not do anything, but may include such tasks as checking that the model is valid for the solver and locating necessary external programs.

Parameters:

Returns:

  • (Boolean)

    true ok success, false on error.

#reasonString

Returns reason.

Returns:

  • (String)

    reason

#reason=(reason) ⇒ String

Parameters:

  • reason (String)

Returns:

  • (String)

    reason

  • (String)

    reason

#restore_vars(vals) ⇒ nil

Parameters:

  • vals (Array<Gnm::Value>)

    values to restore

Returns:

  • (nil)

#resultGnm::SolverResult

Returns result.

Returns:

#result=(result) ⇒ Gnm::SolverResult

Parameters:

Returns:

#save_varsArray<Gnm::Value>

Returns:

  • (Array<Gnm::Value>)

#saveas(wbc, fs, templ, filename) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)

#sensitivityGnm::SolverSensitivity

Returns sensitivity.

Returns:

#sensitivity=(sensitivity) ⇒ Gnm::SolverSensitivity

Parameters:

Returns:

#set_var(i, x) ⇒ nil

Parameters:

  • i (Integer)
  • x (Gnm::gnm_float)

Returns:

  • (nil)

#start(wbc) ⇒ Boolean

Start the solving process. If needed, the solver will be prepared first.

Parameters:

Returns:

  • (Boolean)

    true ok success, false on error.

#starttimeFloat

Returns starttime.

Returns:

  • (Float)

    starttime

#starttime=(starttime) ⇒ Float

Parameters:

  • starttime (Float)

Returns:

  • (Float)

    starttime

  • (Float)

    starttime

#statusGnm::SolverStatus

Returns status.

Returns:

#status=(status) ⇒ Gnm::SolverStatus

Parameters:

Returns:

#stopBoolean

Terminate the currently-running solver.

Returns:

  • (Boolean)

    true ok success, false on error.

#store_resultnil

Returns:

  • (nil)

#target_valueGnm::gnm_float

flipped.

Returns:

  • (Gnm::gnm_float)

    the current value of the target cell, possibly with the sign

#vars=(xs) ⇒ nil

Parameters:

  • xs (Gnm::gnm_float)

Returns:

  • (nil)