diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/mathlib/halton.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/mathlib/halton.cpp')
| -rw-r--r-- | mp/src/mathlib/halton.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/mp/src/mathlib/halton.cpp b/mp/src/mathlib/halton.cpp index d0c56325..f9daae71 100644 --- a/mp/src/mathlib/halton.cpp +++ b/mp/src/mathlib/halton.cpp @@ -1,30 +1,30 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=====================================================================================//
-
-#include <halton.h>
-
-HaltonSequenceGenerator_t::HaltonSequenceGenerator_t(int b)
-{
- base=b;
- fbase=(float) b;
- seed=1;
-
-}
-
-float HaltonSequenceGenerator_t::GetElement(int elem)
-{
- int tmpseed=seed;
- float ret=0.0;
- float base_inv=1.0/fbase;
- while(tmpseed)
- {
- int dig=tmpseed % base;
- ret+=((float) dig)*base_inv;
- base_inv/=fbase;
- tmpseed/=base;
- }
- return ret;
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=====================================================================================// + +#include <halton.h> + +HaltonSequenceGenerator_t::HaltonSequenceGenerator_t(int b) +{ + base=b; + fbase=(float) b; + seed=1; + +} + +float HaltonSequenceGenerator_t::GetElement(int elem) +{ + int tmpseed=seed; + float ret=0.0; + float base_inv=1.0/fbase; + while(tmpseed) + { + int dig=tmpseed % base; + ret+=((float) dig)*base_inv; + base_inv/=fbase; + tmpseed/=base; + } + return ret; +} |