@@ -536,7 +536,7 @@ function test_MultiplyAtom()
536
536
target = """
537
537
variables: t, x
538
538
minobjective: 1.0 * t
539
- [1.0 + 1.0 * t, 1.0 + -1.0 * t, 2.0 * x] in SecondOrderCone (3)
539
+ [t, 0.5, x] in RotatedSecondOrderCone (3)
540
540
"""
541
541
_test_atom (target) do context
542
542
x = Variable ()
@@ -965,7 +965,7 @@ function test_AbsAtom()
965
965
minobjective: 1.0 * w
966
966
[1.0 * t + -1.0 * x] in Nonnegatives(1)
967
967
[1.0 * t + 1.0 * x] in Nonnegatives(1)
968
- [1.0 + 1.0* w, 1.0 + -1.0*w, 2.0* t] in SecondOrderCone (3)
968
+ [w, 0.5, t] in RotatedSecondOrderCone (3)
969
969
"""
970
970
_test_atom (target) do context
971
971
return abs2 (Variable ())
@@ -1505,7 +1505,7 @@ function test_HuberAtom()
1505
1505
[1.0 * c + -1.0 * s + -1.0 * n] in Zeros(1)
1506
1506
[-1.0 * n + 1.0 * n_abs] in Nonnegatives(1)
1507
1507
[1.0 * n + 1.0 * n_abs] in Nonnegatives(1)
1508
- [1.0 + 1.0 * t, 1.0 + -1.0 * t, 2.0 * s] in SecondOrderCone (3)
1508
+ [t, 0.5, s] in RotatedSecondOrderCone (3)
1509
1509
"""
1510
1510
_test_atom (target) do context
1511
1511
return huber (Variable (), 2.0 )
@@ -1533,20 +1533,19 @@ end
1533
1533
1534
1534
function test_QolElemAtom ()
1535
1535
target = """
1536
- variables: y1, y2, t1, t2 , x1, x2
1536
+ variables: t1, t2, y1, y2 , x1, x2
1537
1537
minobjective: [1.0 * t1, 1.0 * t2]
1538
- [1.0 * y1, 1.0 * y2] in Nonnegatives(2)
1539
- [1.0 * y1 + 1.0 * t1, 1.0 * y1 + -1.0 * t1, 2.0 * x1] in SecondOrderCone(3)
1540
- [1.0 * y2 + 1.0 * t2, 1.0 * y2 + -1.0 * t2, 2.0 * x2] in SecondOrderCone(3)
1538
+ [t1, 0.5 * y1, x1] in RotatedSecondOrderCone(3)
1539
+ [t2, 0.5 * y2, x2] in RotatedSecondOrderCone(3)
1541
1540
"""
1542
1541
_test_atom (target) do context
1543
1542
return qol_elementwise (Variable (2 ), Variable (2 ))
1544
1543
end
1545
1544
target = """
1546
1545
variables: t1, t2, x1, x2
1547
1546
minobjective: [1.0 * t1, 1.0 * t2]
1548
- [1.0 + 1.0 * t1, 1.0 + -1.0 * t1, 2.0 * x1] in SecondOrderCone (3)
1549
- [1.0 + 1.0 * t2, 1.0 + -1.0 * t2, 2.0 * x2] in SecondOrderCone (3)
1547
+ [t1, 0.5, x1] in RotatedSecondOrderCone (3)
1548
+ [t2, 0.5, x2] in RotatedSecondOrderCone (3)
1550
1549
"""
1551
1550
_test_atom (target) do context
1552
1551
return qol_elementwise (Variable (2 ), constant ([1 , 1 ]))
@@ -1562,11 +1561,10 @@ function test_QolElemAtom()
1562
1561
return Variable (2 ) .^ a
1563
1562
end
1564
1563
target = """
1565
- variables: y1, y2, t1, t2
1564
+ variables: t1, t2, y1, y2
1566
1565
minobjective: [1.0 * t1, 1.0 * t2]
1567
- [1.0 * y1, 1.0 * y2] in Nonnegatives(2)
1568
- [1.0 * y1 + 1.0 * t1, 1.0 * y1 + -1.0 * t1, 2.0] in SecondOrderCone(3)
1569
- [1.0 * y2 + 1.0 * t2, 1.0 * y2 + -1.0 * t2, 2.0] in SecondOrderCone(3)
1566
+ [t1, 0.5 * y1, 1.0] in RotatedSecondOrderCone(3)
1567
+ [t2, 0.5 * y2, 1.0] in RotatedSecondOrderCone(3)
1570
1568
"""
1571
1569
_test_atom (target) do context
1572
1570
return invpos (Variable (2 ))
@@ -1575,10 +1573,9 @@ function test_QolElemAtom()
1575
1573
return 1 ./ Variable (2 )
1576
1574
end
1577
1575
target = """
1578
- variables: y, t
1576
+ variables: t, y
1579
1577
minobjective: 3.0 * t
1580
- [1.0 * y] in Nonnegatives(1)
1581
- [1.0 * y + 1.0 * t, 1.0 * y + -1.0 * t, 2.0] in SecondOrderCone(3)
1578
+ [t, 0.5 * y, 1.0] in RotatedSecondOrderCone(3)
1582
1579
"""
1583
1580
_test_atom (target) do context
1584
1581
return 3 / Variable ()
@@ -1620,10 +1617,9 @@ end
1620
1617
1621
1618
function test_QuadOverLinAtom ()
1622
1619
target = """
1623
- variables: y, t , x1, x2
1620
+ variables: t, y , x1, x2
1624
1621
minobjective: 1.0 * t
1625
- [1.0 * y] in Nonnegatives(1)
1626
- [1.0 * y + 1.0 * t, 1.0 * y + -1.0 * t, 2.0 * x1, 2.0 * x2] in SecondOrderCone(4)
1622
+ [t, 0.5 * y, x1, x2] in RotatedSecondOrderCone(4)
1627
1623
"""
1628
1624
_test_atom (target) do context
1629
1625
return quadoverlin (Variable (2 ), Variable ())
@@ -1931,7 +1927,7 @@ function test_quadform()
1931
1927
variables: u, t, x1, x2
1932
1928
minobjective: 1.0 * u
1933
1929
[t, 3.999999999999999*x1+1.9999999999999998*x2, 1.9999999999999998*x1+3.999999999999999*x2] in SecondOrderCone(3)
1934
- [1.0+1.0* u, 1.0+-1.0*u, 2.0* t] in SecondOrderCone (3)
1930
+ [u, 0.5, t] in RotatedSecondOrderCone (3)
1935
1931
"""
1936
1932
_test_reformulation (target) do context
1937
1933
return quadform (Variable (2 ), [20.0 16.0 ; 16.0 20.0 ])
@@ -1946,7 +1942,7 @@ function test_quadform()
1946
1942
variables: u, t, x1, x2
1947
1943
minobjective: 1.0 + -1.0 * u
1948
1944
[t, 3.999999999999999*x1+1.9999999999999998*x2, 1.9999999999999998*x1+3.999999999999999*x2] in SecondOrderCone(3)
1949
- [1.0+1.0* u, 1.0+-1.0*u, 2.0* t] in SecondOrderCone (3)
1945
+ [u, 0.5, t] in RotatedSecondOrderCone (3)
1950
1946
"""
1951
1947
_test_reformulation (target) do context
1952
1948
return 1 + quadform (Variable (2 ), - [20 16 ; 16 20 ])
0 commit comments