From 766629370bbecfb05513aed9cd16f783be5e1543 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Tue, 18 Mar 2014 01:55:19 -0400 Subject: star bool --- utils/star.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'utils') diff --git a/utils/star.h b/utils/star.h index 3295112c..e7358ffa 100644 --- a/utils/star.h +++ b/utils/star.h @@ -1,6 +1,8 @@ #ifndef _STAR_H_ #define _STAR_H_ +// star(x) computes the infinite sum x^0 + x^1 + x^2 + ... + template T star(const T& x) { if (!x) return T(); @@ -9,4 +11,8 @@ T star(const T& x) { return T(1) / (T(1) - x); } +bool star(bool x) { + return x; +} + #endif -- cgit v1.2.3