module Numeric.BLAS.CArray.Float where
import qualified Numeric.BLAS.FFI.Float as FFI
import qualified Numeric.Netlib.CArray.Utility as Call
import Data.Array.IOCArray (IOCArray, getBounds)
import Data.Array.CArray (CArray, bounds)
import Foreign.Storable.Complex ()
import Foreign.Storable (peek)
import Foreign.C.Types (CInt)
import Control.Monad.Trans.Cont (evalContT)
import Control.Monad.IO.Class (liftIO)
import Control.Applicative (pure, (<*>), (<$>))
asum ::
Int ->
CArray Int Float ->
Int ->
IO Float
asum n sx incx = do
let sxDim0 = Call.sizes1 $ bounds sx
Call.assert "asum: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
evalContT $ do
nPtr <- Call.cint n
sxPtr <- Call.array sx
incxPtr <- Call.cint incx
liftIO $ FFI.asum nPtr sxPtr incxPtr
axpy ::
Int ->
Float ->
CArray Int Float ->
Int ->
IOCArray Int Float ->
Int ->
IO ()
axpy n sa sx incx sy incy = do
let sxDim0 = Call.sizes1 $ bounds sx
syDim0 <- Call.sizes1 <$> getBounds sy
Call.assert "axpy: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
Call.assert "axpy: 1+(n-1)*abs(incy) == syDim0" (1+(n-1)*abs(incy) == syDim0)
evalContT $ do
nPtr <- Call.cint n
saPtr <- Call.float sa
sxPtr <- Call.array sx
incxPtr <- Call.cint incx
syPtr <- Call.ioarray sy
incyPtr <- Call.cint incy
liftIO $ FFI.axpy nPtr saPtr sxPtr incxPtr syPtr incyPtr
copy ::
Int ->
CArray Int Float ->
Int ->
Int ->
IO (CArray Int Float)
copy n sx incx incy = do
let sxDim0 = Call.sizes1 $ bounds sx
Call.assert "copy: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
sy <- Call.newArray1 (1+(n-1)*abs(incy))
evalContT $ do
nPtr <- Call.cint n
sxPtr <- Call.array sx
incxPtr <- Call.cint incx
syPtr <- Call.ioarray sy
incyPtr <- Call.cint incy
liftIO $ FFI.copy nPtr sxPtr incxPtr syPtr incyPtr
liftIO $ Call.freezeArray sy
dot ::
Int ->
CArray Int Float ->
Int ->
CArray Int Float ->
Int ->
IO Float
dot n sx incx sy incy = do
let sxDim0 = Call.sizes1 $ bounds sx
let syDim0 = Call.sizes1 $ bounds sy
Call.assert "dot: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
Call.assert "dot: 1+(n-1)*abs(incy) == syDim0" (1+(n-1)*abs(incy) == syDim0)
evalContT $ do
nPtr <- Call.cint n
sxPtr <- Call.array sx
incxPtr <- Call.cint incx
syPtr <- Call.array sy
incyPtr <- Call.cint incy
liftIO $ FFI.dot nPtr sxPtr incxPtr syPtr incyPtr
dsdot ::
Int ->
Float ->
CArray Int Float ->
Int ->
CArray Int Float ->
Int ->
IO Float
dsdot n sb sx incx sy incy = do
let sxDim0 = Call.sizes1 $ bounds sx
let syDim0 = Call.sizes1 $ bounds sy
Call.assert "dsdot: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
Call.assert "dsdot: 1+(n-1)*abs(incx) == syDim0" (1+(n-1)*abs(incx) == syDim0)
evalContT $ do
nPtr <- Call.cint n
sbPtr <- Call.float sb
sxPtr <- Call.array sx
incxPtr <- Call.cint incx
syPtr <- Call.array sy
incyPtr <- Call.cint incy
liftIO $ FFI.dsdot nPtr sbPtr sxPtr incxPtr syPtr incyPtr
gbmv ::
Char ->
Int ->
Int ->
Int ->
Float ->
CArray (Int,Int) Float ->
CArray Int Float ->
Int ->
Float ->
IOCArray Int Float ->
Int ->
IO ()
gbmv trans m kl ku alpha a x incx beta y incy = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let xDim0 = Call.sizes1 $ bounds x
yDim0 <- Call.sizes1 <$> getBounds y
let n = aDim0
let lda = aDim1
let _xSize = xDim0
let _ySize = yDim0
evalContT $ do
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.array x
incxPtr <- Call.cint incx
betaPtr <- Call.float beta
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
liftIO $ FFI.gbmv transPtr mPtr nPtr klPtr kuPtr alphaPtr aPtr ldaPtr xPtr incxPtr betaPtr yPtr incyPtr
gemm ::
Char ->
Char ->
Int ->
Int ->
Float ->
CArray (Int,Int) Float ->
CArray (Int,Int) Float ->
Float ->
IOCArray (Int,Int) Float ->
IO ()
gemm transa transb m k alpha a b beta c = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _ka = aDim0
let lda = aDim1
let _kb = bDim0
let ldb = bDim1
let n = cDim0
let ldc = cDim1
evalContT $ do
transaPtr <- Call.char transa
transbPtr <- Call.char transb
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
betaPtr <- Call.float beta
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
liftIO $ FFI.gemm transaPtr transbPtr mPtr nPtr kPtr alphaPtr aPtr ldaPtr bPtr ldbPtr betaPtr cPtr ldcPtr
gemv ::
Char ->
Int ->
Float ->
CArray (Int,Int) Float ->
CArray Int Float ->
Int ->
Float ->
IOCArray Int Float ->
Int ->
IO ()
gemv trans m alpha a x incx beta y incy = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let xDim0 = Call.sizes1 $ bounds x
yDim0 <- Call.sizes1 <$> getBounds y
let n = aDim0
let lda = aDim1
let _xSize = xDim0
let _ySize = yDim0
evalContT $ do
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.array x
incxPtr <- Call.cint incx
betaPtr <- Call.float beta
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
liftIO $ FFI.gemv transPtr mPtr nPtr alphaPtr aPtr ldaPtr xPtr incxPtr betaPtr yPtr incyPtr
ger ::
Int ->
Float ->
CArray Int Float ->
Int ->
CArray Int Float ->
Int ->
IOCArray (Int,Int) Float ->
IO ()
ger m alpha x incx y incy a = do
let xDim0 = Call.sizes1 $ bounds x
let yDim0 = Call.sizes1 $ bounds y
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let _xSize = xDim0
let _ySize = yDim0
let n = aDim0
let lda = aDim1
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
xPtr <- Call.array x
incxPtr <- Call.cint incx
yPtr <- Call.array y
incyPtr <- Call.cint incy
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
liftIO $ FFI.ger mPtr nPtr alphaPtr xPtr incxPtr yPtr incyPtr aPtr ldaPtr
sbmv ::
Char ->
Int ->
Float ->
CArray (Int,Int) Float ->
CArray Int Float ->
Int ->
Float ->
IOCArray Int Float ->
Int ->
IO ()
sbmv uplo k alpha a x incx beta y incy = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let xDim0 = Call.sizes1 $ bounds x
yDim0 <- Call.sizes1 <$> getBounds y
let n = aDim0
let lda = aDim1
let _xSize = xDim0
let _ySize = yDim0
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kPtr <- Call.cint k
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.array x
incxPtr <- Call.cint incx
betaPtr <- Call.float beta
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
liftIO $ FFI.sbmv uploPtr nPtr kPtr alphaPtr aPtr ldaPtr xPtr incxPtr betaPtr yPtr incyPtr
symv ::
Char ->
Float ->
CArray (Int,Int) Float ->
CArray Int Float ->
Int ->
Float ->
IOCArray Int Float ->
Int ->
IO ()
symv uplo alpha a x incx beta y incy = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let xDim0 = Call.sizes1 $ bounds x
yDim0 <- Call.sizes1 <$> getBounds y
let n = aDim0
let lda = aDim1
let _xSize = xDim0
let _ySize = yDim0
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.array x
incxPtr <- Call.cint incx
betaPtr <- Call.float beta
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
liftIO $ FFI.symv uploPtr nPtr alphaPtr aPtr ldaPtr xPtr incxPtr betaPtr yPtr incyPtr
syr ::
Char ->
Float ->
CArray Int Float ->
Int ->
IOCArray (Int,Int) Float ->
IO ()
syr uplo alpha x incx a = do
let xDim0 = Call.sizes1 $ bounds x
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let _xSize = xDim0
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
xPtr <- Call.array x
incxPtr <- Call.cint incx
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
liftIO $ FFI.syr uploPtr nPtr alphaPtr xPtr incxPtr aPtr ldaPtr
syr2 ::
Char ->
Float ->
CArray Int Float ->
Int ->
CArray Int Float ->
Int ->
IOCArray (Int,Int) Float ->
IO ()
syr2 uplo alpha x incx y incy a = do
let xDim0 = Call.sizes1 $ bounds x
let yDim0 = Call.sizes1 $ bounds y
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let _xSize = xDim0
let _ySize = yDim0
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
xPtr <- Call.array x
incxPtr <- Call.cint incx
yPtr <- Call.array y
incyPtr <- Call.cint incy
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
liftIO $ FFI.syr2 uploPtr nPtr alphaPtr xPtr incxPtr yPtr incyPtr aPtr ldaPtr
spmv ::
Char ->
Int ->
Float ->
CArray Int Float ->
CArray Int Float ->
Int ->
Float ->
IOCArray Int Float ->
Int ->
IO ()
spmv uplo n alpha ap x incx beta y incy = do
let apDim0 = Call.sizes1 $ bounds ap
let xDim0 = Call.sizes1 $ bounds x
yDim0 <- Call.sizes1 <$> getBounds y
let _apSize = apDim0
let _xSize = xDim0
let _ySize = yDim0
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
apPtr <- Call.array ap
xPtr <- Call.array x
incxPtr <- Call.cint incx
betaPtr <- Call.float beta
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
liftIO $ FFI.spmv uploPtr nPtr alphaPtr apPtr xPtr incxPtr betaPtr yPtr incyPtr
spr ::
Char ->
Int ->
Float ->
CArray Int Float ->
Int ->
IOCArray Int Float ->
IO ()
spr uplo n alpha x incx ap = do
let xDim0 = Call.sizes1 $ bounds x
apDim0 <- Call.sizes1 <$> getBounds ap
let _xSize = xDim0
let _apSize = apDim0
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
xPtr <- Call.array x
incxPtr <- Call.cint incx
apPtr <- Call.ioarray ap
liftIO $ FFI.spr uploPtr nPtr alphaPtr xPtr incxPtr apPtr
spr2 ::
Char ->
Int ->
Float ->
CArray Int Float ->
Int ->
CArray Int Float ->
Int ->
IOCArray Int Float ->
IO ()
spr2 uplo n alpha x incx y incy ap = do
let xDim0 = Call.sizes1 $ bounds x
let yDim0 = Call.sizes1 $ bounds y
apDim0 <- Call.sizes1 <$> getBounds ap
let _xSize = xDim0
let _ySize = yDim0
let _apSize = apDim0
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
xPtr <- Call.array x
incxPtr <- Call.cint incx
yPtr <- Call.array y
incyPtr <- Call.cint incy
apPtr <- Call.ioarray ap
liftIO $ FFI.spr2 uploPtr nPtr alphaPtr xPtr incxPtr yPtr incyPtr apPtr
iamax ::
Int ->
CArray Int Float ->
Int ->
IO CInt
iamax n sx incx = do
let sxDim0 = Call.sizes1 $ bounds sx
Call.assert "iamax: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
evalContT $ do
nPtr <- Call.cint n
sxPtr <- Call.array sx
incxPtr <- Call.cint incx
liftIO $ FFI.iamax nPtr sxPtr incxPtr
nrm2 ::
Int ->
CArray Int Float ->
Int ->
IO Float
nrm2 n x incx = do
let xDim0 = Call.sizes1 $ bounds x
Call.assert "nrm2: 1+(n-1)*abs(incx) == xDim0" (1+(n-1)*abs(incx) == xDim0)
evalContT $ do
nPtr <- Call.cint n
xPtr <- Call.array x
incxPtr <- Call.cint incx
liftIO $ FFI.nrm2 nPtr xPtr incxPtr
rot ::
Int ->
IOCArray Int Float ->
Int ->
IOCArray Int Float ->
Int ->
Float ->
Float ->
IO ()
rot n sx incx sy incy c s = do
sxDim0 <- Call.sizes1 <$> getBounds sx
syDim0 <- Call.sizes1 <$> getBounds sy
Call.assert "rot: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
Call.assert "rot: 1+(n-1)*abs(incy) == syDim0" (1+(n-1)*abs(incy) == syDim0)
evalContT $ do
nPtr <- Call.cint n
sxPtr <- Call.ioarray sx
incxPtr <- Call.cint incx
syPtr <- Call.ioarray sy
incyPtr <- Call.cint incy
cPtr <- Call.float c
sPtr <- Call.float s
liftIO $ FFI.rot nPtr sxPtr incxPtr syPtr incyPtr cPtr sPtr
rotg ::
Float ->
Float ->
IO (Float, Float)
rotg sa sb = do
evalContT $ do
saPtr <- Call.float sa
sbPtr <- Call.float sb
cPtr <- Call.alloca
sPtr <- Call.alloca
liftIO $ FFI.rotg saPtr sbPtr cPtr sPtr
liftIO $ pure (,)
<*> peek cPtr
<*> peek sPtr
rotm ::
Int ->
IOCArray Int Float ->
Int ->
IOCArray Int Float ->
Int ->
CArray Int Float ->
IO ()
rotm n sx incx sy incy sparam = do
sxDim0 <- Call.sizes1 <$> getBounds sx
syDim0 <- Call.sizes1 <$> getBounds sy
let sparamDim0 = Call.sizes1 $ bounds sparam
Call.assert "rotm: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
Call.assert "rotm: 1+(n-1)*abs(incy) == syDim0" (1+(n-1)*abs(incy) == syDim0)
Call.assert "rotm: 5 == sparamDim0" (5 == sparamDim0)
evalContT $ do
nPtr <- Call.cint n
sxPtr <- Call.ioarray sx
incxPtr <- Call.cint incx
syPtr <- Call.ioarray sy
incyPtr <- Call.cint incy
sparamPtr <- Call.array sparam
liftIO $ FFI.rotm nPtr sxPtr incxPtr syPtr incyPtr sparamPtr
rotmg ::
Float ->
Float ->
Float ->
Float ->
IO (Float, Float, Float, CArray Int Float)
rotmg sd1 sd2 sx1 sy1 = do
sparam <- Call.newArray1 5
evalContT $ do
sd1Ptr <- Call.float sd1
sd2Ptr <- Call.float sd2
sx1Ptr <- Call.float sx1
sy1Ptr <- Call.float sy1
sparamPtr <- Call.ioarray sparam
liftIO $ FFI.rotmg sd1Ptr sd2Ptr sx1Ptr sy1Ptr sparamPtr
liftIO $ pure (,,,)
<*> peek sd1Ptr
<*> peek sd2Ptr
<*> peek sx1Ptr
<*> Call.freezeArray sparam
scal ::
Int ->
Float ->
IOCArray Int Float ->
Int ->
IO ()
scal n sa sx incx = do
sxDim0 <- Call.sizes1 <$> getBounds sx
Call.assert "scal: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
evalContT $ do
nPtr <- Call.cint n
saPtr <- Call.float sa
sxPtr <- Call.ioarray sx
incxPtr <- Call.cint incx
liftIO $ FFI.scal nPtr saPtr sxPtr incxPtr
swap ::
Int ->
IOCArray Int Float ->
Int ->
IOCArray Int Float ->
Int ->
IO ()
swap n sx incx sy incy = do
sxDim0 <- Call.sizes1 <$> getBounds sx
syDim0 <- Call.sizes1 <$> getBounds sy
Call.assert "swap: 1+(n-1)*abs(incx) == sxDim0" (1+(n-1)*abs(incx) == sxDim0)
Call.assert "swap: 1+(n-1)*abs(incy) == syDim0" (1+(n-1)*abs(incy) == syDim0)
evalContT $ do
nPtr <- Call.cint n
sxPtr <- Call.ioarray sx
incxPtr <- Call.cint incx
syPtr <- Call.ioarray sy
incyPtr <- Call.cint incy
liftIO $ FFI.swap nPtr sxPtr incxPtr syPtr incyPtr
symm ::
Char ->
Char ->
Int ->
Float ->
CArray (Int,Int) Float ->
CArray (Int,Int) Float ->
Float ->
IOCArray (Int,Int) Float ->
IO ()
symm side uplo m alpha a b beta c = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _ka = aDim0
let lda = aDim1
let n = bDim0
let ldb = bDim1
let ldc = cDim1
Call.assert "symm: n == cDim0" (n == cDim0)
evalContT $ do
sidePtr <- Call.char side
uploPtr <- Call.char uplo
mPtr <- Call.cint m
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
betaPtr <- Call.float beta
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
liftIO $ FFI.symm sidePtr uploPtr mPtr nPtr alphaPtr aPtr ldaPtr bPtr ldbPtr betaPtr cPtr ldcPtr
syr2k ::
Char ->
Char ->
Int ->
Float ->
CArray (Int,Int) Float ->
CArray (Int,Int) Float ->
Float ->
IOCArray (Int,Int) Float ->
IO ()
syr2k uplo trans k alpha a b beta c = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _ka = aDim0
let lda = aDim1
let _kb = bDim0
let ldb = bDim1
let n = cDim0
let ldc = cDim1
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
nPtr <- Call.cint n
kPtr <- Call.cint k
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
betaPtr <- Call.float beta
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
liftIO $ FFI.syr2k uploPtr transPtr nPtr kPtr alphaPtr aPtr ldaPtr bPtr ldbPtr betaPtr cPtr ldcPtr
syrk ::
Char ->
Char ->
Int ->
Float ->
CArray (Int,Int) Float ->
Float ->
IOCArray (Int,Int) Float ->
IO ()
syrk uplo trans k alpha a beta c = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _ka = aDim0
let lda = aDim1
let n = cDim0
let ldc = cDim1
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
nPtr <- Call.cint n
kPtr <- Call.cint k
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
betaPtr <- Call.float beta
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
liftIO $ FFI.syrk uploPtr transPtr nPtr kPtr alphaPtr aPtr ldaPtr betaPtr cPtr ldcPtr
tbmv ::
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) Float ->
IOCArray Int Float ->
Int ->
IO ()
tbmv uplo trans diag k a x incx = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
xDim0 <- Call.sizes1 <$> getBounds x
let n = aDim0
let lda = aDim1
let _xSize = xDim0
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
liftIO $ FFI.tbmv uploPtr transPtr diagPtr nPtr kPtr aPtr ldaPtr xPtr incxPtr
tbsv ::
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) Float ->
IOCArray Int Float ->
Int ->
IO ()
tbsv uplo trans diag k a x incx = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
xDim0 <- Call.sizes1 <$> getBounds x
let n = aDim0
let lda = aDim1
let _xSize = xDim0
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
liftIO $ FFI.tbsv uploPtr transPtr diagPtr nPtr kPtr aPtr ldaPtr xPtr incxPtr
tpmv ::
Char ->
Char ->
Char ->
Int ->
CArray Int Float ->
IOCArray Int Float ->
Int ->
IO ()
tpmv uplo trans diag n ap x incx = do
let apDim0 = Call.sizes1 $ bounds ap
xDim0 <- Call.sizes1 <$> getBounds x
let _apSize = apDim0
let _xSize = xDim0
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
apPtr <- Call.array ap
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
liftIO $ FFI.tpmv uploPtr transPtr diagPtr nPtr apPtr xPtr incxPtr
tpsv ::
Char ->
Char ->
Char ->
Int ->
CArray Int Float ->
IOCArray Int Float ->
Int ->
IO ()
tpsv uplo trans diag n ap x incx = do
let apDim0 = Call.sizes1 $ bounds ap
xDim0 <- Call.sizes1 <$> getBounds x
let _apSize = apDim0
let _xSize = xDim0
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
apPtr <- Call.array ap
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
liftIO $ FFI.tpsv uploPtr transPtr diagPtr nPtr apPtr xPtr incxPtr
trmm ::
Char ->
Char ->
Char ->
Char ->
Int ->
Float ->
CArray (Int,Int) Float ->
IOCArray (Int,Int) Float ->
IO ()
trmm side uplo transa diag m alpha a b = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let _k = aDim0
let lda = aDim1
let n = bDim0
let ldb = bDim1
evalContT $ do
sidePtr <- Call.char side
uploPtr <- Call.char uplo
transaPtr <- Call.char transa
diagPtr <- Call.char diag
mPtr <- Call.cint m
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
liftIO $ FFI.trmm sidePtr uploPtr transaPtr diagPtr mPtr nPtr alphaPtr aPtr ldaPtr bPtr ldbPtr
trmv ::
Char ->
Char ->
Char ->
CArray (Int,Int) Float ->
IOCArray Int Float ->
Int ->
IO ()
trmv uplo trans diag a x incx = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
xDim0 <- Call.sizes1 <$> getBounds x
let n = aDim0
let lda = aDim1
let _xSize = xDim0
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
liftIO $ FFI.trmv uploPtr transPtr diagPtr nPtr aPtr ldaPtr xPtr incxPtr
trsm ::
Char ->
Char ->
Char ->
Char ->
Int ->
Float ->
CArray (Int,Int) Float ->
IOCArray (Int,Int) Float ->
IO ()
trsm side uplo transa diag m alpha a b = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let _k = aDim0
let lda = aDim1
let n = bDim0
let ldb = bDim1
evalContT $ do
sidePtr <- Call.char side
uploPtr <- Call.char uplo
transaPtr <- Call.char transa
diagPtr <- Call.char diag
mPtr <- Call.cint m
nPtr <- Call.cint n
alphaPtr <- Call.float alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
liftIO $ FFI.trsm sidePtr uploPtr transaPtr diagPtr mPtr nPtr alphaPtr aPtr ldaPtr bPtr ldbPtr
trsv ::
Char ->
Char ->
Char ->
CArray (Int,Int) Float ->
IOCArray Int Float ->
Int ->
IO ()
trsv uplo trans diag a x incx = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
xDim0 <- Call.sizes1 <$> getBounds x
let n = aDim0
let lda = aDim1
let _xSize = xDim0
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
liftIO $ FFI.trsv uploPtr transPtr diagPtr nPtr aPtr ldaPtr xPtr incxPtr