module Data.Packed.Vector (
Vector,
fromList, (|>), toList,
dim, (@>),
subVector, join,
constant, linspace,
vectorMax, vectorMin, vectorMaxIndex, vectorMinIndex,
liftVector, liftVector2
) where
import Data.Packed.Internal
import Numeric.GSL.Vector
linspace :: Int -> (Double, Double) -> Vector Double
linspace n (a,b) = add a $ scale s $ fromList [0 .. fromIntegral n1]
where scale = vectorMapValR Scale
add = vectorMapValR AddConstant
s = (ba)/fromIntegral (n1)
vectorMax :: Vector Double -> Double
vectorMax = toScalarR Max
vectorMin :: Vector Double -> Double
vectorMin = toScalarR Min
vectorMaxIndex :: Vector Double -> Int
vectorMaxIndex = round . toScalarR MaxIdx
vectorMinIndex :: Vector Double -> Int
vectorMinIndex = round . toScalarR MinIdx