2 #include "expr_ops.hpp"
6 inline AffExpr operator+(
const Var& x,
double y) {
7 return exprAdd(AffExpr(x), y);
9 inline AffExpr operator+(
const AffExpr& x,
double y) {
12 inline QuadExpr operator+(
const QuadExpr& x,
double y) {
16 inline AffExpr operator+(
const Var& x,
const Var& y) {
17 return exprAdd(AffExpr(x), y);
19 inline AffExpr operator+(
const AffExpr& x,
const Var& y) {
22 inline QuadExpr operator+(
const QuadExpr& x,
const Var& y) {
26 inline AffExpr operator+(
const Var& x,
const AffExpr& y) {
27 return exprAdd(AffExpr(x), y);
29 inline AffExpr operator+(
const AffExpr& x,
const AffExpr& y) {
32 inline QuadExpr operator+(
const QuadExpr& x,
const AffExpr& y) {
36 inline QuadExpr operator+(
const Var& x,
const QuadExpr& y) {
37 return exprAdd(QuadExpr(x), y);
39 inline QuadExpr operator+(
const AffExpr& x,
const QuadExpr& y) {
40 return exprAdd(QuadExpr(x), y);
42 inline QuadExpr operator+(
const QuadExpr& x,
const QuadExpr& y) {
49 inline AffExpr operator-(
const Var& x,
double y) {
50 return exprSub(AffExpr(x), y);
52 inline AffExpr operator-(
const AffExpr& x,
double y) {
55 inline QuadExpr operator-(
const QuadExpr& x,
double y) {
59 inline AffExpr operator-(
const Var& x,
const Var& y) {
60 return exprSub(AffExpr(x), y);
62 inline AffExpr operator-(
const AffExpr& x,
const Var& y) {
65 inline QuadExpr operator-(
const QuadExpr& x,
const Var& y) {
69 inline AffExpr operator-(
const Var& x,
const AffExpr& y) {
70 return exprSub(AffExpr(x), y);
72 inline AffExpr operator-(
const AffExpr& x,
const AffExpr& y) {
75 inline QuadExpr operator-(
const QuadExpr& x,
const AffExpr& y) {
79 inline QuadExpr operator-(
const Var& x,
const QuadExpr& y) {
80 return exprSub(QuadExpr(x), y);
82 inline QuadExpr operator-(
const AffExpr& x,
const QuadExpr& y) {
83 return exprSub(QuadExpr(x), y);
85 inline QuadExpr operator-(
const QuadExpr& x,
const QuadExpr& y) {
93 inline AffExpr operator*(
double a,
const Var& b) {
94 return exprMult(b, a);
96 inline AffExpr operator*(
double a,
const AffExpr& b) {
97 return exprMult(b, a);
99 inline QuadExpr operator*(
double a,
const QuadExpr& b) {
100 return exprMult(b, a);
103 inline AffExpr operator*(
const Var& a,
double b) {
104 return exprMult(a, b);
106 inline AffExpr operator*(
const AffExpr& a,
double b) {
107 return exprMult(a, b);
109 inline QuadExpr operator*(
const QuadExpr& a,
double b) {
110 return exprMult(a, b);
113 inline AffExpr operator-(
const Var& a) {
114 return exprMult(a, -1);
116 inline AffExpr operator-(
const AffExpr& a) {
117 return exprMult(a, -1);