blob: 589a1e761a5fcf44bb90aa4f1c349c80ed87068b (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include <iostream>
#include <vector>
#include <math.h>
#include "Operator.hpp"
#include "Expression.hpp"
#include "MaxStrategy.hpp"
using namespace std;
/*template<typename T>
struct Complete {
Complete(const T& value)
: _value(value) { }
private:
bool _infinity;
T _value;
};*/
std::vector< Expression<float>* > empty;
int main () {
Variable<float> x;
x.id(0);
Variable<float> y;
y.id(1);
VariableAssignment<float> rho(2);
rho[x] = 12;
rho[y] = 10;
Expression<float> expr(&x, empty);
std::vector<Expression<float>*> args;
args.push_back(new Expression<float>(&x, empty));
args.push_back(new Expression<float>(&y, empty));
MaxExpression<float> maxExpr(args);
maxExpr.id(0);
MaxStrategy<float> strat(1);
strat[maxExpr] = 0;
cout << strat(maxExpr,rho) << endl;
return 0;
}
|