@@ -476,21 +476,16 @@ SCIP_RETCODE addSymmetryInformation(
476
476
SCIP_CONS * lincons ;
477
477
SCIP_VAR * * vars ;
478
478
SCIP_Real * vals ;
479
- SCIP_VAR * * linvars ;
480
- SCIP_Real * linvals ;
481
479
SCIP_Real constant ;
482
480
SCIP_Real lhs ;
483
481
SCIP_Real rhs ;
484
- SCIP_Bool suc ;
485
482
int slacknodeidx ;
486
483
int consnodeidx ;
487
484
int eqnodeidx ;
488
485
int opnodeidx ;
489
486
int nodeidx ;
490
487
int nvarslincons ;
491
488
int nlocvars ;
492
- int nvars ;
493
- int i ;
494
489
495
490
assert (scip != NULL );
496
491
assert (cons != NULL );
@@ -503,28 +498,19 @@ SCIP_RETCODE addSymmetryInformation(
503
498
lincons = consdata -> lincons ;
504
499
assert (lincons != NULL );
505
500
506
- SCIP_CALL ( SCIPgetConsNVars (scip , lincons , & nvarslincons , & suc ) );
507
- assert (suc );
508
-
501
+ /* get information about linear constraint */
509
502
lhs = SCIPgetLhsLinear (scip , lincons );
510
503
rhs = SCIPgetRhsLinear (scip , lincons );
504
+ nvarslincons = SCIPgetNVarsLinear (scip , lincons );
511
505
512
- /* get information about linear constraint */
513
- nvars = SCIPgetNVars (scip );
514
-
515
- SCIP_CALL ( SCIPallocBufferArray (scip , & vars , nvars ) );
516
- SCIP_CALL ( SCIPallocBufferArray (scip , & vals , nvars ) );
517
-
518
- linvars = SCIPgetVarsLinear (scip , lincons );
519
- linvals = SCIPgetValsLinear (scip , lincons );
520
- for ( i = 0 ; i < nvarslincons ; ++ i )
521
- {
522
- vars [i ] = linvars [i ];
523
- vals [i ] = linvals [i ];
524
- }
525
- nlocvars = nvarslincons ;
506
+ nlocvars = MAX3 (1 , nvarslincons , SCIPgetNVars (scip )); /*lint !e666*/
507
+ SCIP_CALL ( SCIPallocBufferArray (scip , & vars , nlocvars ) );
508
+ SCIP_CALL ( SCIPallocBufferArray (scip , & vals , nlocvars ) );
509
+ BMScopyMemoryArray (vars , SCIPgetVarsLinear (scip , lincons ), nvarslincons );
510
+ BMScopyMemoryArray (vals , SCIPgetValsLinear (scip , lincons ), nvarslincons );
526
511
527
512
constant = 0.0 ;
513
+ nlocvars = nvarslincons ;
528
514
SCIP_CALL ( SCIPgetSymActiveVariables (scip , symtype , & vars , & vals , & nlocvars , & constant , SCIPisTransformed (scip )) );
529
515
530
516
/* update lhs/rhs due to possible variable aggregation */
0 commit comments