Lines Matching refs:lhs
55 RandomVariableBase::RandomVariableBase(const RandomVariableNode& lhs, const RandomVariableNode& rhs, in RandomVariableBase() argument
59 range(op->getInitRange(lhs->range, rhs == nullptr ? RandomVariableRange(0) : rhs->range)), in RandomVariableBase()
61 parent1(lhs), in RandomVariableBase()
82 RandomVariableRange operator&(const RandomVariableRange& lhs, const RandomVariableRange& rhs) { in operator &() argument
83 std::vector<int> result(lhs.size() + rhs.size()); in operator &()
84 auto it = std::set_intersection(lhs.mChoices.begin(), lhs.mChoices.end(), rhs.mChoices.begin(), in operator &()
132 RandomVariable::RandomVariable(const RandomVariable& lhs, const RandomVariable& rhs, in RandomVariable() argument
134 : mVar(new RandomVariableBase(lhs.get(), rhs.get(), op)) { in RandomVariable()
157 RandomVariableRange IRandomVariableOp::getInitRange(const RandomVariableRange& lhs, in getInitRange() argument
160 for (auto i : lhs.getChoices()) { in getInitRange()
218 virtual int eval(int lhs, int) const override { return eval(lhs); } in eval() argument
242 virtual bool check(int lhs, int rhs) const = 0;
243 virtual int eval(int lhs, int rhs) const override { in eval() argument
244 return check(lhs, rhs) ? 0 : kInvalidValue; in eval()
272 virtual int eval(int lhs, int rhs) const override { return lhs + rhs; } in eval() argument
273 virtual RandomVariableRange getInitRange(const RandomVariableRange& lhs, in getInitRange() argument
275 return RandomVariableRange(lhs.min() + rhs.min(), lhs.max() + rhs.max()); in getInitRange()
308 virtual int eval(int lhs, int rhs) const override { return lhs - rhs; } in eval() argument
309 virtual RandomVariableRange getInitRange(const RandomVariableRange& lhs, in getInitRange() argument
311 return RandomVariableRange(lhs.min() - rhs.max(), lhs.max() - rhs.min()); in getInitRange()
337 virtual int eval(int lhs, int rhs) const override { return lhs * rhs; } in eval() argument
338 virtual RandomVariableRange getInitRange(const RandomVariableRange& lhs, in getInitRange() argument
340 if (lhs.min() < 0 || rhs.min() < 0) { in getInitRange()
341 return IRandomVariableOp::getInitRange(lhs, rhs); in getInitRange()
343 int lower = std::min(lhs.min() * rhs.min(), kMaxValue); in getInitRange()
344 int upper = std::min(lhs.max() * rhs.max(), kMaxValue); in getInitRange()
380 virtual int eval(int lhs, int rhs) const override { in eval() argument
381 return rhs == 0 ? kInvalidValue : lhs / rhs; in eval()
383 virtual RandomVariableRange getInitRange(const RandomVariableRange& lhs, in getInitRange() argument
385 if (lhs.min() < 0 || rhs.min() <= 0) { in getInitRange()
386 return IRandomVariableOp::getInitRange(lhs, rhs); in getInitRange()
388 return RandomVariableRange(lhs.min() / rhs.max(), lhs.max() / rhs.min()); in getInitRange()
396 virtual int eval(int lhs, int rhs) const override { in eval() argument
397 return (rhs == 0 || lhs % rhs != 0) ? kInvalidValue : lhs / rhs; in eval()
404 virtual int eval(int lhs, int rhs) const override { in eval() argument
405 return rhs == 0 ? kInvalidValue : lhs % rhs; in eval()
449 virtual int eval(int lhs, int rhs) const override { return std::max(lhs, rhs); } in eval() argument
455 virtual int eval(int lhs, int rhs) const override { return std::min(lhs, rhs); } in eval() argument
473 virtual bool check(int lhs, int rhs) const override { return lhs == rhs; } in check() argument
489 virtual bool check(int lhs, int rhs) const override { return lhs > rhs; } in check() argument
495 virtual bool check(int lhs, int rhs) const override { return lhs >= rhs; } in check() argument
515 RandomVariable operator+(const RandomVariable& lhs, const RandomVariable& rhs) { in operator +() argument
516 return lhs.get() == rhs.get() ? RandomVariable(lhs, 2, Singleton<Multiplication>::get()) in operator +()
517 : RandomVariable(lhs, rhs, Singleton<Addition>::get()); in operator +()
519 RandomVariable operator-(const RandomVariable& lhs, const RandomVariable& rhs) { in operator -() argument
520 return lhs.get() == rhs.get() ? RandomVariable(0) in operator -()
521 : RandomVariable(lhs, rhs, Singleton<Subtraction>::get()); in operator -()
523 RandomVariable operator*(const RandomVariable& lhs, const RandomVariable& rhs) { in operator *() argument
524 return lhs.get() == rhs.get() ? RandomVariable(lhs, RandomVariable(), Singleton<Square>::get()) in operator *()
525 : RandomVariable(lhs, rhs, Singleton<Multiplication>::get()); in operator *()
527 RandomVariable operator*(const RandomVariable& lhs, const float& rhs) { in operator *() argument
528 return RandomVariable(lhs, RandomVariable(), std::make_shared<FloatMultiplication>(rhs)); in operator *()
530 RandomVariable operator/(const RandomVariable& lhs, const RandomVariable& rhs) { in operator /() argument
531 return lhs.get() == rhs.get() ? RandomVariable(1) in operator /()
532 : RandomVariable(lhs, rhs, Singleton<Division>::get()); in operator /()
534 RandomVariable operator%(const RandomVariable& lhs, const RandomVariable& rhs) { in operator %() argument
535 return lhs.get() == rhs.get() ? RandomVariable(0) in operator %()
536 : RandomVariable(lhs, rhs, Singleton<Modulo>::get()); in operator %()
538 RandomVariable max(const RandomVariable& lhs, const RandomVariable& rhs) { in max() argument
539 return lhs.get() == rhs.get() ? lhs : RandomVariable(lhs, rhs, Singleton<Maximum>::get()); in max()
541 RandomVariable min(const RandomVariable& lhs, const RandomVariable& rhs) { in min() argument
542 return lhs.get() == rhs.get() ? lhs : RandomVariable(lhs, rhs, Singleton<Minimum>::get()); in min()
1168 bool RandomVariableNetwork::setEqualIfCompatible(const std::vector<RandomVariable>& lhs, in setEqualIfCompatible() argument
1170 NN_FUZZER_LOG << "Check compatibility of {" << joinStr(", ", lhs) << "} and {" in setEqualIfCompatible()
1172 if (lhs.size() != rhs.size()) return false; in setEqualIfCompatible()
1175 for (size_t i = 0; i < lhs.size(); i++) { in setEqualIfCompatible()
1176 auto node = lhs[i].setEqual(rhs[i]).get(); in setEqualIfCompatible()