SCIPcreateVar

Function SCIPcreateVar 

Source
pub unsafe extern "C" fn SCIPcreateVar(
    scip: *mut SCIP,
    var: *mut *mut SCIP_VAR,
    name: *const c_char,
    lb: f64,
    ub: f64,
    obj: f64,
    vartype: SCIP_VARTYPE,
    initial: c_uint,
    removable: c_uint,
    vardelorig: Option<unsafe extern "C" fn(scip: *mut SCIP, var: *mut SCIP_VAR, vardata: *mut *mut SCIP_VARDATA) -> SCIP_RETCODE>,
    vartrans: Option<unsafe extern "C" fn(scip: *mut SCIP, sourcevar: *mut SCIP_VAR, sourcedata: *mut SCIP_VARDATA, targetvar: *mut SCIP_VAR, targetdata: *mut *mut SCIP_VARDATA) -> SCIP_RETCODE>,
    vardeltrans: Option<unsafe extern "C" fn(scip: *mut SCIP, var: *mut SCIP_VAR, vardata: *mut *mut SCIP_VARDATA) -> SCIP_RETCODE>,
    varcopy: Option<unsafe extern "C" fn(scip: *mut SCIP, sourcescip: *mut SCIP, sourcevar: *mut SCIP_VAR, sourcedata: *mut SCIP_VARDATA, varmap: *mut SCIP_HASHMAP, consmap: *mut SCIP_HASHMAP, targetvar: *mut SCIP_VAR, targetdata: *mut *mut SCIP_VARDATA, result: *mut SCIP_RESULT) -> SCIP_RETCODE>,
    vardata: *mut SCIP_VARDATA,
) -> SCIP_RETCODE
Expand description

creates and captures problem variable

If variable is of integral type, fractional bounds are automatically rounded. An integer variable with bounds zero and one is automatically converted into a binary variable.

@warning When doing column generation and the original problem is a maximization problem, notice that SCIP will transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the original objective function value of variables created during the solving process has to be multiplied by -1, too.

@return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref SCIP_Retcode “SCIP_RETCODE” for a complete list of error codes.

@pre This method can be called if @p scip is in one of the following stages: - \ref SCIP_STAGE_PROBLEM - \ref SCIP_STAGE_TRANSFORMING - \ref SCIP_STAGE_INITPRESOLVE - \ref SCIP_STAGE_PRESOLVING - \ref SCIP_STAGE_EXITPRESOLVE - \ref SCIP_STAGE_PRESOLVED - \ref SCIP_STAGE_SOLVING

@note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()