Add a method to Expr.
(Split out from earlier "Eigen library integration" commit)pull/1159/head
parent
3ba40230dd
commit
aec46b608e
|
@ -430,6 +430,11 @@ bool Expr::DependsOn(hParam p) const {
|
|||
bool Expr::Tol(double a, double b) {
|
||||
return fabs(a - b) < 0.001;
|
||||
}
|
||||
|
||||
bool Expr::IsZeroConst() const {
|
||||
return op == Op::CONSTANT && EXACT(v == 0.0);
|
||||
}
|
||||
|
||||
Expr *Expr::FoldConstants() {
|
||||
Expr *n = AllocExpr();
|
||||
*n = *this;
|
||||
|
|
|
@ -73,6 +73,7 @@ public:
|
|||
void ParamsUsedList(List<hParam> *list) const;
|
||||
bool DependsOn(hParam p) const;
|
||||
static bool Tol(double a, double b);
|
||||
bool IsZeroConst() const;
|
||||
Expr *FoldConstants();
|
||||
void Substitute(hParam oldh, hParam newh);
|
||||
|
||||
|
|
Loading…
Reference in New Issue