34 std::vector<double>
val;
35 void eval(
double *result) {
36 for (
int i = 0; i <
type().
dim(); i++) result[i] =
val[i];
38 void eval(
const char **result) { assert(
false); }
46 void eval(
double *result) { assert(
false); }
47 void eval(
const char **result) { *result =
val; }
55 std::set<SeExpr2::DExpression *> ret;
57 std::set<SeExpr2::DExpression *> workList = gv->
users;
58 while (workList.size()) {
69 std::set<SeExpr2::DExpression *> ret;
71 std::set<SeExpr2::DExpression *> workList;
72 workList.insert(
expr);
73 while (workList.size()) {
83 std::set<SeExpr2::DExpression *> tmpOperandExprs;
84 std::set<SeExpr2::GlobalVal *> tmpOperandVars;
115 if ((*I)->name() ==
name) {
116 tmpOperandExprs.insert(*I);
117 (*I)->val->users.insert(const_cast<DExpression *>(
this));
122 if ((*I)->varName ==
name) {
123 tmpOperandVars.insert(*I);
124 (*I)->users.insert(const_cast<DExpression *>(
this));
134 const double *ret =
evalFP();
136 fpVal->
val.assign(ret, ret + fpVal->
val.size());
146 for (std::set<DExpression *>::iterator I =
AllExprs.begin(), E =
AllExprs.end(); I != E; ++I)
delete *I;
152 std::pair<std::set<GlobalVal *>::iterator,
bool> ret;
165 std::pair<std::set<DExpression *>::iterator,
bool> ret;
172 unsigned initSize = static_cast<unsigned>(thisvar->
users.size());
175 std::set<DExpression *> ret = getAffectedExpr(thisvar);
184 GlobalFP *thisvar = dynamic_cast<GlobalFP *>(*handle);
185 assert(thisvar &&
"set value to variable with incompatible types.");
187 assert(dim == thisvar->
val.size());
188 for (
unsigned i = 0; i < dim; ++i) thisvar->
val[i] = values[i];
194 GlobalStr *thisvar = dynamic_cast<GlobalStr *>(*handle);
195 assert(thisvar &&
"set value to variable with incompatible types.");
196 thisvar->
val = values;
200 GlobalFP *thisvar = dynamic_cast<GlobalFP *>(*handle);
201 assert(thisvar &&
"set value to variable with incompatible types.");
203 assert(dim == thisvar->
val.size());
204 for (
unsigned i = 0; i < dim; ++i) thisvar->
val[i] = values[i];
207 std::set<DExpression *> ret = getAffectedExpr(thisvar);
208 for (std::set<DExpression *>::iterator I = ret.begin(), E = ret.end(); I != E; ++I) (*I)->eval();
212 GlobalStr *thisvar = dynamic_cast<GlobalStr *>(*handle);
213 assert(thisvar &&
"set value to variable with incompatible types.");
214 thisvar->
val = values;
217 std::set<DExpression *> ret = getAffectedExpr(thisvar);
218 for (std::set<DExpression *>::iterator I = ret.begin(), E = ret.end(); I != E; ++I) (*I)->eval();
223 for (std::set<DExpression *>::const_iterator I =
AllExprs.begin(), E =
AllExprs.end(); I != E; ++I)
224 ret &= (*I)->isValid();
232 std::set<DExpression *> all = getTransitiveOperandExpr(de);
235 std::vector<DExpression *>::iterator
it;
237 std::vector<DExpression *> ret1(all.size());
239 ret1.resize(
it - ret1.begin());
241 std::vector<DExpression *> ret2(ret1.size());
243 ret2.resize(
it - ret2.begin());
248 return std::make_pair(eh, ret2);
253 for (std::vector<DExpression *>::iterator I = eeh.second.begin(), E = eeh.second.end(); I != E; ++I) (*I)->eval();
255 GlobalFP *thisvar = dynamic_cast<GlobalFP *>((*eeh.first)->val);
264 for (std::vector<DExpression *>::iterator I = eeh.second.begin(), E = eeh.second.end(); I != E; ++I) (*I)->eval();
266 GlobalStr *thisvar = dynamic_cast<GlobalStr *>((*eeh.first)->val);