d56d64b45eadccecbb61bba97c0cdf278094a0ebbe0b7cc8e8f3de855735cec1
Created: 2019-10-12 06:53:48.403379 UTC
Size: 451
Preview (limited to 512 bytes)
"module Algo.Rootfix where\n\nimport Data.Vector.Unboxed as V\n\nrootfix :: (V.Vector Int, V.Vector Int) -> V.Vector Int\n{-# NOINLINE rootfix #-}\nrootfix (ls, rs) = rootfix (V.replicate (V.length ls) 1) ls rs\n where\n rootfix xs ls rs\n = let zs = V.replicate (V.length ls * 2) 0\n vs = V.update_ (V.update_ zs ls xs) rs (V.map negate xs)\n sums = V.prescanl' (+) 0 vs\n in\n V.backpermute sums ls\n\n"
A service provided by FP Complete