Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressions with multiple output values not supported? #35

Closed
GoogleCodeExporter opened this issue Mar 22, 2015 · 2 comments
Closed

Expressions with multiple output values not supported? #35

GoogleCodeExporter opened this issue Mar 22, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Try to run this code:
mup::ParserX parser(mup::pckCOMMON | mup::pckNON_COMPLEX | mup::pckMATRIX | 
mup::pckUNIT);
mup::Value value2{3, 0};
mup::Variable variable2{&value2};
parser.DefineVar("v2", variable2);
parser.SetExpr("v2[0]*v2[0], v2[1]*v2[1], v2[2]*v2[2]");
try {
    const auto& temp = parser.Eval();
} catch(mup::ParserError &e) {
    cout << e.GetMsg() << endl;
}

What is the expected output?
No exception.

What do you see instead?
Exception: Unexpected comma found at position 11.

What version of the product are you using?

3.0.1, macosx


If this is indeed supported the documentation does not mention it: 
https://code.google.com/p/muparserx/wiki/Using

I tried Eval(int) but that gave a compilation error:
error: no matching function for call to 'mup::ParserX::Eval(int&)'
note: candidate is:
const mup::IValue& mup::ParserXBase::Eval() const

Original issue reported on code.google.com by ilja.j.h...@nasa.gov on 8 Jul 2014 at 5:02

@GoogleCodeExporter
Copy link
Author

This is no longer supported. You can now use the new array constructor {.. , 
.., ..}:

parser.SetExpr("{v2[0]*v2[0], v2[1]*v2[1], v2[2]*v2[2]}");

This will create an array containing all results. 

Original comment by ib...@gmx.info on 9 Jul 2014 at 7:18

@GoogleCodeExporter
Copy link
Author

Closed as per last comment. (Feature was removed; alternate way is available)

Original comment by ib...@gmx.info on 14 Jul 2014 at 8:49

  • Changed state: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant