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

Simple Matlab functions for post-simulation verification #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jivid
Copy link

@jivid jivid commented Mar 4, 2015

Started creating a simple library of functions to verify our simulation results from dReal. Currently, this is just the Matlab code and I'm working on the Java code that will generate code to call these functions.

@drayside
Copy link
Member

drayside commented Mar 4, 2015

Approve

@@ -0,0 +1,3 @@
function res = squareIt(value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code smell. Why is this almost trivial helper function necessary? What is the advantage over just writing (expr)^2 when I need to square something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just readability. There's cases where writing (expr)^2 would lead end up looking like ((aX * bX) + (aY * bY)) ^ 2, where it isn't immediately clear where the power is being applied (to me at least). Having the function is easier to look at, and understand, what's happening IMO, but I'm happy to change it if there's strong opposition

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

Successfully merging this pull request may close these issues.

3 participants