ForLoopConditionsTest.emam 467 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* (c) https://github.com/MontiCore/monticore */
package de.rwth.monticar.optimization;

component ForLoopConditionsTest{

    ports out Q^{3} xOut,
          out Q yOut;

    implementation Math{
        minimize
          Q^{3} x;
        in
          Q y = x(1) * x(1) + x(2) * x(2) + x(3) * x(3);
        subject to
          for i = 1:3
            x(i) >= 0;
            0 <= 2 * x(i) <= 2;
          end
        end
        xOut = x;
        yOut = y;
    }
}