@@ -205,7 +205,7 @@ condition gives:
205205"""
206206function prefiltering_system {T,TC} (:: Type{T} , :: Type{TC} , n:: Int ,
207207 :: Type{Cubic{Line}} , :: Type{OnCell} )
208- dl,d,du = inner_system_diags (T,n,Cubic{Flat })
208+ dl,d,du = inner_system_diags (T,n,Cubic{Line })
209209 d[1 ] = d[end ] = 3
210210 du[1 ] = dl[end ] = - 7
211211
@@ -231,18 +231,29 @@ condition gives:
231231This is the same system as `Quadratic{Line}`, `OnGrid` so we reuse the
232232implementation
233233"""
234- function prefiltering_system {T,TC,GT<:GridType} (:: Type{T} , :: Type{TC} , n:: Int ,
235- :: Type{Cubic{Line}} , :: Type{GT} )
236- prefiltering_system (T, TC, n, Quadratic{Line}, OnGrid)
234+ function prefiltering_system {T,TC} (:: Type{T} , :: Type{TC} , n:: Int ,
235+ :: Type{Cubic{Line}} , :: Type{OnGrid} )
236+ dl,d,du = inner_system_diags (T,n,Cubic{Line})
237+ d[1 ] = d[end ] = 1
238+ du[1 ] = dl[end ] = - 2
239+
240+ # now need Woodbury correction to set :
241+ # - [1, 3] and [n, n-2] ==> 1
242+ specs = _build_woodbury_specs (T, n,
243+ (1 , 3 , one (T)),
244+ (n, n- 2 , one (T)),
245+ )
246+
247+ Woodbury (lufact! (Tridiagonal (dl, d, du), Val{false }), specs... ), zeros (TC, n)
237248end
238249
239250function prefiltering_system {T,TC,GT<:GridType} (:: Type{T} , :: Type{TC} , n:: Int ,
240251 :: Type{Cubic{Periodic}} , :: Type{GT} )
241252 dl, d, du = inner_system_diags (T,n,Cubic{Periodic})
242253
243254 specs = _build_woodbury_specs (T, n,
244- (1 , n, SimpleRatio ( 1 , 6 ) ),
245- (n, 1 , SimpleRatio ( 1 , 6 ) )
255+ (1 , n, du[ 1 ] ),
256+ (n, 1 , dl[ end ] )
246257 )
247258
248259 Woodbury (lufact! (Tridiagonal (dl, d, du), Val{false }), specs... ), zeros (TC, n)
@@ -260,5 +271,12 @@ This is the same system as `Quadratic{Free}` so we reuse the implementation
260271"""
261272function prefiltering_system {T,TC,GT<:GridType} (:: Type{T} , :: Type{TC} , n:: Int ,
262273 :: Type{Cubic{Free}} , :: Type{GT} )
263- prefiltering_system (T, TC, n, Quadratic{Free}, GT)
274+ dl, d, du = inner_system_diags (T,n,Cubic{Periodic})
275+
276+ specs = _build_woodbury_specs (T, n,
277+ (1 , n, du[1 ]),
278+ (n, 1 , dl[end ])
279+ )
280+
281+ Woodbury (lufact! (Tridiagonal (dl, d, du), Val{false }), rowspec, valspec, colspec), zeros (TC, n)
264282end
0 commit comments