Skip to content

Replace 1/x with inv(x) - issue #595 - #626

Merged
bob-carpenter merged 5 commits into
stan-dev:developfrom
andrjohns:develop
Sep 27, 2017
Merged

bob-carpenter merged 5 commits into
stan-dev:developfrom
andrjohns:develop

Conversation

@andrjohns

@andrjohns andrjohns commented Sep 24, 2017 •

Copy link
Copy Markdown
Collaborator

Submission Checklist

  • Run unit tests: ./runTests.py test/unit
  • Run cpplint: make cpplint
  • Declare copyright holder and open-source license: see below

Summary:

Replace all instances of 1/x in prim/scal/prob with inv(x). See #595
Replace inv(x*x) with inv_square(x)

Intended Effect:

Make code more efficient/consistent.

How to Verify:

Side Effects:

None (hopefully).

Documentation:

None.

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
Andrew Johnson
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@stan-buildbot

Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

@bob-carpenter bob-carpenter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. This will speed up forward mode and it shouldn't slow down reverse mode. I think it's a bit clearer, too.

@bob-carpenter
bob-carpenter merged commit c67762a into stan-dev:develop Sep 27, 2017
@seantalts

seantalts commented Sep 27, 2017 •

Copy link
Copy Markdown
Member

Hey, this is causing develop to fail (and it looks like it didn't run tests on Jenkins?)

http://d1m1s1b1.stat.columbia.edu:8080/job/Math%20-%20Tests%20-%20Header/249/

cc @bob-carpenter @syclik

seantalts added a commit that referenced this pull request Sep 27, 2017
This reverts commit c67762a, reversing
changes made to b12a0eb.
seantalts added a commit that referenced this pull request Sep 27, 2017
This reverts commit c67762a, reversing
changes made to b12a0eb.
@andrjohns

andrjohns commented Sep 28, 2017 •

Copy link
Copy Markdown
Collaborator Author

Sorry about that, looks like I missed the "inv" library for a couple of the rngs, and then ran test-headers on the wrong branch (clear signs of a long week). Everything's now passing after including the libraries, I'll make a new pr with the fixed changes.

@andrjohns andrjohns mentioned this pull request Sep 28, 2017
3 tasks done
@bob-carpenter

Copy link
Copy Markdown
Member

@seantalts --- thanks for reverting. I didn't realize it didn't pass tests. Is there something we need to do to run tests again?

@seantalts

Copy link
Copy Markdown
Member

When you see this, one of the admins has to say "Jenkins, ok to test"
image

I'm working on overhauling / modernizing our Jenkins jobs to use pipelines and this workflow might change... I would also be okay with allowing all pull requests to be built unless we've seen abuse from that in the past / until we see abuse from it in the future.

seantalts added a commit that referenced this pull request Oct 2, 2017
This reverts commit c67762a, reversing
changes made to b12a0eb.
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.

4 participants