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

Improve sign check in Vogels/Sprengeler synapse #966

Merged
merged 2 commits into from Jun 11, 2018
Merged

Conversation

@sanjayankur31
Copy link
Contributor

@sanjayankur31 sanjayankur31 commented Jun 6, 2018

Fixes #825

@sanjayankur31
Copy link
Contributor Author

@sanjayankur31 sanjayankur31 commented Jun 6, 2018

Eh - I seem to have broken a whole lot of tests with this. Checking up.

Fixes #825
@sanjayankur31 sanjayankur31 force-pushed the sanjayankur31:fix-825 branch from bce01db to 883a0a3 Jun 6, 2018
@sanjayankur31 sanjayankur31 changed the title Improve sign check Fix #825: Improve sign check Jun 6, 2018
@heplesser heplesser requested review from heplesser and jougs Jun 11, 2018
@@ -298,8 +298,7 @@ VogelsSprekelerConnection< targetidentifierT >::set_status(
updateValue< double >( d, names::Kplus, Kplus_ );

// check if weight_ and Wmax_ has the same sign
if ( not( ( ( weight_ >= 0 ) - ( weight_ < 0 ) )
== ( ( Wmax_ >= 0 ) - ( Wmax_ < 0 ) ) ) )
if ( weight_ != 0 && not( ( weight_ > 0 ) == ( Wmax_ > 0 ) ) )

This comment has been minimized.

@heplesser

heplesser Jun 11, 2018
Contributor

@sanjayankur31 The comment above the check is on entirely in sync with the code. Also, the code needs quite a bit of thought to understand it. Since we now allow C++11 constructs in NEST, I would suggest

weight != 0 and ( std::signbit( weight_ ) != std::signbit( Wmax_ ) )
Based on feedback by @heplesser in the code review.
@jougs
jougs approved these changes Jun 11, 2018
Copy link
Contributor

@jougs jougs left a comment

Nice. Thanks!

@jougs jougs merged commit 061b1d4 into nest:master Jun 11, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sanjayankur31 sanjayankur31 deleted the sanjayankur31:fix-825 branch Jun 11, 2018
@jougs jougs changed the title Fix #825: Improve sign check Improve sign check in Vogels/Sprengeler synapse Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.