diff options
Diffstat (limited to 'intern/cycles/render/sobol.cpp')
-rw-r--r-- | intern/cycles/render/sobol.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/intern/cycles/render/sobol.cpp b/intern/cycles/render/sobol.cpp index 6906667ac19..01dfafa2ed9 100644 --- a/intern/cycles/render/sobol.cpp +++ b/intern/cycles/render/sobol.cpp @@ -7,7 +7,7 @@ * http://web.maths.unsw.edu.au/~fkuo/sobol/ * * From these papers: - * + * * S. Joe and F. Y. Kuo, Remark on Algorithm 659: Implementing Sobol's quasirandom * sequence generator, ACM Trans. Math. Softw. 29, 49-57 (2003) * @@ -18,22 +18,22 @@ /* Copyright (c) 2008, Frances Y. Kuo and Stephen Joe * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * * Neither the names of the copyright holders nor the names of the * University of New South Wales and the University of Waikato * and its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -21284,21 +21284,20 @@ void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions if(L <= s) { for(uint i = 0; i < L; i++) - v[i] = m[i] << (31-i); + v[i] = m[i] << (31-i); } else { for(uint i = 0; i < s; i++) - v[i] = m[i] << (31-i); + v[i] = m[i] << (31-i); for(uint i = s; i < L; i++) { - v[i] = v[i-s] ^ (v[i-s] >> s); + v[i] = v[i-s] ^ (v[i-s] >> s); - for(uint k = 1; k < s; k++) - v[i] ^= (((a >> (s-1-k)) & 1) * v[i-k]); + for(uint k = 1; k < s; k++) + v[i] ^= (((a >> (s-1-k)) & 1) * v[i-k]); } } } } CCL_NAMESPACE_END - |