branchobj.addrows
branchobj.addrows |
branchobj.addrows(ibranch, rtype, rhs, beg, mcol, val)
ibranch
|
The number of the branch to add the new constraints for. This branch must already have been created using
branchobj.addbranches. Branches are indexed starting from zero.
|
||||||
rtype
|
Character array indicating the type of constraints to add:
|
||||||
rhs
|
Array containing the right-hand side values.
|
||||||
beg
|
Array containing the offsets of the
mcol and
dval arrays of the start of the non zero coefficients in the new constraints.
|
||||||
mcol
|
Array containing the columns for the non zero coefficients.
|
||||||
dval
|
Array containing the non-zero coefficient values.
|
def CreateConstraintBranch(mip, icol): # Create the new object with two empty branches. bo = xpress.branchobj(mip, isoriginal=True) bo.addbranches(2) # Add the constraint of the branching object: # x1 + x2 >= 1 # x1 + x2 <= 0 bo.addrows(0, 1, 2, ['G'], [1.0], [0], [0,1], [1.0,1.0]) bo.addrows(1, 1, 2, ['L'], [0.0], [0], [0,1], [1.0,1.0]) # Set a low priority value so our branch object is picked up # before the default branch candidates. bo.setpriority(100) return bo
© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.