@@ -150,7 +150,7 @@ extension NBKPrimeSieve {
150
150
151
151
for pattern in self . culls. patterns {
152
152
var pattern = NBK . CyclicIterator ( pattern) !
153
- pattern. set ( iteration : iteration)
153
+ pattern. formIteration ( iteration)
154
154
self . cache. sieve ( pattern: pattern)
155
155
}
156
156
//=--------------------------------------=
@@ -172,8 +172,8 @@ extension NBKPrimeSieve {
172
172
guard product. partialValue <= limit, !product. overflow else { continue }
173
173
Swift . assert ( start <= product. partialValue)
174
174
175
- inner. set ( unchecked: Int ( bitPattern: self . wheel. indices [ Int ( bitPattern: multiple % self . wheel. circumference) ] ) )
176
- cache. sieve ( from: ( product. partialValue &- start) &>> 1 as UInt , stride: { prime &* inner. next ( ) &>> 1 as UInt } ) // OK
175
+ inner. setIndex ( unchecked: Int ( bitPattern: self . wheel. indices [ Int ( bitPattern: multiple % self . wheel. circumference) ] ) )
176
+ cache. sieve ( from: ( product. partialValue &- start) &>> 1 as UInt , stride: { prime &* inner. next ( ) &>> 1 as UInt } ) // OK
177
177
}
178
178
//=--------------------------------------=
179
179
Self . commit ( & self . cache, to: & self . state)
@@ -236,7 +236,7 @@ extension NBKPrimeSieve {
236
236
defer { value &+= outer. next ( ) }
237
237
guard cache [ value &>> 1 as UInt ] else { continue }
238
238
239
- inner. set ( unchecked: ( wheel) . indices [ Int ( bitPattern: value % wheel. circumference) ] )
239
+ inner. setIndex ( unchecked: wheel. indices [ Int ( bitPattern: value % wheel. circumference) ] )
240
240
cache. sieve ( from: square. partialValue &>> 1 as UInt , stride: { value &* inner. next ( ) &>> 1 as UInt } ) // OK
241
241
}
242
242
//=--------------------------------------=
@@ -591,7 +591,7 @@ extension NBKPrimeSieve {
591
591
592
592
/// Patterns grow multiplicatively, so chunking reduces memory cost.
593
593
///
594
- /// g([3, 5, 7, 11, 13]) -> [f([2 , 13]), f([5, 11]), f([7])]
594
+ /// g([3, 5, 7, 11, 13]) -> [f([3 , 13]), f([5, 11]), f([7])]
595
595
///
596
596
@usableFromInline static func patterns( primes: [ UInt ] ) -> [ [ UInt ] ] {
597
597
var patterns = [ [ UInt] ] ( )
@@ -611,7 +611,7 @@ extension NBKPrimeSieve {
611
611
return patterns as [ [ UInt ] ]
612
612
}
613
613
614
- /// A cyclical pattern marking each odd multiple of prime in `primes`.
614
+ /// A cyclical pattern marking odd multiples of each prime in `primes`.
615
615
///
616
616
/// - Note: The sieve culls even numbers by omission.
617
617
///
0 commit comments