-
Notifications
You must be signed in to change notification settings - Fork 324
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
Add ExpressionBasedFunction
#3892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor questions but looks great
Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @AllisonJohn and @nickbianco)
OpenSim/Common/ExpressionBasedFunction.h
line 59 at r1 (raw file):
OpenSim_DECLARE_PROPERTY(expression, std::string, "The mathematical expression defining this Function."); OpenSim_DECLARE_LIST_PROPERTY(variables, std::string,
Space separated? Case sensitive? Quoted or not? allowed/disallowed names
On a related note, if the definition is invalid, when does it blow up?
OpenSim/Common/ExpressionBasedFunction.cpp
line 116 at r1 (raw file):
Lepton::ExpressionProgram m_valueProgram; std::vector<Lepton::ExpressionProgram> m_derivativePrograms; };
The prefix SimTK outside the namespace is a bit uncommon is that intentional? How would it show in documentation/doxygen?
Also is it in the style guide to use the m_ prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aymanhab! Ready for review again.
Reviewable status: 7 of 9 files reviewed, 2 unresolved discussions (waiting on @AllisonJohn and @aymanhab)
OpenSim/Common/ExpressionBasedFunction.h
line 59 at r1 (raw file):
Previously, aymanhab (Ayman Habib) wrote…
Space separated? Case sensitive? Quoted or not? allowed/disallowed names
On a related note, if the definition is invalid, when does it blow up?
List properties in XML will be space separated. I added some documentation about allowed/non-allowed variable names.
OpenSim/Common/ExpressionBasedFunction.cpp
line 116 at r1 (raw file):
Previously, aymanhab (Ayman Habib) wrote…
The prefix SimTK outside the namespace is a bit uncommon is that intentional? How would it show in documentation/doxygen?
Also is it in the style guide to use the m_ prefix?
This class is internal and will be hidden from Doxgyen. See MultivariatePolynomialFunction
for a similar implementation.
There's nothing in DEVELOPING.md
or CONTRIBUTING.md
about variable name prefixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @AllisonJohn)
Thanks @aymanhab! |
Fixes issue #3812
Brief summary of changes
Adds
ExpressionBasedFunction
for creating OpenSimFunction
s that leverage Lepton's expression parsing.Testing I've completed
Add tests to
testFunctions.cpp
.Looking for feedback on...
CHANGELOG.md (choose one)
This change is