Changeset 9486


Ignore:
Timestamp:
Dec 14, 2014 4:05:18 PM (4 years ago)
Author:
wehart
Message:

Adding linear dualization transform tests

Location:
pyomo/trunk/pyomo/core/tests/transform
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • pyomo/trunk/pyomo/core/tests/transform/t1_linear_dual.lp

    r9479 r9486  
    11\* Source Pyomo model name=unknown *\
    22
    3 max
     3min
    44o:
    5 +6 x1
    6 +4 x2
    7 +2 x3
     5-5 c1
     6-3 c2
     7-4 c3
    88
    99s.t.
    1010
    11 c_l_c1_:
    12 +4 x1
    13 +2 x2
    14 +1 x3
    15 >= 5
     11c_u_x1_:
     12+4 c1
     13+1 c2
     14<= -6
    1615
    17 c_l_c2_:
    18 +1 x1
    19 +1 x2
    20 >= 3
     16c_u_x2_:
     17+2 c1
     18+1 c2
     19+1 c3
     20<= -4
    2121
    22 c_l_c3_:
    23 +1 x2
    24 +1 x3
    25 >= 4
     22c_u_x3_:
     23+1 c1
     24+1 c3
     25<= -2
    2626
    2727c_e_ONE_VAR_CONSTANT:
     
    2929
    3030bounds
    31    0 <= x1 <= +inf
    32    0 <= x2 <= +inf
    33    0 <= x3 <= +inf
     31   0 <= c1 <= +inf
     32   0 <= c2 <= +inf
     33   0 <= c3 <= +inf
    3434end
  • pyomo/trunk/pyomo/core/tests/transform/t5_linear_dual.lp

    r9479 r9486  
    11\* Source Pyomo model name=unknown *\
    22
    3 min
     3max
    44o:
    5 +3 x1
    6 +2.5 x2
     5+100 c1
     6+100 c2
     7+100 c3
     8+100 c4
    79
    810s.t.
    911
    10 c_u_c1_:
    11 +4.4400000000000004 x1
    12 <= 100
     12c_u_x1_:
     13+4.4400000000000004 c1
     14+4 c3
     15+3 c4
     16<= 3
    1317
    14 c_u_c2_:
    15 +6.6699999999999999 x2
    16 <= 100
    17 
    18 c_u_c3_:
    19 +4 x1
    20 +2.8599999999999999 x2
    21 <= 100
    22 
    23 c_u_c4_:
    24 +3 x1
    25 +6 x2
    26 <= 100
     18c_u_x2_:
     19+6.6699999999999999 c2
     20+2.8599999999999999 c3
     21+6 c4
     22<= 2.5
    2723
    2824c_e_ONE_VAR_CONSTANT:
     
    3026
    3127bounds
    32    0 <= x1 <= +inf
    33    0 <= x2 <= +inf
     28    -inf <= c1 <= 0
     29    -inf <= c2 <= 0
     30    -inf <= c3 <= 0
     31    -inf <= c4 <= 0
    3432end
  • pyomo/trunk/pyomo/core/tests/transform/test_linear_dual.py

    r9479 r9486  
    4848        args = []
    4949        args.append('-c')
    50         pproc = None
    5150        if 'solver' in kwds:
    5251            _solver = kwds.get('solver','glpk')
    5352            args.append('--solver=%s' % _solver)
    54         elif 'preprocess' in kwds:
    55             pp = kwds['preprocess']
    56             if pp == 'linear_dual':
    57                 pproc = TransformationFactory('base.linear_dual')
     53        if 'transform' in kwds:
     54            args.append('--transform=%s' % kwds['transform'])
    5855        args.append('--symbolic-solver-labels')
    5956        args.append('--save-results=result.yml')
     
    7269
    7370        print('***')
    74         if pproc:
    75             pproc.activate()
    76             print("Activating " + kwds['preprocess'])
    7771        #print(' '.join(args))
    7872        try:
     
    8175            output = None
    8276        cleanup()
    83         if pproc:
    84             pproc.deactivate()
    8577        print('***')
    8678        return output
     
    125117        args.append('--save-model='+self.problem+'_result.lp')
    126118        args.append('--instance-only')
    127         kwds['preprocess'] = 'linear_dual'
     119        kwds['transform'] = 'base.linear_dual'
    128120        CommonTests.run_bilevel(self, *args, **kwds)
    129121
Note: See TracChangeset for help on using the changeset viewer.