CParser* CMultFx::GetDuplicate() const
{
...
...
while (_t->Type() == FX_MULT)
{
if (f1->GetName() == ((GMultFx*)_t)->f1->GetName())
{
return new GPowerFx(_f1, new GConstFx(2));
}
_t = ((GMultFx*)_t)->f1;
}
...
...
}
The result might be like this "2*x^2".
But what the problem??
Declaration of my multiplication fx
class CMultFx : public CParser
{
public:
...
virtual GParser *GetDuplicate() const;
...
GParser *f1;
GParser *f2;
};
so f1 is for eg "x" and f2 is "2*x"
and i need to remove the "*x" part
from the f2.
Anyone knows how to do this??
Dave007
dave007@volny.cz
serious C++ problem
Hi all,
I have this problem in C++.
I''m making math function parser with function simplification alghoritm.
I have for eg. this fx: "x*2*x"
I have code something like this:
--------Dave[ Math Studio ] A Computer Algebra System
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement