From 812e4b2a41df28b3091d753bb77b5faa33142a80 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Tue, 4 Dec 2012 23:15:23 -0800 Subject: [PATCH] Fixed indent. --- include/bx/rng.h | 194 +++++++++++++++++++++++------------------------ 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/include/bx/rng.h b/include/bx/rng.h index 93d453d..23f54f3 100644 --- a/include/bx/rng.h +++ b/include/bx/rng.h @@ -1,97 +1,97 @@ -/* - * Copyright 2010-2012 Branimir Karadzic. All rights reserved. - * License: http://www.opensource.org/licenses/BSD-2-Clause - */ - -#ifndef __BX_RNG_H__ -#define __BX_RNG_H__ - -#include "bx.h" - -namespace bx -{ - // George Marsaglia's MWC - class RngMwc - { - public: - RngMwc(uint32_t _z = 12345, uint32_t _w = 65435) - : m_z(_z) - , m_w(_w) - { - } - - void reset(uint32_t _z = 12345, uint32_t _w = 65435) - { - m_z = _z; - m_w = _w; - } - - uint32_t gen() - { - m_z = 36969*(m_z&65535)+(m_z>>16); - m_w = 18000*(m_w&65535)+(m_w>>16); - return (m_z<<16)+m_w; - } - - private: - uint32_t m_z; - uint32_t m_w; - }; - - // George Marsaglia's FIB - class RngFib - { - public: - RngFib() - : m_a(9983651) - , m_b(95746118) - { - } - - void reset() - { - m_a = 9983651; - m_b = 95746118; - } - - uint32_t gen() - { - m_b = m_a+m_b; - m_a = m_b-m_a; - return m_a; - } - - private: - uint32_t m_a; - uint32_t m_b; - }; - - // George Marsaglia's SHR3 - class RngShr3 - { - public: - RngShr3(uint32_t _jsr = 34221) - : m_jsr(_jsr) - { - } - - void reset(uint32_t _jsr = 34221) - { - m_jsr = _jsr; - } - - uint32_t gen() - { - m_jsr ^= m_jsr<<17; - m_jsr ^= m_jsr>>13; - m_jsr ^= m_jsr<<5; - return m_jsr; - } - - private: - uint32_t m_jsr; - }; - -} // namespace bx - -#endif // __BX_RNG_H__ +/* + * Copyright 2010-2012 Branimir Karadzic. All rights reserved. + * License: http://www.opensource.org/licenses/BSD-2-Clause + */ + +#ifndef __BX_RNG_H__ +#define __BX_RNG_H__ + +#include "bx.h" + +namespace bx +{ + // George Marsaglia's MWC + class RngMwc + { + public: + RngMwc(uint32_t _z = 12345, uint32_t _w = 65435) + : m_z(_z) + , m_w(_w) + { + } + + void reset(uint32_t _z = 12345, uint32_t _w = 65435) + { + m_z = _z; + m_w = _w; + } + + uint32_t gen() + { + m_z = 36969*(m_z&65535)+(m_z>>16); + m_w = 18000*(m_w&65535)+(m_w>>16); + return (m_z<<16)+m_w; + } + + private: + uint32_t m_z; + uint32_t m_w; + }; + + // George Marsaglia's FIB + class RngFib + { + public: + RngFib() + : m_a(9983651) + , m_b(95746118) + { + } + + void reset() + { + m_a = 9983651; + m_b = 95746118; + } + + uint32_t gen() + { + m_b = m_a+m_b; + m_a = m_b-m_a; + return m_a; + } + + private: + uint32_t m_a; + uint32_t m_b; + }; + + // George Marsaglia's SHR3 + class RngShr3 + { + public: + RngShr3(uint32_t _jsr = 34221) + : m_jsr(_jsr) + { + } + + void reset(uint32_t _jsr = 34221) + { + m_jsr = _jsr; + } + + uint32_t gen() + { + m_jsr ^= m_jsr<<17; + m_jsr ^= m_jsr>>13; + m_jsr ^= m_jsr<<5; + return m_jsr; + } + + private: + uint32_t m_jsr; + }; + +} // namespace bx + +#endif // __BX_RNG_H__