SCIPaddConsLocal

Function SCIPaddConsLocal 

Source
pub unsafe extern "C" fn SCIPaddConsLocal(
    scip: *mut SCIP,
    cons: *mut SCIP_CONS,
    validnode: *mut SCIP_NODE,
) -> SCIP_RETCODE
Expand description

adds constraint locally to the current node (and all of its subnodes), even if it is a global constraint; It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is only active in a small part of the tree although it is valid in a larger part.

If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as “validnode”. If the “validnode” is the root node, it is automatically upgraded into a global constraint, but still only added to the given node. If a local constraint is added to the root node, it is added to the global problem instead.

@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 in one of the following stages of the SCIP solving process: - \ref SCIP_STAGE_INITPRESOLVE - \ref SCIP_STAGE_PRESOLVING - \ref SCIP_STAGE_EXITPRESOLVE - \ref SCIP_STAGE_SOLVING

@note The same constraint cannot be added twice to the branching tree with different “validnode” parameters. This is the case due to internal data structures and performance issues. In such a case you should try to realize your issue using the method SCIPdisableCons() and SCIPenableCons() and control these via the event system of SCIP.