diff options
author | Chris Dyer <cdyer@allegro.clab.cs.cmu.edu> | 2014-03-18 02:05:25 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@allegro.clab.cs.cmu.edu> | 2014-03-18 02:05:25 -0400 |
commit | 2a9ee1febae6a63173f74ae24e2bfe439e409525 (patch) | |
tree | 44b930ed4bdaedc4e6c6f43af18474fb367b97fd /utils/star.h | |
parent | 55beb71dbbfe8421a8e8be9d2d7868a5d87d77d5 (diff) |
chris edits
Diffstat (limited to 'utils/star.h')
-rw-r--r-- | utils/star.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/star.h b/utils/star.h index e7358ffa..21977dc9 100644 --- a/utils/star.h +++ b/utils/star.h @@ -4,14 +4,14 @@ // star(x) computes the infinite sum x^0 + x^1 + x^2 + ... template <typename T> -T star(const T& x) { +inline T star(const T& x) { if (!x) return T(); if (x > T(1)) return std::numeric_limits<T>::infinity(); if (x < -T(1)) return -std::numeric_limits<T>::infinity(); return T(1) / (T(1) - x); } -bool star(bool x) { +inline bool star(bool x) { return x; } |