Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r941 - trunk/Core/Math
- Date: Fri, 17 Feb 2006 15:10:01 -0700 (MST)
Author: bigler
Date: Fri Feb 17 15:10:01 2006
New Revision: 941
Modified:
trunk/Core/Math/HaltonSequence.h
Log:
Changed member variable n's name to next_value to avoid scoping
mistakes with the parameter n.
Modified: trunk/Core/Math/HaltonSequence.h
==============================================================================
--- trunk/Core/Math/HaltonSequence.h (original)
+++ trunk/Core/Math/HaltonSequence.h Fri Feb 17 15:10:01 2006
@@ -37,15 +37,15 @@
template< typename T, int S >
class HaltonSequence {
public:
- HaltonSequence( int n_ = 1 ) : n( n ) { };
+ HaltonSequence( int n = 1 ) : next_value( n ) { };
// Generate the next number in the sequence.
void next( VectorT<T,S>& p ) {
static const int halton_sequence_primes[] = { 2, 3, 5, 7 };
for (int i=0;i<S;++i) {
- p[i] = folded_radical_inverse( n, halton_sequence_primes[i] );
+ p[i] = folded_radical_inverse( next_value, halton_sequence_primes[i]
);
}
- ++n;
+ ++next_value;
}
private:
@@ -53,7 +53,7 @@
inline Real radical_inverse( int n, int b ) {
Real val = 0;
- Real inv_b = 1.0 / (Real)b;
+ Real inv_b = 1 / (Real)b;
Real inv_bi = inv_b;
while (n > 0) {
@@ -69,7 +69,7 @@
inline Real folded_radical_inverse( int n, int b ) {
Real val = 0;
- Real inv_b = 1.0 / (Real)b;
+ Real inv_b = 1 / (Real)b;
Real inv_bi = inv_b;
int offset = 0;
@@ -85,7 +85,7 @@
};
// Private members.
- int n;
+ int next_value;
};
};
- [MANTA] r941 - trunk/Core/Math, bigler, 02/17/2006
Archive powered by MHonArc 2.6.16.