40 using namespace qucs::eqn;
52 children =
new ptrlist<environment>;
57 name = n ? strdup (n) : NULL;
63 children =
new ptrlist<environment>;
70 copyVariables (e.
root);
75 children =
new ptrlist<environment>;
84 copyVariables (e.
root);
90 children =
new ptrlist<environment>;
102 checkee->setEquations (NULL);
116 name = n ? strdup (n) : NULL;
129 while (org != NULL) {
161 delete var->getConstant ();
163 delete var->getValue ();
165 delete var->getSubstrate ();
169 delete var->getReference ();
188 if (!strcmp (
var->getName (),
n))
196 checkee->setDefinitions (defs);
197 return checkee->check (noundefined);
202 checkee->setDefinitions (defs);
203 solvee->setEquations (checkee->getEquations ());
204 int err = solvee->solve (data);
205 checkee->setEquations (solvee->getEquations ());
213 checkee->setDefinitions (defs);
214 solvee->setEquations (checkee->getEquations ());
216 checkee->setEquations (solvee->getEquations ());
221 children->add (child);
226 children->del (child);
236 ret |= equationSolver (NULL);
242 (*it)->passConstants ();
244 (*it)->updateReferences (
this);
246 ret |= (*it)->runSolver ();
249 (*it)->saveResults ();
263 setDouble (
var->getName (), c->
d);
275 c->
d = getDouble (
var->getName ());
278 *c->
v = getVector (
var->getName ());
291 if (!strcmp (
var->getName (),
n))
314 #define foreach_equation(eqn) \
315 for (assignment * (eqn) = A (equations); \
316 (eqn) != NULL; (eqn) = A ((eqn)->getNext ()))
319 #define A(a) ((assignment *) (a))
324 node * equations = checkee->getEquations ();
327 char * inst =
eqn->getInstance ();
328 if (inst != NULL &&
eqn->evaluated) {
330 if ((inst[0] !=
'#' && !
strchr (result,
'.')) ||
331 !strcmp (inst,
"#subcircuit")) {
332 setValue (result,
eqn->getResult ());
350 setDouble (
var->getName (),
d);
357 return checkee->getVector (ident);
362 return checkee->getDouble (ident);
367 checkee->setDouble (ident, val);
void fetchConstants(void)
void delChild(environment *)
variable * findValue(char *)
constant * getResult(int)
void updateReferences(environment *)
void setValue(char *, eqn::constant *)
void setResult(constant *)
nr_double_t getDoubleConstant(char *)
void copyVariables(variable *)
void deleteVariables(void)
Houses the settings for netlist evaluation.
void equationSolver(void)
#define foreach_equation(eqn)
void print(bool all=false)
void setDoubleConstant(char *, nr_double_t)
char * getDoubleReference(char *)
qucs::vector getVector(char *)
int equationChecker(int noundefined=1)
eqn::reference * getReference(void)
void setDouble(char *, nr_double_t)
void addChild(environment *)
nr_double_t getDouble(char *)
void setValue(eqn::constant *v)
eqn::constant * getConstant(void)
eqn::constant * getValue(void)
void copy(const environment &)
void setConstant(eqn::constant *c)
The environment class definition.
void setDoubleReference(char *, char *)
struct definition_t * defs
void setReference(eqn::reference *r)
variable * getVariable(char *)
void logprint(int level, const char *format,...)
void addVariable(variable *, bool pass=true)
void setNext(variable *v)