X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fex.cpp;h=412f8c95509fb3af03367b5a4a9de4d90474e44d;hp=a390d71475f58d4dc71cc26783ca547ef18563a0;hb=68381b57513bb09d41cef9522afae60a40c2c3d7;hpb=6117b4f8f835a737ce6178617a22855016ceaf27 diff --git a/ginac/ex.cpp b/ginac/ex.cpp index a390d714..412f8c95 100644 --- a/ginac/ex.cpp +++ b/ginac/ex.cpp @@ -28,6 +28,7 @@ #include "ncmul.h" #include "numeric.h" #include "power.h" +#include "relational.h" #include "debugmsg.h" #include "utils.h" @@ -427,6 +428,7 @@ ex ex::operator[](int i) const return (*bp)[i]; } +/** Return operand/member at position i. */ ex ex::op(int i) const { debugmsg("ex op()",LOGLEVEL_MEMBER_FUNCTION); @@ -434,6 +436,7 @@ ex ex::op(int i) const return bp->op(i); } +/** Return modifyable operand/member at position i. */ ex & ex::let_op(int i) { debugmsg("ex let_op()",LOGLEVEL_MEMBER_FUNCTION); @@ -442,6 +445,22 @@ ex & ex::let_op(int i) return bp->let_op(i); } +/** Left hand side of relational expression. */ +ex ex::lhs(void) const +{ + debugmsg("ex lhs()",LOGLEVEL_MEMBER_FUNCTION); + GINAC_ASSERT(is_ex_of_type(*this,relational)); + return (*static_cast(bp)).lhs(); +} + +/** Right hand side of relational expression. */ +ex ex::rhs(void) const +{ + debugmsg("ex rhs()",LOGLEVEL_MEMBER_FUNCTION); + GINAC_ASSERT(is_ex_of_type(*this,relational)); + return (*static_cast(bp)).rhs(); +} + #ifndef INLINE_EX_CONSTRUCTORS int ex::compare(const ex & other) const {