  | otherwise = integrateAll (res + (enB - enA)*(nA+nB)*0.5) (b:as)
integrateAll _ _ = 99

sumRow :: Matrix Double -> Vector Double
sumRow a = a #> konst 1 (cols a)

getY0 :: Matrix Double -> Vector Double
getY0 dos = getY0' lowPos higNeg
  where
    rTDOS = toRows $ dos
    highestNeg = (+) (-1) $ fromJust $ findIndex (\a -> (atIndex a 0) >= 0) rTDOS