d56d64b45eadccecbb61bba97c0cdf278094a0ebbe0b7cc8e8f3de855735cec1

Download raw

Created: 2023-12-19 03:40:10.302489 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"


Casa is a service provided by the Haskell Foundation │ Originally developed by FP Complete