module Numeric.LAPACK.CArray.ComplexFloat where
import qualified Numeric.LAPACK.FFI.ComplexFloat as Lapack
import qualified Numeric.LAPACK.CArray.Utility as Call
import Numeric.LAPACK.CArray.Utility ((^!))
import Data.Array.IOCArray (IOCArray, getBounds)
import Data.Array.CArray (CArray, bounds)
import Data.Complex (Complex)
import Foreign.Storable.Complex ()
import Foreign.Storable (peek)
import Foreign.Ptr (Ptr, FunPtr)
import Foreign.C.String (castCCharToChar)
import Foreign.C.Types (CChar, CInt)
import Control.Monad.Trans.Cont (evalContT)
import Control.Monad.IO.Class (liftIO)
import Control.Applicative (pure, (<*>), (<$>))
bbcsd ::
Char ->
Char ->
Char ->
Char ->
Char ->
Int ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, CArray Int Float, CArray Int Float, CArray Int Float, CArray Int Float, CArray Int Float, CArray Int Float, CArray Int Float, Int)
bbcsd jobu1 jobu2 jobv1t jobv2t trans m theta phi u1 u2 v1t v2t lrwork = do
thetaDim0 <- Call.sizes1 <$> getBounds theta
phiDim0 <- Call.sizes1 <$> getBounds phi
(u1Dim0,u1Dim1) <- Call.sizes2 <$> getBounds u1
(u2Dim0,u2Dim1) <- Call.sizes2 <$> getBounds u2
(v1tDim0,v1tDim1) <- Call.sizes2 <$> getBounds v1t
(v2tDim0,v2tDim1) <- Call.sizes2 <$> getBounds v2t
let q = thetaDim0
let p = u1Dim0
let ldu1 = u1Dim1
let ldu2 = u2Dim1
let ldv1t = v1tDim1
let ldv2t = v2tDim1
Call.assert "bbcsd: q-1 == phiDim0" (q1 == phiDim0)
Call.assert "bbcsd: m-p == u2Dim0" (mp == u2Dim0)
Call.assert "bbcsd: q == v1tDim0" (q == v1tDim0)
Call.assert "bbcsd: m-q == v2tDim0" (mq == v2tDim0)
b11d <- Call.newArray1 q
b11e <- Call.newArray1 (q1)
b12d <- Call.newArray1 q
b12e <- Call.newArray1 (q1)
b21d <- Call.newArray1 q
b21e <- Call.newArray1 (q1)
b22d <- Call.newArray1 q
b22e <- Call.newArray1 (q1)
rwork <- Call.newArray1 (maximum[1,lrwork])
evalContT $ do
jobu1Ptr <- Call.char jobu1
jobu2Ptr <- Call.char jobu2
jobv1tPtr <- Call.char jobv1t
jobv2tPtr <- Call.char jobv2t
transPtr <- Call.char trans
mPtr <- Call.cint m
pPtr <- Call.cint p
qPtr <- Call.cint q
thetaPtr <- Call.ioarray theta
phiPtr <- Call.ioarray phi
u1Ptr <- Call.ioarray u1
ldu1Ptr <- Call.cint ldu1
u2Ptr <- Call.ioarray u2
ldu2Ptr <- Call.cint ldu2
v1tPtr <- Call.ioarray v1t
ldv1tPtr <- Call.cint ldv1t
v2tPtr <- Call.ioarray v2t
ldv2tPtr <- Call.cint ldv2t
b11dPtr <- Call.array b11d
b11ePtr <- Call.array b11e
b12dPtr <- Call.array b12d
b12ePtr <- Call.array b12e
b21dPtr <- Call.array b21d
b21ePtr <- Call.array b21e
b22dPtr <- Call.array b22d
b22ePtr <- Call.array b22e
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
infoPtr <- Call.alloca
liftIO $ Lapack.bbcsd jobu1Ptr jobu2Ptr jobv1tPtr jobv2tPtr transPtr mPtr pPtr qPtr thetaPtr phiPtr u1Ptr ldu1Ptr u2Ptr ldu2Ptr v1tPtr ldv1tPtr v2tPtr ldv2tPtr b11dPtr b11ePtr b12dPtr b12ePtr b21dPtr b21ePtr b22dPtr b22ePtr rworkPtr lrworkPtr infoPtr
liftIO $ pure (,,,,,,,,)
<*> pure b11d
<*> pure b11e
<*> pure b12d
<*> pure b12e
<*> pure b21d
<*> pure b21e
<*> pure b22d
<*> pure b22e
<*> fmap fromIntegral (peek infoPtr)
bdsqr ::
Char ->
Int ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
bdsqr uplo nru d e vt u c = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
(vtDim0,vtDim1) <- Call.sizes2 <$> getBounds vt
(uDim0,uDim1) <- Call.sizes2 <$> getBounds u
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let n = dDim0
let ncvt = vtDim0
let ldvt = vtDim1
let ldu = uDim1
let ncc = cDim0
let ldc = cDim1
Call.assert "bdsqr: n-1 == eDim0" (n1 == eDim0)
Call.assert "bdsqr: n == uDim0" (n == uDim0)
rwork <- Call.newArray1 (4*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
ncvtPtr <- Call.cint ncvt
nruPtr <- Call.cint nru
nccPtr <- Call.cint ncc
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
vtPtr <- Call.ioarray vt
ldvtPtr <- Call.cint ldvt
uPtr <- Call.ioarray u
lduPtr <- Call.cint ldu
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.bdsqr uploPtr nPtr ncvtPtr nruPtr nccPtr dPtr ePtr vtPtr ldvtPtr uPtr lduPtr cPtr ldcPtr rworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
gbbrd ::
Char ->
Int ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int)
gbbrd vect m kl ku ab ldq ldpt c = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let n = abDim0
let ldab = abDim1
let ncc = cDim0
let ldc = cDim1
d <- Call.newArray1 (minimum[m,n])
e <- Call.newArray1 (minimum[m,n]1)
q <- Call.newArray2 m ldq
pt <- Call.newArray2 n ldpt
work <- Call.newArray1 (maximum[m,n])
rwork <- Call.newArray1 (maximum[m,n])
evalContT $ do
vectPtr <- Call.char vect
mPtr <- Call.cint m
nPtr <- Call.cint n
nccPtr <- Call.cint ncc
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
dPtr <- Call.array d
ePtr <- Call.array e
qPtr <- Call.array q
ldqPtr <- Call.cint ldq
ptPtr <- Call.array pt
ldptPtr <- Call.cint ldpt
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gbbrd vectPtr mPtr nPtr nccPtr klPtr kuPtr abPtr ldabPtr dPtr ePtr qPtr ldqPtr ptPtr ldptPtr cPtr ldcPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure d
<*> pure e
<*> pure q
<*> pure pt
<*> fmap fromIntegral (peek infoPtr)
gbcon ::
Char ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
Float ->
IO (Float, Int)
gbcon norm kl ku ab ipiv anorm = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = abDim0
let ldab = abDim1
Call.assert "gbcon: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
normPtr <- Call.char norm
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
ipivPtr <- Call.array ipiv
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gbcon normPtr nPtr klPtr kuPtr abPtr ldabPtr ipivPtr anormPtr rcondPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
gbequ ::
Int ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Float, Float, Float, Int)
gbequ m kl ku ab = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
r <- Call.newArray1 m
c <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
rPtr <- Call.array r
cPtr <- Call.array c
rowcndPtr <- Call.alloca
colcndPtr <- Call.alloca
amaxPtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.gbequ mPtr nPtr klPtr kuPtr abPtr ldabPtr rPtr cPtr rowcndPtr colcndPtr amaxPtr infoPtr
liftIO $ pure (,,,,,)
<*> pure r
<*> pure c
<*> peek rowcndPtr
<*> peek colcndPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
gbequb ::
Int ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Float, Float, Float, Int)
gbequb m kl ku ab = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
r <- Call.newArray1 m
c <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
rPtr <- Call.array r
cPtr <- Call.array c
rowcndPtr <- Call.alloca
colcndPtr <- Call.alloca
amaxPtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.gbequb mPtr nPtr klPtr kuPtr abPtr ldabPtr rPtr cPtr rowcndPtr colcndPtr amaxPtr infoPtr
liftIO $ pure (,,,,,)
<*> pure r
<*> pure c
<*> peek rowcndPtr
<*> peek colcndPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
gbrfs ::
Char ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
gbrfs trans kl ku ab afb ipiv b x = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let (afbDim0,afbDim1) = Call.sizes2 $ bounds afb
let ipivDim0 = Call.sizes1 $ bounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = abDim0
let ldab = abDim1
let ldafb = afbDim1
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "gbrfs: n == afbDim0" (n == afbDim0)
Call.assert "gbrfs: n == ipivDim0" (n == ipivDim0)
Call.assert "gbrfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
transPtr <- Call.char trans
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
nrhsPtr <- Call.cint nrhs
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
afbPtr <- Call.array afb
ldafbPtr <- Call.cint ldafb
ipivPtr <- Call.array ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gbrfs transPtr nPtr klPtr kuPtr nrhsPtr abPtr ldabPtr afbPtr ldafbPtr ipivPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
gbsv ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
gbsv kl ku ab b = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = abDim0
let ldab = abDim1
let nrhs = bDim0
let ldb = bDim1
ipiv <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
nrhsPtr <- Call.cint nrhs
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.gbsv nPtr klPtr kuPtr nrhsPtr abPtr ldabPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
gbsvx ::
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
Char ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Char, CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
gbsvx fact trans kl ku ab afb ipiv equed r c b ldx = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(afbDim0,afbDim1) <- Call.sizes2 <$> getBounds afb
ipivDim0 <- Call.sizes1 <$> getBounds ipiv
rDim0 <- Call.sizes1 <$> getBounds r
cDim0 <- Call.sizes1 <$> getBounds c
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = abDim0
let ldab = abDim1
let ldafb = afbDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "gbsvx: n == afbDim0" (n == afbDim0)
Call.assert "gbsvx: n == ipivDim0" (n == ipivDim0)
Call.assert "gbsvx: n == rDim0" (n == rDim0)
Call.assert "gbsvx: n == cDim0" (n == cDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
transPtr <- Call.char trans
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
nrhsPtr <- Call.cint nrhs
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
afbPtr <- Call.ioarray afb
ldafbPtr <- Call.cint ldafb
ipivPtr <- Call.ioarray ipiv
equedPtr <- Call.char equed
rPtr <- Call.ioarray r
cPtr <- Call.ioarray c
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gbsvx factPtr transPtr nPtr klPtr kuPtr nrhsPtr abPtr ldabPtr afbPtr ldafbPtr ipivPtr equedPtr rPtr cPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> fmap castCCharToChar (peek equedPtr)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
gbtf2 ::
Int ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
gbtf2 m kl ku ab = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
ipiv <- Call.newArray1 (minimum[m,n])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.gbtf2 mPtr nPtr klPtr kuPtr abPtr ldabPtr ipivPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
gbtrf ::
Int ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
gbtrf m kl ku ab = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
ipiv <- Call.newArray1 (minimum[m,n])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.gbtrf mPtr nPtr klPtr kuPtr abPtr ldabPtr ipivPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
gbtrs ::
Char ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
gbtrs trans kl ku ab ipiv b = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = abDim0
let ldab = abDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "gbtrs: n == ipivDim0" (n == ipivDim0)
evalContT $ do
transPtr <- Call.char trans
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
nrhsPtr <- Call.cint nrhs
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.gbtrs transPtr nPtr klPtr kuPtr nrhsPtr abPtr ldabPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
gebak ::
Char ->
Char ->
Int ->
Int ->
CArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
gebak job side ilo ihi scale v = do
let scaleDim0 = Call.sizes1 $ bounds scale
(vDim0,vDim1) <- Call.sizes2 <$> getBounds v
let n = scaleDim0
let m = vDim0
let ldv = vDim1
evalContT $ do
jobPtr <- Call.char job
sidePtr <- Call.char side
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
scalePtr <- Call.array scale
mPtr <- Call.cint m
vPtr <- Call.ioarray v
ldvPtr <- Call.cint ldv
infoPtr <- Call.alloca
liftIO $ Lapack.gebak jobPtr sidePtr nPtr iloPtr ihiPtr scalePtr mPtr vPtr ldvPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
gebal ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int, Int, CArray Int Float, Int)
gebal job a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
scale <- Call.newArray1 n
evalContT $ do
jobPtr <- Call.char job
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
iloPtr <- Call.alloca
ihiPtr <- Call.alloca
scalePtr <- Call.array scale
infoPtr <- Call.alloca
liftIO $ Lapack.gebal jobPtr nPtr aPtr ldaPtr iloPtr ihiPtr scalePtr infoPtr
liftIO $ pure (,,,)
<*> fmap fromIntegral (peek iloPtr)
<*> fmap fromIntegral (peek ihiPtr)
<*> pure scale
<*> fmap fromIntegral (peek infoPtr)
gebd2 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, CArray Int (Complex Float), CArray Int (Complex Float), Int)
gebd2 m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
d <- Call.newArray1 (minimum[m,n])
e <- Call.newArray1 (minimum[m,n]1)
tauq <- Call.newArray1 (minimum[m,n])
taup <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[m,n])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
dPtr <- Call.array d
ePtr <- Call.array e
tauqPtr <- Call.array tauq
taupPtr <- Call.array taup
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.gebd2 mPtr nPtr aPtr ldaPtr dPtr ePtr tauqPtr taupPtr workPtr infoPtr
liftIO $ pure (,,,,)
<*> pure d
<*> pure e
<*> pure tauq
<*> pure taup
<*> fmap fromIntegral (peek infoPtr)
gebrd ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, CArray Int Float, CArray Int (Complex Float), CArray Int (Complex Float), Int)
gebrd m a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
d <- Call.newArray1 (minimum[m,n])
e <- Call.newArray1 (minimum[m,n]1)
tauq <- Call.newArray1 (minimum[m,n])
taup <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
dPtr <- Call.array d
ePtr <- Call.array e
tauqPtr <- Call.array tauq
taupPtr <- Call.array taup
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.gebrd mPtr nPtr aPtr ldaPtr dPtr ePtr tauqPtr taupPtr workPtr lworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure d
<*> pure e
<*> pure tauq
<*> pure taup
<*> fmap fromIntegral (peek infoPtr)
gecon ::
Char ->
CArray (Int,Int) (Complex Float) ->
Float ->
IO (Float, Int)
gecon norm a anorm = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 (2*n)
evalContT $ do
normPtr <- Call.char norm
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gecon normPtr nPtr aPtr ldaPtr anormPtr rcondPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
geequ ::
Int ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Float, Float, Float, Int)
geequ m a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
r <- Call.newArray1 m
c <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
rPtr <- Call.array r
cPtr <- Call.array c
rowcndPtr <- Call.alloca
colcndPtr <- Call.alloca
amaxPtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.geequ mPtr nPtr aPtr ldaPtr rPtr cPtr rowcndPtr colcndPtr amaxPtr infoPtr
liftIO $ pure (,,,,,)
<*> pure r
<*> pure c
<*> peek rowcndPtr
<*> peek colcndPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
geequb ::
Int ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Float, Float, Float, Int)
geequb m a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
r <- Call.newArray1 m
c <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
rPtr <- Call.array r
cPtr <- Call.array c
rowcndPtr <- Call.alloca
colcndPtr <- Call.alloca
amaxPtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.geequb mPtr nPtr aPtr ldaPtr rPtr cPtr rowcndPtr colcndPtr amaxPtr infoPtr
liftIO $ pure (,,,,,)
<*> pure r
<*> pure c
<*> peek rowcndPtr
<*> peek colcndPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
gees ::
Char ->
Char ->
FunPtr (Ptr (Complex Float) -> IO Bool) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (Int, CArray Int (Complex Float), CArray (Int,Int) (Complex Float), Int)
gees jobvs sort select a ldvs lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
w <- Call.newArray1 n
vs <- Call.newArray2 n ldvs
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 n
bwork <- Call.newArray1 n
evalContT $ do
jobvsPtr <- Call.char jobvs
sortPtr <- Call.char sort
selectPtr <- pure select
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
sdimPtr <- Call.alloca
wPtr <- Call.array w
vsPtr <- Call.array vs
ldvsPtr <- Call.cint ldvs
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
bworkPtr <- Call.array bwork
infoPtr <- Call.alloca
liftIO $ Lapack.gees jobvsPtr sortPtr selectPtr nPtr aPtr ldaPtr sdimPtr wPtr vsPtr ldvsPtr workPtr lworkPtr rworkPtr bworkPtr infoPtr
liftIO $ pure (,,,)
<*> fmap fromIntegral (peek sdimPtr)
<*> pure w
<*> pure vs
<*> fmap fromIntegral (peek infoPtr)
geesx ::
Char ->
Char ->
FunPtr (Ptr (Complex Float) -> IO Bool) ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (Int, CArray Int (Complex Float), CArray (Int,Int) (Complex Float), Float, Float, Int)
geesx jobvs sort select sense a ldvs lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
w <- Call.newArray1 n
vs <- Call.newArray2 n ldvs
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 n
bwork <- Call.newArray1 n
evalContT $ do
jobvsPtr <- Call.char jobvs
sortPtr <- Call.char sort
selectPtr <- pure select
sensePtr <- Call.char sense
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
sdimPtr <- Call.alloca
wPtr <- Call.array w
vsPtr <- Call.array vs
ldvsPtr <- Call.cint ldvs
rcondePtr <- Call.alloca
rcondvPtr <- Call.alloca
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
bworkPtr <- Call.array bwork
infoPtr <- Call.alloca
liftIO $ Lapack.geesx jobvsPtr sortPtr selectPtr sensePtr nPtr aPtr ldaPtr sdimPtr wPtr vsPtr ldvsPtr rcondePtr rcondvPtr workPtr lworkPtr rworkPtr bworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> fmap fromIntegral (peek sdimPtr)
<*> pure w
<*> pure vs
<*> peek rcondePtr
<*> peek rcondvPtr
<*> fmap fromIntegral (peek infoPtr)
geev ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
IO (CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int)
geev jobvl jobvr a ldvl ldvr lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
w <- Call.newArray1 n
vl <- Call.newArray2 n ldvl
vr <- Call.newArray2 n ldvr
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (2*n)
evalContT $ do
jobvlPtr <- Call.char jobvl
jobvrPtr <- Call.char jobvr
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
wPtr <- Call.array w
vlPtr <- Call.array vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.array vr
ldvrPtr <- Call.cint ldvr
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.geev jobvlPtr jobvrPtr nPtr aPtr ldaPtr wPtr vlPtr ldvlPtr vrPtr ldvrPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,,,)
<*> pure w
<*> pure vl
<*> pure vr
<*> fmap fromIntegral (peek infoPtr)
geevx ::
Char ->
Char ->
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
IO (CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int, Int, CArray Int Float, Float, CArray Int Float, CArray Int Float, Int)
geevx balanc jobvl jobvr sense a ldvl ldvr lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
w <- Call.newArray1 n
vl <- Call.newArray2 n ldvl
vr <- Call.newArray2 n ldvr
scale <- Call.newArray1 n
rconde <- Call.newArray1 n
rcondv <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (2*n)
evalContT $ do
balancPtr <- Call.char balanc
jobvlPtr <- Call.char jobvl
jobvrPtr <- Call.char jobvr
sensePtr <- Call.char sense
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
wPtr <- Call.array w
vlPtr <- Call.array vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.array vr
ldvrPtr <- Call.cint ldvr
iloPtr <- Call.alloca
ihiPtr <- Call.alloca
scalePtr <- Call.array scale
abnrmPtr <- Call.alloca
rcondePtr <- Call.array rconde
rcondvPtr <- Call.array rcondv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.geevx balancPtr jobvlPtr jobvrPtr sensePtr nPtr aPtr ldaPtr wPtr vlPtr ldvlPtr vrPtr ldvrPtr iloPtr ihiPtr scalePtr abnrmPtr rcondePtr rcondvPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,,,,,,,,,)
<*> pure w
<*> pure vl
<*> pure vr
<*> fmap fromIntegral (peek iloPtr)
<*> fmap fromIntegral (peek ihiPtr)
<*> pure scale
<*> peek abnrmPtr
<*> pure rconde
<*> pure rcondv
<*> fmap fromIntegral (peek infoPtr)
gehd2 ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
gehd2 ilo ihi a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (n1)
work <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.gehd2 nPtr iloPtr ihiPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
gehrd ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
gehrd ilo ihi a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (n1)
work <- Call.newArray1 lwork
evalContT $ do
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.gehrd nPtr iloPtr ihiPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
gelq2 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
gelq2 m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 m
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.gelq2 mPtr nPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
gelqf ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
gelqf m a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.gelqf mPtr nPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
gels ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
gels trans m a b lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.gels transPtr mPtr nPtr nrhsPtr aPtr ldaPtr bPtr ldbPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
gelsd ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Int ->
Int ->
Int ->
IO (CArray Int Float, Int, Int)
gelsd m a b rcond lwork lrwork liwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
s <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,lrwork])
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
sPtr <- Call.array s
rcondPtr <- Call.float rcond
rankPtr <- Call.alloca
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.gelsd mPtr nPtr nrhsPtr aPtr ldaPtr bPtr ldbPtr sPtr rcondPtr rankPtr workPtr lworkPtr rworkPtr iworkPtr infoPtr
liftIO $ pure (,,)
<*> pure s
<*> fmap fromIntegral (peek rankPtr)
<*> fmap fromIntegral (peek infoPtr)
gelss ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Int ->
IO (CArray Int Float, Int, Int)
gelss m a b rcond lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
s <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (5*minimum[m,n])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
sPtr <- Call.array s
rcondPtr <- Call.float rcond
rankPtr <- Call.alloca
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gelss mPtr nPtr nrhsPtr aPtr ldaPtr bPtr ldbPtr sPtr rcondPtr rankPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure s
<*> fmap fromIntegral (peek rankPtr)
<*> fmap fromIntegral (peek infoPtr)
gelsy ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
Float ->
Int ->
IO (Int, Int)
gelsy m a b jpvt rcond lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
jpvtDim0 <- Call.sizes1 <$> getBounds jpvt
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "gelsy: n == jpvtDim0" (n == jpvtDim0)
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (2*n)
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
jpvtPtr <- Call.ioarray jpvt
rcondPtr <- Call.float rcond
rankPtr <- Call.alloca
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gelsy mPtr nPtr nrhsPtr aPtr ldaPtr bPtr ldbPtr jpvtPtr rcondPtr rankPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> fmap fromIntegral (peek rankPtr)
<*> fmap fromIntegral (peek infoPtr)
geql2 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
geql2 m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.geql2 mPtr nPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
geqlf ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
geqlf m a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.geqlf mPtr nPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
geqp3 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
Int ->
IO (CArray Int (Complex Float), Int)
geqp3 m a jpvt lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
jpvtDim0 <- Call.sizes1 <$> getBounds jpvt
let n = aDim0
let lda = aDim1
Call.assert "geqp3: n == jpvtDim0" (n == jpvtDim0)
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (2*n)
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
jpvtPtr <- Call.ioarray jpvt
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.geqp3 mPtr nPtr aPtr ldaPtr jpvtPtr tauPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
geqr2 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
geqr2 m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.geqr2 mPtr nPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
geqr2p ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
geqr2p m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.geqr2p mPtr nPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
geqrf ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
geqrf m a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.geqrf mPtr nPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
geqrfp ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
geqrfp m a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.geqrfp mPtr nPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
gerfs ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
gerfs trans a af ipiv b x = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (afDim0,afDim1) = Call.sizes2 $ bounds af
let ipivDim0 = Call.sizes1 $ bounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = aDim0
let lda = aDim1
let ldaf = afDim1
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "gerfs: n == afDim0" (n == afDim0)
Call.assert "gerfs: n == ipivDim0" (n == ipivDim0)
Call.assert "gerfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
transPtr <- Call.char trans
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
afPtr <- Call.array af
ldafPtr <- Call.cint ldaf
ipivPtr <- Call.array ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gerfs transPtr nPtr nrhsPtr aPtr ldaPtr afPtr ldafPtr ipivPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
gerq2 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
gerq2 m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 m
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.gerq2 mPtr nPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
gerqf ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
gerqf m a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.gerqf mPtr nPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
gesc2 ::
CArray (Int,Int) (Complex Float) ->
IOCArray Int (Complex Float) ->
CArray Int CInt ->
CArray Int CInt ->
IO (Float)
gesc2 a rhs ipiv jpiv = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
rhsDim0 <- Call.sizes1 <$> getBounds rhs
let ipivDim0 = Call.sizes1 $ bounds ipiv
let jpivDim0 = Call.sizes1 $ bounds jpiv
let n = aDim0
let lda = aDim1
let _rhsSize = rhsDim0
Call.assert "gesc2: n == ipivDim0" (n == ipivDim0)
Call.assert "gesc2: n == jpivDim0" (n == jpivDim0)
evalContT $ do
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
rhsPtr <- Call.ioarray rhs
ipivPtr <- Call.array ipiv
jpivPtr <- Call.array jpiv
scalePtr <- Call.alloca
liftIO $ Lapack.gesc2 nPtr aPtr ldaPtr rhsPtr ipivPtr jpivPtr scalePtr
liftIO $ peek scalePtr
gesdd ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int)
gesdd jobz m a ucol ldu ldvt lwork lrwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
s <- Call.newArray1 (minimum[m,n])
u <- Call.newArray2 ucol ldu
vt <- Call.newArray2 n ldvt
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,lrwork])
iwork <- Call.newArray1 (8*minimum[m,n])
evalContT $ do
jobzPtr <- Call.char jobz
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
sPtr <- Call.array s
uPtr <- Call.array u
lduPtr <- Call.cint ldu
vtPtr <- Call.array vt
ldvtPtr <- Call.cint ldvt
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.gesdd jobzPtr mPtr nPtr aPtr ldaPtr sPtr uPtr lduPtr vtPtr ldvtPtr workPtr lworkPtr rworkPtr iworkPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> pure u
<*> pure vt
<*> fmap fromIntegral (peek infoPtr)
gesv ::
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
gesv a b = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
ipiv <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.gesv nPtr nrhsPtr aPtr ldaPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
gesvd ::
Char ->
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int)
gesvd jobu jobvt m a ucol ldu ldvt lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
s <- Call.newArray1 (minimum[m,n])
u <- Call.newArray2 ucol ldu
vt <- Call.newArray2 n ldvt
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (5*minimum[m,n])
evalContT $ do
jobuPtr <- Call.char jobu
jobvtPtr <- Call.char jobvt
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
sPtr <- Call.array s
uPtr <- Call.array u
lduPtr <- Call.cint ldu
vtPtr <- Call.array vt
ldvtPtr <- Call.cint ldvt
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gesvd jobuPtr jobvtPtr mPtr nPtr aPtr ldaPtr sPtr uPtr lduPtr vtPtr ldvtPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> pure u
<*> pure vt
<*> fmap fromIntegral (peek infoPtr)
gesvx ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
Char ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Char, CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
gesvx fact trans a af ipiv equed r c b ldx = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(afDim0,afDim1) <- Call.sizes2 <$> getBounds af
ipivDim0 <- Call.sizes1 <$> getBounds ipiv
rDim0 <- Call.sizes1 <$> getBounds r
cDim0 <- Call.sizes1 <$> getBounds c
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldaf = afDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "gesvx: n == afDim0" (n == afDim0)
Call.assert "gesvx: n == ipivDim0" (n == ipivDim0)
Call.assert "gesvx: n == rDim0" (n == rDim0)
Call.assert "gesvx: n == cDim0" (n == cDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 (2*n)
evalContT $ do
factPtr <- Call.char fact
transPtr <- Call.char trans
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
afPtr <- Call.ioarray af
ldafPtr <- Call.cint ldaf
ipivPtr <- Call.ioarray ipiv
equedPtr <- Call.char equed
rPtr <- Call.ioarray r
cPtr <- Call.ioarray c
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gesvx factPtr transPtr nPtr nrhsPtr aPtr ldaPtr afPtr ldafPtr ipivPtr equedPtr rPtr cPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> fmap castCCharToChar (peek equedPtr)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
getc2 ::
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, CArray Int CInt, Int)
getc2 a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 n
jpiv <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
jpivPtr <- Call.array jpiv
infoPtr <- Call.alloca
liftIO $ Lapack.getc2 nPtr aPtr ldaPtr ipivPtr jpivPtr infoPtr
liftIO $ pure (,,)
<*> pure ipiv
<*> pure jpiv
<*> fmap fromIntegral (peek infoPtr)
getf2 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
getf2 m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 (minimum[m,n])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.getf2 mPtr nPtr aPtr ldaPtr ipivPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
getrf ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
getrf m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 (minimum[m,n])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.getrf mPtr nPtr aPtr ldaPtr ipivPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
getri ::
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
Int ->
IO (Int)
getri a ipiv lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "getri: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.getri nPtr aPtr ldaPtr ipivPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
getrs ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
getrs trans a ipiv b = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "getrs: n == ipivDim0" (n == ipivDim0)
evalContT $ do
transPtr <- Call.char trans
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.getrs transPtr nPtr nrhsPtr aPtr ldaPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ggbak ::
Char ->
Char ->
Int ->
Int ->
CArray Int Float ->
CArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
ggbak job side ilo ihi lscale rscale v = do
let lscaleDim0 = Call.sizes1 $ bounds lscale
let rscaleDim0 = Call.sizes1 $ bounds rscale
(vDim0,vDim1) <- Call.sizes2 <$> getBounds v
let n = lscaleDim0
let m = vDim0
let ldv = vDim1
Call.assert "ggbak: n == rscaleDim0" (n == rscaleDim0)
evalContT $ do
jobPtr <- Call.char job
sidePtr <- Call.char side
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
lscalePtr <- Call.array lscale
rscalePtr <- Call.array rscale
mPtr <- Call.cint m
vPtr <- Call.ioarray v
ldvPtr <- Call.cint ldv
infoPtr <- Call.alloca
liftIO $ Lapack.ggbak jobPtr sidePtr nPtr iloPtr ihiPtr lscalePtr rscalePtr mPtr vPtr ldvPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ggbal ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int, Int, CArray Int Float, CArray Int Float, Int)
ggbal job a b lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "ggbal: n == bDim0" (n == bDim0)
lscale <- Call.newArray1 n
rscale <- Call.newArray1 n
work <- Call.newArray1 lwork
evalContT $ do
jobPtr <- Call.char job
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
iloPtr <- Call.alloca
ihiPtr <- Call.alloca
lscalePtr <- Call.array lscale
rscalePtr <- Call.array rscale
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.ggbal jobPtr nPtr aPtr ldaPtr bPtr ldbPtr iloPtr ihiPtr lscalePtr rscalePtr workPtr infoPtr
liftIO $ pure (,,,,)
<*> fmap fromIntegral (peek iloPtr)
<*> fmap fromIntegral (peek ihiPtr)
<*> pure lscale
<*> pure rscale
<*> fmap fromIntegral (peek infoPtr)
gges ::
Char ->
Char ->
Char ->
FunPtr (Ptr (Complex Float) -> Ptr (Complex Float) -> IO Bool) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
IO (Int, CArray Int (Complex Float), CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int)
gges jobvsl jobvsr sort selctg a b ldvsl ldvsr lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "gges: n == bDim0" (n == bDim0)
alpha <- Call.newArray1 n
beta <- Call.newArray1 n
vsl <- Call.newArray2 n ldvsl
vsr <- Call.newArray2 n ldvsr
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (8*n)
bwork <- Call.newArray1 n
evalContT $ do
jobvslPtr <- Call.char jobvsl
jobvsrPtr <- Call.char jobvsr
sortPtr <- Call.char sort
selctgPtr <- pure selctg
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
sdimPtr <- Call.alloca
alphaPtr <- Call.array alpha
betaPtr <- Call.array beta
vslPtr <- Call.array vsl
ldvslPtr <- Call.cint ldvsl
vsrPtr <- Call.array vsr
ldvsrPtr <- Call.cint ldvsr
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
bworkPtr <- Call.array bwork
infoPtr <- Call.alloca
liftIO $ Lapack.gges jobvslPtr jobvsrPtr sortPtr selctgPtr nPtr aPtr ldaPtr bPtr ldbPtr sdimPtr alphaPtr betaPtr vslPtr ldvslPtr vsrPtr ldvsrPtr workPtr lworkPtr rworkPtr bworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> fmap fromIntegral (peek sdimPtr)
<*> pure alpha
<*> pure beta
<*> pure vsl
<*> pure vsr
<*> fmap fromIntegral (peek infoPtr)
ggesx ::
Char ->
Char ->
Char ->
FunPtr (Ptr (Complex Float) -> Ptr (Complex Float) -> IO Bool) ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
IO (Int, CArray Int (Complex Float), CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), CArray Int Float, CArray Int Float, Int)
ggesx jobvsl jobvsr sort selctg sense a b ldvsl ldvsr lwork liwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "ggesx: n == bDim0" (n == bDim0)
alpha <- Call.newArray1 n
beta <- Call.newArray1 n
vsl <- Call.newArray2 n ldvsl
vsr <- Call.newArray2 n ldvsr
rconde <- Call.newArray1 2
rcondv <- Call.newArray1 2
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (8*n)
iwork <- Call.newArray1 (maximum[1,liwork])
bwork <- Call.newArray1 n
evalContT $ do
jobvslPtr <- Call.char jobvsl
jobvsrPtr <- Call.char jobvsr
sortPtr <- Call.char sort
selctgPtr <- pure selctg
sensePtr <- Call.char sense
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
sdimPtr <- Call.alloca
alphaPtr <- Call.array alpha
betaPtr <- Call.array beta
vslPtr <- Call.array vsl
ldvslPtr <- Call.cint ldvsl
vsrPtr <- Call.array vsr
ldvsrPtr <- Call.cint ldvsr
rcondePtr <- Call.array rconde
rcondvPtr <- Call.array rcondv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
bworkPtr <- Call.array bwork
infoPtr <- Call.alloca
liftIO $ Lapack.ggesx jobvslPtr jobvsrPtr sortPtr selctgPtr sensePtr nPtr aPtr ldaPtr bPtr ldbPtr sdimPtr alphaPtr betaPtr vslPtr ldvslPtr vsrPtr ldvsrPtr rcondePtr rcondvPtr workPtr lworkPtr rworkPtr iworkPtr liworkPtr bworkPtr infoPtr
liftIO $ pure (,,,,,,,)
<*> fmap fromIntegral (peek sdimPtr)
<*> pure alpha
<*> pure beta
<*> pure vsl
<*> pure vsr
<*> pure rconde
<*> pure rcondv
<*> fmap fromIntegral (peek infoPtr)
ggev ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
IO (CArray Int (Complex Float), CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int)
ggev jobvl jobvr a b ldvl ldvr lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "ggev: n == bDim0" (n == bDim0)
alpha <- Call.newArray1 n
beta <- Call.newArray1 n
vl <- Call.newArray2 n ldvl
vr <- Call.newArray2 n ldvr
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (8*n)
evalContT $ do
jobvlPtr <- Call.char jobvl
jobvrPtr <- Call.char jobvr
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
alphaPtr <- Call.array alpha
betaPtr <- Call.array beta
vlPtr <- Call.array vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.array vr
ldvrPtr <- Call.cint ldvr
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.ggev jobvlPtr jobvrPtr nPtr aPtr ldaPtr bPtr ldbPtr alphaPtr betaPtr vlPtr ldvlPtr vrPtr ldvrPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure alpha
<*> pure beta
<*> pure vl
<*> pure vr
<*> fmap fromIntegral (peek infoPtr)
ggevx ::
Char ->
Char ->
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int (Complex Float), CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int, Int, CArray Int Float, CArray Int Float, Float, Float, CArray Int Float, CArray Int Float, Int)
ggevx balanc jobvl jobvr sense a b ldvl ldvr lwork lrwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "ggevx: n == bDim0" (n == bDim0)
alpha <- Call.newArray1 n
beta <- Call.newArray1 n
vl <- Call.newArray2 n ldvl
vr <- Call.newArray2 n ldvr
lscale <- Call.newArray1 n
rscale <- Call.newArray1 n
rconde <- Call.newArray1 n
rcondv <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 lrwork
iwork <- Call.newArray1 (n+2)
bwork <- Call.newArray1 n
evalContT $ do
balancPtr <- Call.char balanc
jobvlPtr <- Call.char jobvl
jobvrPtr <- Call.char jobvr
sensePtr <- Call.char sense
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
alphaPtr <- Call.array alpha
betaPtr <- Call.array beta
vlPtr <- Call.array vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.array vr
ldvrPtr <- Call.cint ldvr
iloPtr <- Call.alloca
ihiPtr <- Call.alloca
lscalePtr <- Call.array lscale
rscalePtr <- Call.array rscale
abnrmPtr <- Call.alloca
bbnrmPtr <- Call.alloca
rcondePtr <- Call.array rconde
rcondvPtr <- Call.array rcondv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
bworkPtr <- Call.array bwork
infoPtr <- Call.alloca
liftIO $ Lapack.ggevx balancPtr jobvlPtr jobvrPtr sensePtr nPtr aPtr ldaPtr bPtr ldbPtr alphaPtr betaPtr vlPtr ldvlPtr vrPtr ldvrPtr iloPtr ihiPtr lscalePtr rscalePtr abnrmPtr bbnrmPtr rcondePtr rcondvPtr workPtr lworkPtr rworkPtr iworkPtr bworkPtr infoPtr
liftIO $ pure (,,,,,,,,,,,,)
<*> pure alpha
<*> pure beta
<*> pure vl
<*> pure vr
<*> fmap fromIntegral (peek iloPtr)
<*> fmap fromIntegral (peek ihiPtr)
<*> pure lscale
<*> pure rscale
<*> peek abnrmPtr
<*> peek bbnrmPtr
<*> pure rconde
<*> pure rcondv
<*> fmap fromIntegral (peek infoPtr)
ggglm ::
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), CArray Int (Complex Float), Int)
ggglm a b d lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
dDim0 <- Call.sizes1 <$> getBounds d
let m = aDim0
let lda = aDim1
let p = bDim0
let ldb = bDim1
let n = dDim0
x <- Call.newArray1 m
y <- Call.newArray1 p
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
nPtr <- Call.cint n
mPtr <- Call.cint m
pPtr <- Call.cint p
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
dPtr <- Call.ioarray d
xPtr <- Call.array x
yPtr <- Call.array y
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.ggglm nPtr mPtr pPtr aPtr ldaPtr bPtr ldbPtr dPtr xPtr yPtr workPtr lworkPtr infoPtr
liftIO $ pure (,,)
<*> pure x
<*> pure y
<*> fmap fromIntegral (peek infoPtr)
gghrd ::
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
gghrd compq compz ilo ihi a b q z = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = aDim0
let lda = aDim1
let ldb = bDim1
let ldq = qDim1
let ldz = zDim1
Call.assert "gghrd: n == bDim0" (n == bDim0)
Call.assert "gghrd: n == qDim0" (n == qDim0)
Call.assert "gghrd: n == zDim0" (n == zDim0)
evalContT $ do
compqPtr <- Call.char compq
compzPtr <- Call.char compz
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
infoPtr <- Call.alloca
liftIO $ Lapack.gghrd compqPtr compzPtr nPtr iloPtr ihiPtr aPtr ldaPtr bPtr ldbPtr qPtr ldqPtr zPtr ldzPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
gglse ::
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
gglse a b c d lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
cDim0 <- Call.sizes1 <$> getBounds c
dDim0 <- Call.sizes1 <$> getBounds d
let n = aDim0
let lda = aDim1
let ldb = bDim1
let m = cDim0
let p = dDim0
Call.assert "gglse: n == bDim0" (n == bDim0)
x <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
pPtr <- Call.cint p
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
cPtr <- Call.ioarray c
dPtr <- Call.ioarray d
xPtr <- Call.array x
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.gglse mPtr nPtr pPtr aPtr ldaPtr bPtr ldbPtr cPtr dPtr xPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure x
<*> fmap fromIntegral (peek infoPtr)
ggqrf ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), CArray Int (Complex Float), Int)
ggqrf n a b lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let m = aDim0
let lda = aDim1
let p = bDim0
let ldb = bDim1
taua <- Call.newArray1 (minimum[n,m])
taub <- Call.newArray1 (minimum[n,p])
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
nPtr <- Call.cint n
mPtr <- Call.cint m
pPtr <- Call.cint p
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauaPtr <- Call.array taua
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
taubPtr <- Call.array taub
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.ggqrf nPtr mPtr pPtr aPtr ldaPtr tauaPtr bPtr ldbPtr taubPtr workPtr lworkPtr infoPtr
liftIO $ pure (,,)
<*> pure taua
<*> pure taub
<*> fmap fromIntegral (peek infoPtr)
ggrqf ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), CArray Int (Complex Float), Int)
ggrqf m p a b lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "ggrqf: n == bDim0" (n == bDim0)
taua <- Call.newArray1 (minimum[m,n])
taub <- Call.newArray1 (minimum[p,n])
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
pPtr <- Call.cint p
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauaPtr <- Call.array taua
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
taubPtr <- Call.array taub
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.ggrqf mPtr pPtr nPtr aPtr ldaPtr tauaPtr bPtr ldbPtr taubPtr workPtr lworkPtr infoPtr
liftIO $ pure (,,)
<*> pure taua
<*> pure taub
<*> fmap fromIntegral (peek infoPtr)
gtcon ::
Char ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int CInt ->
Float ->
IO (Float, Int)
gtcon norm dl d du du2 ipiv anorm = do
let dlDim0 = Call.sizes1 $ bounds dl
let dDim0 = Call.sizes1 $ bounds d
let duDim0 = Call.sizes1 $ bounds du
let du2Dim0 = Call.sizes1 $ bounds du2
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = dDim0
Call.assert "gtcon: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "gtcon: n-1 == duDim0" (n1 == duDim0)
Call.assert "gtcon: n-2 == du2Dim0" (n2 == du2Dim0)
Call.assert "gtcon: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 (2*n)
evalContT $ do
normPtr <- Call.char norm
nPtr <- Call.cint n
dlPtr <- Call.array dl
dPtr <- Call.array d
duPtr <- Call.array du
du2Ptr <- Call.array du2
ipivPtr <- Call.array ipiv
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.gtcon normPtr nPtr dlPtr dPtr duPtr du2Ptr ipivPtr anormPtr rcondPtr workPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
gtrfs ::
Char ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
gtrfs trans dl d du dlf df duf du2 ipiv b x = do
let dlDim0 = Call.sizes1 $ bounds dl
let dDim0 = Call.sizes1 $ bounds d
let duDim0 = Call.sizes1 $ bounds du
let dlfDim0 = Call.sizes1 $ bounds dlf
let dfDim0 = Call.sizes1 $ bounds df
let dufDim0 = Call.sizes1 $ bounds duf
let du2Dim0 = Call.sizes1 $ bounds du2
let ipivDim0 = Call.sizes1 $ bounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "gtrfs: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "gtrfs: n-1 == duDim0" (n1 == duDim0)
Call.assert "gtrfs: n-1 == dlfDim0" (n1 == dlfDim0)
Call.assert "gtrfs: n == dfDim0" (n == dfDim0)
Call.assert "gtrfs: n-1 == dufDim0" (n1 == dufDim0)
Call.assert "gtrfs: n-2 == du2Dim0" (n2 == du2Dim0)
Call.assert "gtrfs: n == ipivDim0" (n == ipivDim0)
Call.assert "gtrfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
transPtr <- Call.char trans
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dlPtr <- Call.array dl
dPtr <- Call.array d
duPtr <- Call.array du
dlfPtr <- Call.array dlf
dfPtr <- Call.array df
dufPtr <- Call.array duf
du2Ptr <- Call.array du2
ipivPtr <- Call.array ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gtrfs transPtr nPtr nrhsPtr dlPtr dPtr duPtr dlfPtr dfPtr dufPtr du2Ptr ipivPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
gtsv ::
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
gtsv dl d du b = do
dlDim0 <- Call.sizes1 <$> getBounds dl
dDim0 <- Call.sizes1 <$> getBounds d
duDim0 <- Call.sizes1 <$> getBounds du
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "gtsv: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "gtsv: n-1 == duDim0" (n1 == duDim0)
evalContT $ do
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dlPtr <- Call.ioarray dl
dPtr <- Call.ioarray d
duPtr <- Call.ioarray du
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.gtsv nPtr nrhsPtr dlPtr dPtr duPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
gtsvx ::
Char ->
Char ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
gtsvx fact trans dl d du dlf df duf du2 ipiv b ldx = do
let dlDim0 = Call.sizes1 $ bounds dl
let dDim0 = Call.sizes1 $ bounds d
let duDim0 = Call.sizes1 $ bounds du
dlfDim0 <- Call.sizes1 <$> getBounds dlf
dfDim0 <- Call.sizes1 <$> getBounds df
dufDim0 <- Call.sizes1 <$> getBounds duf
du2Dim0 <- Call.sizes1 <$> getBounds du2
ipivDim0 <- Call.sizes1 <$> getBounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "gtsvx: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "gtsvx: n-1 == duDim0" (n1 == duDim0)
Call.assert "gtsvx: n-1 == dlfDim0" (n1 == dlfDim0)
Call.assert "gtsvx: n == dfDim0" (n == dfDim0)
Call.assert "gtsvx: n-1 == dufDim0" (n1 == dufDim0)
Call.assert "gtsvx: n-2 == du2Dim0" (n2 == du2Dim0)
Call.assert "gtsvx: n == ipivDim0" (n == ipivDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
transPtr <- Call.char trans
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dlPtr <- Call.array dl
dPtr <- Call.array d
duPtr <- Call.array du
dlfPtr <- Call.ioarray dlf
dfPtr <- Call.ioarray df
dufPtr <- Call.ioarray duf
du2Ptr <- Call.ioarray du2
ipivPtr <- Call.ioarray ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.gtsvx factPtr transPtr nPtr nrhsPtr dlPtr dPtr duPtr dlfPtr dfPtr dufPtr du2Ptr ipivPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
gttrf ::
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IO (CArray Int (Complex Float), CArray Int CInt, Int)
gttrf dl d du = do
dlDim0 <- Call.sizes1 <$> getBounds dl
dDim0 <- Call.sizes1 <$> getBounds d
duDim0 <- Call.sizes1 <$> getBounds du
let n = dDim0
Call.assert "gttrf: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "gttrf: n-1 == duDim0" (n1 == duDim0)
du2 <- Call.newArray1 (n2)
ipiv <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
dlPtr <- Call.ioarray dl
dPtr <- Call.ioarray d
duPtr <- Call.ioarray du
du2Ptr <- Call.array du2
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.gttrf nPtr dlPtr dPtr duPtr du2Ptr ipivPtr infoPtr
liftIO $ pure (,,)
<*> pure du2
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
gttrs ::
Char ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
gttrs trans dl d du du2 ipiv b = do
let dlDim0 = Call.sizes1 $ bounds dl
let dDim0 = Call.sizes1 $ bounds d
let duDim0 = Call.sizes1 $ bounds du
let du2Dim0 = Call.sizes1 $ bounds du2
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "gttrs: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "gttrs: n-1 == duDim0" (n1 == duDim0)
Call.assert "gttrs: n-2 == du2Dim0" (n2 == du2Dim0)
Call.assert "gttrs: n == ipivDim0" (n == ipivDim0)
evalContT $ do
transPtr <- Call.char trans
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dlPtr <- Call.array dl
dPtr <- Call.array d
duPtr <- Call.array du
du2Ptr <- Call.array du2
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.gttrs transPtr nPtr nrhsPtr dlPtr dPtr duPtr du2Ptr ipivPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
gtts2 ::
Int ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO ()
gtts2 itrans dl d du du2 ipiv b = do
let dlDim0 = Call.sizes1 $ bounds dl
let dDim0 = Call.sizes1 $ bounds d
let duDim0 = Call.sizes1 $ bounds du
let du2Dim0 = Call.sizes1 $ bounds du2
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "gtts2: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "gtts2: n-1 == duDim0" (n1 == duDim0)
Call.assert "gtts2: n-2 == du2Dim0" (n2 == du2Dim0)
Call.assert "gtts2: n == ipivDim0" (n == ipivDim0)
evalContT $ do
itransPtr <- Call.cint itrans
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dlPtr <- Call.array dl
dPtr <- Call.array d
duPtr <- Call.array du
du2Ptr <- Call.array du2
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
liftIO $ Lapack.gtts2 itransPtr nPtr nrhsPtr dlPtr dPtr duPtr du2Ptr ipivPtr bPtr ldbPtr
hbev ::
Char ->
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), Int)
hbev jobz uplo kd ab ldz = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 n
rwork <- Call.newArray1 (maximum[1,3*n2])
evalContT $ do
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hbev jobzPtr uploPtr nPtr kdPtr abPtr ldabPtr wPtr zPtr ldzPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure w
<*> pure z
<*> fmap fromIntegral (peek infoPtr)
hbevd ::
Char ->
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), Int)
hbevd jobz uplo kd ab ldz lwork rworkSize lrwork liwork = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 rworkSize
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.hbevd jobzPtr uploPtr nPtr kdPtr abPtr ldabPtr wPtr zPtr ldzPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,,)
<*> pure w
<*> pure z
<*> fmap fromIntegral (peek infoPtr)
hbevx ::
Char ->
Char ->
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Float ->
Float ->
Int ->
Int ->
Float ->
Int ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
hbevx jobz range uplo kd ab ldq vl vu il iu abstol m ldz = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
q <- Call.newArray2 n ldq
w <- Call.newArray1 n
z <- Call.newArray2 (maximum[1,m]) ldz
work <- Call.newArray1 n
rwork <- Call.newArray1 (7*n)
iwork <- Call.newArray1 (5*n)
ifail <- Call.newArray1 n
evalContT $ do
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
qPtr <- Call.array q
ldqPtr <- Call.cint ldq
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
abstolPtr <- Call.float abstol
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
ifailPtr <- Call.array ifail
infoPtr <- Call.alloca
liftIO $ Lapack.hbevx jobzPtr rangePtr uploPtr nPtr kdPtr abPtr ldabPtr qPtr ldqPtr vlPtr vuPtr ilPtr iuPtr abstolPtr mPtr wPtr zPtr ldzPtr workPtr rworkPtr iworkPtr ifailPtr infoPtr
liftIO $ pure (,,,,,)
<*> pure q
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure ifail
<*> fmap fromIntegral (peek infoPtr)
hbgst ::
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int)
hbgst vect uplo ka kb ab bb ldx = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let (bbDim0,bbDim1) = Call.sizes2 $ bounds bb
let n = abDim0
let ldab = abDim1
let ldbb = bbDim1
Call.assert "hbgst: n == bbDim0" (n == bbDim0)
x <- Call.newArray2 n ldx
work <- Call.newArray1 n
rwork <- Call.newArray1 n
evalContT $ do
vectPtr <- Call.char vect
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kaPtr <- Call.cint ka
kbPtr <- Call.cint kb
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
bbPtr <- Call.array bb
ldbbPtr <- Call.cint ldbb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hbgst vectPtr uploPtr nPtr kaPtr kbPtr abPtr ldabPtr bbPtr ldbbPtr xPtr ldxPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> pure x
<*> fmap fromIntegral (peek infoPtr)
hbgv ::
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), Int)
hbgv jobz uplo ka kb ab bb ldz = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(bbDim0,bbDim1) <- Call.sizes2 <$> getBounds bb
let n = abDim0
let ldab = abDim1
let ldbb = bbDim1
Call.assert "hbgv: n == bbDim0" (n == bbDim0)
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 n
rwork <- Call.newArray1 (3*n)
evalContT $ do
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kaPtr <- Call.cint ka
kbPtr <- Call.cint kb
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
bbPtr <- Call.ioarray bb
ldbbPtr <- Call.cint ldbb
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hbgv jobzPtr uploPtr nPtr kaPtr kbPtr abPtr ldabPtr bbPtr ldbbPtr wPtr zPtr ldzPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure w
<*> pure z
<*> fmap fromIntegral (peek infoPtr)
hbgvd ::
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), Int)
hbgvd jobz uplo ka kb ab bb ldz lwork lrwork liwork = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(bbDim0,bbDim1) <- Call.sizes2 <$> getBounds bb
let n = abDim0
let ldab = abDim1
let ldbb = bbDim1
Call.assert "hbgvd: n == bbDim0" (n == bbDim0)
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,lrwork])
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kaPtr <- Call.cint ka
kbPtr <- Call.cint kb
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
bbPtr <- Call.ioarray bb
ldbbPtr <- Call.cint ldbb
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.hbgvd jobzPtr uploPtr nPtr kaPtr kbPtr abPtr ldabPtr bbPtr ldbbPtr wPtr zPtr ldzPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,,)
<*> pure w
<*> pure z
<*> fmap fromIntegral (peek infoPtr)
hbgvx ::
Char ->
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Float ->
Float ->
Int ->
Int ->
Float ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
hbgvx jobz range uplo ka kb ab bb ldq vl vu il iu abstol ldz = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(bbDim0,bbDim1) <- Call.sizes2 <$> getBounds bb
let n = abDim0
let ldab = abDim1
let ldbb = bbDim1
Call.assert "hbgvx: n == bbDim0" (n == bbDim0)
q <- Call.newArray2 n ldq
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 n
rwork <- Call.newArray1 (7*n)
iwork <- Call.newArray1 (5*n)
ifail <- Call.newArray1 n
evalContT $ do
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kaPtr <- Call.cint ka
kbPtr <- Call.cint kb
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
bbPtr <- Call.ioarray bb
ldbbPtr <- Call.cint ldbb
qPtr <- Call.array q
ldqPtr <- Call.cint ldq
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
abstolPtr <- Call.float abstol
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
ifailPtr <- Call.array ifail
infoPtr <- Call.alloca
liftIO $ Lapack.hbgvx jobzPtr rangePtr uploPtr nPtr kaPtr kbPtr abPtr ldabPtr bbPtr ldbbPtr qPtr ldqPtr vlPtr vuPtr ilPtr iuPtr abstolPtr mPtr wPtr zPtr ldzPtr workPtr rworkPtr iworkPtr ifailPtr infoPtr
liftIO $ pure (,,,,,)
<*> pure q
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure ifail
<*> fmap fromIntegral (peek infoPtr)
hbtrd ::
Char ->
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
hbtrd vect uplo kd ab q = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
let n = abDim0
let ldab = abDim1
let ldq = qDim1
Call.assert "hbtrd: n == qDim0" (n == qDim0)
d <- Call.newArray1 n
e <- Call.newArray1 (n1)
work <- Call.newArray1 n
evalContT $ do
vectPtr <- Call.char vect
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
dPtr <- Call.array d
ePtr <- Call.array e
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.hbtrd vectPtr uploPtr nPtr kdPtr abPtr ldabPtr dPtr ePtr qPtr ldqPtr workPtr infoPtr
liftIO $ pure (,,)
<*> pure d
<*> pure e
<*> fmap fromIntegral (peek infoPtr)
hecon ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
Float ->
IO (Float, Int)
hecon uplo a ipiv anorm = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "hecon: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.hecon uploPtr nPtr aPtr ldaPtr ipivPtr anormPtr rcondPtr workPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
heequb ::
Char ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, Float, Float, Int)
heequb uplo a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
s <- Call.newArray1 n
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
sPtr <- Call.array s
scondPtr <- Call.alloca
amaxPtr <- Call.alloca
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.heequb uploPtr nPtr aPtr ldaPtr sPtr scondPtr amaxPtr workPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> peek scondPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
heev ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, Int)
heev jobz uplo a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
w <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,3*n2])
evalContT $ do
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
wPtr <- Call.array w
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.heev jobzPtr uploPtr nPtr aPtr ldaPtr wPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
heevd ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int Float, Int)
heevd jobz uplo a lwork rworkSize lrwork liwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
w <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 rworkSize
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
wPtr <- Call.array w
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.heevd jobzPtr uploPtr nPtr aPtr ldaPtr wPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,)
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
heevr ::
Char ->
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Float ->
Int ->
Int ->
Float ->
Int ->
Int ->
Int ->
Int ->
Int ->
IO (Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
heevr jobz range uplo a vl vu il iu abstol m ldz lwork lrwork liwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
w <- Call.newArray1 n
z <- Call.newArray2 (maximum[1,m]) ldz
isuppz <- Call.newArray1 (2*maximum[1,m])
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,lrwork])
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
abstolPtr <- Call.float abstol
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
isuppzPtr <- Call.array isuppz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.heevr jobzPtr rangePtr uploPtr nPtr aPtr ldaPtr vlPtr vuPtr ilPtr iuPtr abstolPtr mPtr wPtr zPtr ldzPtr isuppzPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,,,,)
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure isuppz
<*> fmap fromIntegral (peek infoPtr)
heevx ::
Char ->
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Float ->
Int ->
Int ->
Float ->
Int ->
Int ->
Int ->
IO (Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
heevx jobz range uplo a vl vu il iu abstol m ldz lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
w <- Call.newArray1 n
z <- Call.newArray2 (maximum[1,m]) ldz
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (7*n)
iwork <- Call.newArray1 (5*n)
ifail <- Call.newArray1 n
evalContT $ do
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
abstolPtr <- Call.float abstol
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
ifailPtr <- Call.array ifail
infoPtr <- Call.alloca
liftIO $ Lapack.heevx jobzPtr rangePtr uploPtr nPtr aPtr ldaPtr vlPtr vuPtr ilPtr iuPtr abstolPtr mPtr wPtr zPtr ldzPtr workPtr lworkPtr rworkPtr iworkPtr ifailPtr infoPtr
liftIO $ pure (,,,,)
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure ifail
<*> fmap fromIntegral (peek infoPtr)
hegs2 ::
Int ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
hegs2 itype uplo a b = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "hegs2: n == bDim0" (n == bDim0)
evalContT $ do
itypePtr <- Call.cint itype
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.hegs2 itypePtr uploPtr nPtr aPtr ldaPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hegst ::
Int ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
hegst itype uplo a b = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "hegst: n == bDim0" (n == bDim0)
evalContT $ do
itypePtr <- Call.cint itype
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.hegst itypePtr uploPtr nPtr aPtr ldaPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hegv ::
Int ->
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, Int)
hegv itype jobz uplo a b lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "hegv: n == bDim0" (n == bDim0)
w <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,3*n2])
evalContT $ do
itypePtr <- Call.cint itype
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
wPtr <- Call.array w
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hegv itypePtr jobzPtr uploPtr nPtr aPtr ldaPtr bPtr ldbPtr wPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
hegvd ::
Int ->
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
IO (CArray Int Float, Int)
hegvd itype jobz uplo a b lwork lrwork liwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "hegvd: n == bDim0" (n == bDim0)
w <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,lrwork])
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
itypePtr <- Call.cint itype
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
wPtr <- Call.array w
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.hegvd itypePtr jobzPtr uploPtr nPtr aPtr ldaPtr bPtr ldbPtr wPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,)
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
hegvx ::
Int ->
Char ->
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Float ->
Int ->
Int ->
Float ->
Int ->
Int ->
Int ->
IO (Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
hegvx itype jobz range uplo a b vl vu il iu abstol m ldz lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "hegvx: n == bDim0" (n == bDim0)
w <- Call.newArray1 n
z <- Call.newArray2 (maximum[1,m]) ldz
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (7*n)
iwork <- Call.newArray1 (5*n)
ifail <- Call.newArray1 n
evalContT $ do
itypePtr <- Call.cint itype
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
abstolPtr <- Call.float abstol
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
ifailPtr <- Call.array ifail
infoPtr <- Call.alloca
liftIO $ Lapack.hegvx itypePtr jobzPtr rangePtr uploPtr nPtr aPtr ldaPtr bPtr ldbPtr vlPtr vuPtr ilPtr iuPtr abstolPtr mPtr wPtr zPtr ldzPtr workPtr lworkPtr rworkPtr iworkPtr ifailPtr infoPtr
liftIO $ pure (,,,,)
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure ifail
<*> fmap fromIntegral (peek infoPtr)
herfs ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
herfs uplo a af ipiv b x = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (afDim0,afDim1) = Call.sizes2 $ bounds af
let ipivDim0 = Call.sizes1 $ bounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = aDim0
let lda = aDim1
let ldaf = afDim1
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "herfs: n == afDim0" (n == afDim0)
Call.assert "herfs: n == ipivDim0" (n == ipivDim0)
Call.assert "herfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
afPtr <- Call.array af
ldafPtr <- Call.cint ldaf
ipivPtr <- Call.array ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.herfs uploPtr nPtr nrhsPtr aPtr ldaPtr afPtr ldafPtr ipivPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
hesv ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int CInt, Int)
hesv uplo a b lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
ipiv <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.hesv uploPtr nPtr nrhsPtr aPtr ldaPtr ipivPtr bPtr ldbPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
hesvx ::
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
hesvx fact uplo a af ipiv b ldx lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
(afDim0,afDim1) <- Call.sizes2 <$> getBounds af
ipivDim0 <- Call.sizes1 <$> getBounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let n = aDim0
let lda = aDim1
let ldaf = afDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "hesvx: n == afDim0" (n == afDim0)
Call.assert "hesvx: n == ipivDim0" (n == ipivDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
afPtr <- Call.ioarray af
ldafPtr <- Call.cint ldaf
ipivPtr <- Call.ioarray ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hesvx factPtr uploPtr nPtr nrhsPtr aPtr ldaPtr afPtr ldafPtr ipivPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
heswapr ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO ()
heswapr uplo a i1 i2 = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
i1Ptr <- Call.cint i1
i2Ptr <- Call.cint i2
liftIO $ Lapack.heswapr uploPtr nPtr aPtr ldaPtr i1Ptr i2Ptr
hetd2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, CArray Int (Complex Float), Int)
hetd2 uplo a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
d <- Call.newArray1 n
e <- Call.newArray1 (n1)
tau <- Call.newArray1 (n1)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
dPtr <- Call.array d
ePtr <- Call.array e
tauPtr <- Call.array tau
infoPtr <- Call.alloca
liftIO $ Lapack.hetd2 uploPtr nPtr aPtr ldaPtr dPtr ePtr tauPtr infoPtr
liftIO $ pure (,,,)
<*> pure d
<*> pure e
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
hetf2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
hetf2 uplo a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.hetf2 uploPtr nPtr aPtr ldaPtr ipivPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
hetrd ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, CArray Int Float, CArray Int (Complex Float), Int)
hetrd uplo a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
d <- Call.newArray1 n
e <- Call.newArray1 (n1)
tau <- Call.newArray1 (n1)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
dPtr <- Call.array d
ePtr <- Call.array e
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.hetrd uploPtr nPtr aPtr ldaPtr dPtr ePtr tauPtr workPtr lworkPtr infoPtr
liftIO $ pure (,,,)
<*> pure d
<*> pure e
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
hetrf ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int CInt, Int)
hetrf uplo a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.hetrf uploPtr nPtr aPtr ldaPtr ipivPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
hetri ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IO (Int)
hetri uplo a ipiv = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "hetri: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.hetri uploPtr nPtr aPtr ldaPtr ipivPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hetri2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
Int ->
Int ->
IO (Int)
hetri2 uplo a ipiv nb lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "hetri2: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 (n+nb+1)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.hetri2 uploPtr nPtr aPtr ldaPtr ipivPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hetri2x ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
Int ->
IO (Int)
hetri2x uplo a ipiv nb = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "hetri2x: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray2 (nb+3) (n+nb+1)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
nbPtr <- Call.cint nb
infoPtr <- Call.alloca
liftIO $ Lapack.hetri2x uploPtr nPtr aPtr ldaPtr ipivPtr workPtr nbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hetrs ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
hetrs uplo a ipiv b = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "hetrs: n == ipivDim0" (n == ipivDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.hetrs uploPtr nPtr nrhsPtr aPtr ldaPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hetrs2 ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
hetrs2 uplo a ipiv b = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "hetrs2: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.hetrs2 uploPtr nPtr nrhsPtr aPtr ldaPtr ipivPtr bPtr ldbPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hfrk ::
Char ->
Char ->
Char ->
Int ->
Int ->
Float ->
CArray (Int,Int) (Complex Float) ->
Float ->
IOCArray Int (Complex Float) ->
IO ()
hfrk transr uplo trans n k alpha a beta c = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
cDim0 <- Call.sizes1 <$> getBounds c
let _ka = aDim0
let lda = aDim1
Call.assert "hfrk: n*(n+1)`div`2 == cDim0" (n*(n+1)`div`2 == cDim0)
evalContT $ do
transrPtr <- Call.char transr
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
liftIO $ Lapack.hfrk transrPtr uploPtr transPtr nPtr kPtr alphaPtr aPtr ldaPtr betaPtr cPtr
hgeqz ::
Char ->
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), CArray Int (Complex Float), Int)
hgeqz job compq compz ilo ihi h t q z lwork = do
(hDim0,hDim1) <- Call.sizes2 <$> getBounds h
(tDim0,tDim1) <- Call.sizes2 <$> getBounds t
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = hDim0
let ldh = hDim1
let ldt = tDim1
let ldq = qDim1
let ldz = zDim1
Call.assert "hgeqz: n == tDim0" (n == tDim0)
Call.assert "hgeqz: n == qDim0" (n == qDim0)
Call.assert "hgeqz: n == zDim0" (n == zDim0)
alpha <- Call.newArray1 n
beta <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 n
evalContT $ do
jobPtr <- Call.char job
compqPtr <- Call.char compq
compzPtr <- Call.char compz
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
hPtr <- Call.ioarray h
ldhPtr <- Call.cint ldh
tPtr <- Call.ioarray t
ldtPtr <- Call.cint ldt
alphaPtr <- Call.array alpha
betaPtr <- Call.array beta
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hgeqz jobPtr compqPtr compzPtr nPtr iloPtr ihiPtr hPtr ldhPtr tPtr ldtPtr alphaPtr betaPtr qPtr ldqPtr zPtr ldzPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure alpha
<*> pure beta
<*> fmap fromIntegral (peek infoPtr)
hla_transtype ::
Int ->
IO CChar
hla_transtype trans = do
evalContT $ do
transPtr <- Call.cint trans
liftIO $ Lapack.hla_transtype transPtr
hpcon ::
Char ->
CArray Int (Complex Float) ->
CArray Int CInt ->
Float ->
IO (Float, Int)
hpcon uplo ap ipiv anorm = do
let apDim0 = Call.sizes1 $ bounds ap
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = ipivDim0
Call.assert "hpcon: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
ipivPtr <- Call.array ipiv
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.hpcon uploPtr nPtr apPtr ipivPtr anormPtr rcondPtr workPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
hpev ::
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), Int)
hpev jobz uplo n ap ldz = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "hpev: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 (maximum[1,2*n1])
rwork <- Call.newArray1 (maximum[1,3*n2])
evalContT $ do
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hpev jobzPtr uploPtr nPtr apPtr wPtr zPtr ldzPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure w
<*> pure z
<*> fmap fromIntegral (peek infoPtr)
hpevd ::
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), Int)
hpevd jobz uplo n ap ldz lwork lrwork liwork = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "hpevd: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,lrwork])
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.hpevd jobzPtr uploPtr nPtr apPtr wPtr zPtr ldzPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,,)
<*> pure w
<*> pure z
<*> fmap fromIntegral (peek infoPtr)
hpevx ::
Char ->
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
Float ->
Float ->
Int ->
Int ->
Float ->
Int ->
Int ->
IO (Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
hpevx jobz range uplo n ap vl vu il iu abstol m ldz = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "hpevx: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
w <- Call.newArray1 n
z <- Call.newArray2 (maximum[1,m]) ldz
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 (7*n)
iwork <- Call.newArray1 (5*n)
ifail <- Call.newArray1 n
evalContT $ do
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
abstolPtr <- Call.float abstol
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
ifailPtr <- Call.array ifail
infoPtr <- Call.alloca
liftIO $ Lapack.hpevx jobzPtr rangePtr uploPtr nPtr apPtr vlPtr vuPtr ilPtr iuPtr abstolPtr mPtr wPtr zPtr ldzPtr workPtr rworkPtr iworkPtr ifailPtr infoPtr
liftIO $ pure (,,,,)
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure ifail
<*> fmap fromIntegral (peek infoPtr)
hpgst ::
Int ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
CArray Int (Complex Float) ->
IO (Int)
hpgst itype uplo n ap bp = do
apDim0 <- Call.sizes1 <$> getBounds ap
let bpDim0 = Call.sizes1 $ bounds bp
Call.assert "hpgst: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "hpgst: n*(n+1)`div`2 == bpDim0" (n*(n+1)`div`2 == bpDim0)
evalContT $ do
itypePtr <- Call.cint itype
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
bpPtr <- Call.array bp
infoPtr <- Call.alloca
liftIO $ Lapack.hpgst itypePtr uploPtr nPtr apPtr bpPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hpgv ::
Int ->
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), Int)
hpgv itype jobz uplo n ap bp ldz = do
apDim0 <- Call.sizes1 <$> getBounds ap
bpDim0 <- Call.sizes1 <$> getBounds bp
Call.assert "hpgv: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "hpgv: n*(n+1)`div`2 == bpDim0" (n*(n+1)`div`2 == bpDim0)
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 (maximum[1,2*n1])
rwork <- Call.newArray1 (maximum[1,3*n2])
evalContT $ do
itypePtr <- Call.cint itype
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
bpPtr <- Call.ioarray bp
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hpgv itypePtr jobzPtr uploPtr nPtr apPtr bpPtr wPtr zPtr ldzPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure w
<*> pure z
<*> fmap fromIntegral (peek infoPtr)
hpgvd ::
Int ->
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), Int)
hpgvd itype jobz uplo n ap bp ldz lwork lrwork liwork = do
apDim0 <- Call.sizes1 <$> getBounds ap
bpDim0 <- Call.sizes1 <$> getBounds bp
Call.assert "hpgvd: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "hpgvd: n*(n+1)`div`2 == bpDim0" (n*(n+1)`div`2 == bpDim0)
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,lrwork])
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
itypePtr <- Call.cint itype
jobzPtr <- Call.char jobz
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
bpPtr <- Call.ioarray bp
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.hpgvd itypePtr jobzPtr uploPtr nPtr apPtr bpPtr wPtr zPtr ldzPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,,)
<*> pure w
<*> pure z
<*> fmap fromIntegral (peek infoPtr)
hpgvx ::
Int ->
Char ->
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
Float ->
Float ->
Int ->
Int ->
Float ->
Int ->
IO (Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
hpgvx itype jobz range uplo n ap bp vl vu il iu abstol ldz = do
apDim0 <- Call.sizes1 <$> getBounds ap
bpDim0 <- Call.sizes1 <$> getBounds bp
Call.assert "hpgvx: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "hpgvx: n*(n+1)`div`2 == bpDim0" (n*(n+1)`div`2 == bpDim0)
w <- Call.newArray1 n
z <- Call.newArray2 n ldz
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 (7*n)
iwork <- Call.newArray1 (5*n)
ifail <- Call.newArray1 n
evalContT $ do
itypePtr <- Call.cint itype
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
bpPtr <- Call.ioarray bp
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
abstolPtr <- Call.float abstol
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
ifailPtr <- Call.array ifail
infoPtr <- Call.alloca
liftIO $ Lapack.hpgvx itypePtr jobzPtr rangePtr uploPtr nPtr apPtr bpPtr vlPtr vuPtr ilPtr iuPtr abstolPtr mPtr wPtr zPtr ldzPtr workPtr rworkPtr iworkPtr ifailPtr infoPtr
liftIO $ pure (,,,,)
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure ifail
<*> fmap fromIntegral (peek infoPtr)
hprfs ::
Char ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
hprfs uplo ap afp ipiv b x = do
let apDim0 = Call.sizes1 $ bounds ap
let afpDim0 = Call.sizes1 $ bounds afp
let ipivDim0 = Call.sizes1 $ bounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = ipivDim0
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "hprfs: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "hprfs: n*(n+1)`div`2 == afpDim0" (n*(n+1)`div`2 == afpDim0)
Call.assert "hprfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
afpPtr <- Call.array afp
ipivPtr <- Call.array ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hprfs uploPtr nPtr nrhsPtr apPtr afpPtr ipivPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
hpsv ::
Char ->
Int ->
IOCArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
hpsv uplo n ap b = do
apDim0 <- Call.sizes1 <$> getBounds ap
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let nrhs = bDim0
let ldb = bDim1
Call.assert "hpsv: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
ipiv <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.ioarray ap
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.hpsv uploPtr nPtr nrhsPtr apPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
hpsvx ::
Char ->
Char ->
CArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
hpsvx fact uplo ap afp ipiv b ldx = do
let apDim0 = Call.sizes1 $ bounds ap
afpDim0 <- Call.sizes1 <$> getBounds afp
ipivDim0 <- Call.sizes1 <$> getBounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let n = ipivDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "hpsvx: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "hpsvx: n*(n+1)`div`2 == afpDim0" (n*(n+1)`div`2 == afpDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
afpPtr <- Call.ioarray afp
ipivPtr <- Call.ioarray ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.hpsvx factPtr uploPtr nPtr nrhsPtr apPtr afpPtr ipivPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
hptrd ::
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (CArray Int Float, CArray Int Float, CArray Int (Complex Float), Int)
hptrd uplo n ap = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "hptrd: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
d <- Call.newArray1 n
e <- Call.newArray1 (n1)
tau <- Call.newArray1 (n1)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
dPtr <- Call.array d
ePtr <- Call.array e
tauPtr <- Call.array tau
infoPtr <- Call.alloca
liftIO $ Lapack.hptrd uploPtr nPtr apPtr dPtr ePtr tauPtr infoPtr
liftIO $ pure (,,,)
<*> pure d
<*> pure e
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
hptrf ::
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (CArray Int CInt, Int)
hptrf uplo n ap = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "hptrf: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
ipiv <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.hptrf uploPtr nPtr apPtr ipivPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
hptri ::
Char ->
IOCArray Int (Complex Float) ->
CArray Int CInt ->
IO (Int)
hptri uplo ap ipiv = do
apDim0 <- Call.sizes1 <$> getBounds ap
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = ipivDim0
Call.assert "hptri: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.hptri uploPtr nPtr apPtr ipivPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hptrs ::
Char ->
CArray Int (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
hptrs uplo ap ipiv b = do
let apDim0 = Call.sizes1 $ bounds ap
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = ipivDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "hptrs: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.hptrs uploPtr nPtr nrhsPtr apPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
hsein ::
Char ->
Char ->
Char ->
CArray Int Bool ->
CArray (Int,Int) (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int, CArray Int CInt, CArray Int CInt, Int)
hsein side eigsrc initv select h w vl vr = do
let selectDim0 = Call.sizes1 $ bounds select
let (hDim0,hDim1) = Call.sizes2 $ bounds h
wDim0 <- Call.sizes1 <$> getBounds w
(vlDim0,vlDim1) <- Call.sizes2 <$> getBounds vl
(vrDim0,vrDim1) <- Call.sizes2 <$> getBounds vr
let n = selectDim0
let ldh = hDim1
let mm = vlDim0
let ldvl = vlDim1
let ldvr = vrDim1
Call.assert "hsein: n == hDim0" (n == hDim0)
Call.assert "hsein: n == wDim0" (n == wDim0)
Call.assert "hsein: mm == vrDim0" (mm == vrDim0)
work <- Call.newArray1 (n*n)
rwork <- Call.newArray1 n
ifaill <- Call.newArray1 mm
ifailr <- Call.newArray1 mm
evalContT $ do
sidePtr <- Call.char side
eigsrcPtr <- Call.char eigsrc
initvPtr <- Call.char initv
selectPtr <- Call.array select
nPtr <- Call.cint n
hPtr <- Call.array h
ldhPtr <- Call.cint ldh
wPtr <- Call.ioarray w
vlPtr <- Call.ioarray vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.ioarray vr
ldvrPtr <- Call.cint ldvr
mmPtr <- Call.cint mm
mPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
ifaillPtr <- Call.array ifaill
ifailrPtr <- Call.array ifailr
infoPtr <- Call.alloca
liftIO $ Lapack.hsein sidePtr eigsrcPtr initvPtr selectPtr nPtr hPtr ldhPtr wPtr vlPtr ldvlPtr vrPtr ldvrPtr mmPtr mPtr workPtr rworkPtr ifaillPtr ifailrPtr infoPtr
liftIO $ pure (,,,)
<*> fmap fromIntegral (peek mPtr)
<*> pure ifaill
<*> pure ifailr
<*> fmap fromIntegral (peek infoPtr)
hseqr ::
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
hseqr job compz ilo ihi h z lwork = do
(hDim0,hDim1) <- Call.sizes2 <$> getBounds h
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = hDim0
let ldh = hDim1
let ldz = zDim1
Call.assert "hseqr: n == zDim0" (n == zDim0)
w <- Call.newArray1 n
work <- Call.newArray1 lwork
evalContT $ do
jobPtr <- Call.char job
compzPtr <- Call.char compz
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
hPtr <- Call.ioarray h
ldhPtr <- Call.cint ldh
wPtr <- Call.array w
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.hseqr jobPtr compzPtr nPtr iloPtr ihiPtr hPtr ldhPtr wPtr zPtr ldzPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
labrd ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray Int Float, CArray Int Float, CArray Int (Complex Float), CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float))
labrd m nb a ldx ldy = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
d <- Call.newArray1 nb
e <- Call.newArray1 nb
tauq <- Call.newArray1 nb
taup <- Call.newArray1 nb
x <- Call.newArray2 nb ldx
y <- Call.newArray2 nb ldy
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
nbPtr <- Call.cint nb
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
dPtr <- Call.array d
ePtr <- Call.array e
tauqPtr <- Call.array tauq
taupPtr <- Call.array taup
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
yPtr <- Call.array y
ldyPtr <- Call.cint ldy
liftIO $ Lapack.labrd mPtr nPtr nbPtr aPtr ldaPtr dPtr ePtr tauqPtr taupPtr xPtr ldxPtr yPtr ldyPtr
liftIO $ pure (,,,,,)
<*> pure d
<*> pure e
<*> pure tauq
<*> pure taup
<*> pure x
<*> pure y
lacgv ::
Int ->
IOCArray Int (Complex Float) ->
Int ->
IO ()
lacgv n x incx = do
xDim0 <- Call.sizes1 <$> getBounds x
let _xSize = xDim0
evalContT $ do
nPtr <- Call.cint n
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
liftIO $ Lapack.lacgv nPtr xPtr incxPtr
lacn2 ::
IOCArray Int (Complex Float) ->
Float ->
Int ->
IOCArray Int CInt ->
IO (CArray Int (Complex Float), Float, Int)
lacn2 x est kase isave = do
xDim0 <- Call.sizes1 <$> getBounds x
isaveDim0 <- Call.sizes1 <$> getBounds isave
let n = xDim0
Call.assert "lacn2: 3 == isaveDim0" (3 == isaveDim0)
v <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
vPtr <- Call.array v
xPtr <- Call.ioarray x
estPtr <- Call.float est
kasePtr <- Call.cint kase
isavePtr <- Call.ioarray isave
liftIO $ Lapack.lacn2 nPtr vPtr xPtr estPtr kasePtr isavePtr
liftIO $ pure (,,)
<*> pure v
<*> peek estPtr
<*> fmap fromIntegral (peek kasePtr)
lacon ::
IOCArray Int (Complex Float) ->
Float ->
Int ->
IO (CArray Int (Complex Float), Float, Int)
lacon x est kase = do
xDim0 <- Call.sizes1 <$> getBounds x
let n = xDim0
v <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
vPtr <- Call.array v
xPtr <- Call.ioarray x
estPtr <- Call.float est
kasePtr <- Call.cint kase
liftIO $ Lapack.lacon nPtr vPtr xPtr estPtr kasePtr
liftIO $ pure (,,)
<*> pure v
<*> peek estPtr
<*> fmap fromIntegral (peek kasePtr)
lacp2 ::
Char ->
Int ->
CArray (Int,Int) Float ->
Int ->
IO (CArray (Int,Int) (Complex Float))
lacp2 uplo m a ldb = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
b <- Call.newArray2 n ldb
evalContT $ do
uploPtr <- Call.char uplo
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
liftIO $ Lapack.lacp2 uploPtr mPtr nPtr aPtr ldaPtr bPtr ldbPtr
liftIO $ pure b
lacpy ::
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float))
lacpy uplo m a ldb = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
b <- Call.newArray2 n ldb
evalContT $ do
uploPtr <- Call.char uplo
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
liftIO $ Lapack.lacpy uploPtr mPtr nPtr aPtr ldaPtr bPtr ldbPtr
liftIO $ pure b
lacrm ::
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) Float ->
Int ->
IO (CArray (Int,Int) (Complex Float))
lacrm m a b ldc = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let n = aDim0
let lda = aDim1
let ldb = bDim1
Call.assert "lacrm: n == bDim0" (n == bDim0)
c <- Call.newArray2 n ldc
rwork <- Call.newArray1 (2*m*n)
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
cPtr <- Call.array c
ldcPtr <- Call.cint ldc
rworkPtr <- Call.array rwork
liftIO $ Lapack.lacrm mPtr nPtr aPtr ldaPtr bPtr ldbPtr cPtr ldcPtr rworkPtr
liftIO $ pure c
lacrt ::
IOCArray Int (Complex Float) ->
Int ->
IOCArray Int (Complex Float) ->
Int ->
Complex Float ->
Complex Float ->
IO ()
lacrt cx incx cy incy c s = do
cxDim0 <- Call.sizes1 <$> getBounds cx
cyDim0 <- Call.sizes1 <$> getBounds cy
let n = cxDim0
Call.assert "lacrt: n == cyDim0" (n == cyDim0)
evalContT $ do
nPtr <- Call.cint n
cxPtr <- Call.ioarray cx
incxPtr <- Call.cint incx
cyPtr <- Call.ioarray cy
incyPtr <- Call.cint incy
cPtr <- Call.complexFloat c
sPtr <- Call.complexFloat s
liftIO $ Lapack.lacrt nPtr cxPtr incxPtr cyPtr incyPtr cPtr sPtr
laed0 ::
Int ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int)
laed0 qsiz d e q ldqs rworkSize iworkSize = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
let n = dDim0
let ldq = qDim1
Call.assert "laed0: n-1 == eDim0" (n1 == eDim0)
Call.assert "laed0: n == qDim0" (n == qDim0)
qstore <- Call.newArray2 n ldqs
rwork <- Call.newArray1 rworkSize
iwork <- Call.newArray1 iworkSize
evalContT $ do
qsizPtr <- Call.cint qsiz
nPtr <- Call.cint n
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
qstorePtr <- Call.array qstore
ldqsPtr <- Call.cint ldqs
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.laed0 qsizPtr nPtr dPtr ePtr qPtr ldqPtr qstorePtr ldqsPtr rworkPtr iworkPtr infoPtr
liftIO $ pure (,)
<*> pure qstore
<*> fmap fromIntegral (peek infoPtr)
laed7 ::
Int ->
Int ->
Int ->
Int ->
Int ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
IOCArray Int Float ->
IOCArray Int CInt ->
CArray Int CInt ->
CArray Int CInt ->
CArray Int CInt ->
CArray (Int,Int) CInt ->
CArray (Int,Int) Float ->
Int ->
IO (CArray Int CInt, Int)
laed7 cutpnt qsiz tlvls curlvl curpbm d q rho qstore qptr prmptr perm givptr givcol givnum rworkSize = do
dDim0 <- Call.sizes1 <$> getBounds d
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
qstoreDim0 <- Call.sizes1 <$> getBounds qstore
qptrDim0 <- Call.sizes1 <$> getBounds qptr
let prmptrDim0 = Call.sizes1 $ bounds prmptr
let permDim0 = Call.sizes1 $ bounds perm
let givptrDim0 = Call.sizes1 $ bounds givptr
let (givcolDim0,givcolDim1) = Call.sizes2 $ bounds givcol
let (givnumDim0,givnumDim1) = Call.sizes2 $ bounds givnum
let n = dDim0
let ldq = qDim1
let nlgn = prmptrDim0
Call.assert "laed7: n == qDim0" (n == qDim0)
Call.assert "laed7: n^!2+1 == qstoreDim0" (n^!2+1 == qstoreDim0)
Call.assert "laed7: n+2 == qptrDim0" (n+2 == qptrDim0)
Call.assert "laed7: nlgn == permDim0" (nlgn == permDim0)
Call.assert "laed7: nlgn == givptrDim0" (nlgn == givptrDim0)
Call.assert "laed7: nlgn == givcolDim0" (nlgn == givcolDim0)
Call.assert "laed7: 2 == givcolDim1" (2 == givcolDim1)
Call.assert "laed7: nlgn == givnumDim0" (nlgn == givnumDim0)
Call.assert "laed7: 2 == givnumDim1" (2 == givnumDim1)
indxq <- Call.newArray1 n
work <- Call.newArray1 (qsiz*n)
rwork <- Call.newArray1 rworkSize
iwork <- Call.newArray1 (4*n)
evalContT $ do
nPtr <- Call.cint n
cutpntPtr <- Call.cint cutpnt
qsizPtr <- Call.cint qsiz
tlvlsPtr <- Call.cint tlvls
curlvlPtr <- Call.cint curlvl
curpbmPtr <- Call.cint curpbm
dPtr <- Call.ioarray d
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
rhoPtr <- Call.float rho
indxqPtr <- Call.array indxq
qstorePtr <- Call.ioarray qstore
qptrPtr <- Call.ioarray qptr
prmptrPtr <- Call.array prmptr
permPtr <- Call.array perm
givptrPtr <- Call.array givptr
givcolPtr <- Call.array givcol
givnumPtr <- Call.array givnum
workPtr <- Call.array work
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.laed7 nPtr cutpntPtr qsizPtr tlvlsPtr curlvlPtr curpbmPtr dPtr qPtr ldqPtr rhoPtr indxqPtr qstorePtr qptrPtr prmptrPtr permPtr givptrPtr givcolPtr givnumPtr workPtr rworkPtr iworkPtr infoPtr
liftIO $ pure (,)
<*> pure indxq
<*> fmap fromIntegral (peek infoPtr)
laed8 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int Float ->
Float ->
Int ->
CArray Int Float ->
Int ->
CArray Int CInt ->
IO (Int, Float, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int Float, CArray Int CInt, CArray Int CInt, CArray Int CInt, Int, CArray (Int,Int) CInt, CArray (Int,Int) Float, Int)
laed8 qsiz q d rho cutpnt z ldq2 indxq = do
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
dDim0 <- Call.sizes1 <$> getBounds d
let zDim0 = Call.sizes1 $ bounds z
let indxqDim0 = Call.sizes1 $ bounds indxq
let n = qDim0
let ldq = qDim1
Call.assert "laed8: n == dDim0" (n == dDim0)
Call.assert "laed8: n == zDim0" (n == zDim0)
Call.assert "laed8: n == indxqDim0" (n == indxqDim0)
dlamda <- Call.newArray1 n
q2 <- Call.newArray2 n ldq2
w <- Call.newArray1 n
indxp <- Call.newArray1 n
indx <- Call.newArray1 n
perm <- Call.newArray1 n
givcol <- Call.newArray2 n 2
givnum <- Call.newArray2 n 2
evalContT $ do
kPtr <- Call.alloca
nPtr <- Call.cint n
qsizPtr <- Call.cint qsiz
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
dPtr <- Call.ioarray d
rhoPtr <- Call.float rho
cutpntPtr <- Call.cint cutpnt
zPtr <- Call.array z
dlamdaPtr <- Call.array dlamda
q2Ptr <- Call.array q2
ldq2Ptr <- Call.cint ldq2
wPtr <- Call.array w
indxpPtr <- Call.array indxp
indxPtr <- Call.array indx
indxqPtr <- Call.array indxq
permPtr <- Call.array perm
givptrPtr <- Call.alloca
givcolPtr <- Call.array givcol
givnumPtr <- Call.array givnum
infoPtr <- Call.alloca
liftIO $ Lapack.laed8 kPtr nPtr qsizPtr qPtr ldqPtr dPtr rhoPtr cutpntPtr zPtr dlamdaPtr q2Ptr ldq2Ptr wPtr indxpPtr indxPtr indxqPtr permPtr givptrPtr givcolPtr givnumPtr infoPtr
liftIO $ pure (,,,,,,,,,,,)
<*> fmap fromIntegral (peek kPtr)
<*> peek rhoPtr
<*> pure dlamda
<*> pure q2
<*> pure w
<*> pure indxp
<*> pure indx
<*> pure perm
<*> fmap fromIntegral (peek givptrPtr)
<*> pure givcol
<*> pure givnum
<*> fmap fromIntegral (peek infoPtr)
laein ::
Bool ->
Bool ->
CArray (Int,Int) (Complex Float) ->
Complex Float ->
IOCArray Int (Complex Float) ->
Int ->
Float ->
Float ->
IO (CArray (Int,Int) (Complex Float), Int)
laein rightv noinit h w v ldb eps3 smlnum = do
let (hDim0,hDim1) = Call.sizes2 $ bounds h
vDim0 <- Call.sizes1 <$> getBounds v
let n = hDim0
let ldh = hDim1
Call.assert "laein: n == vDim0" (n == vDim0)
b <- Call.newArray2 n ldb
rwork <- Call.newArray1 n
evalContT $ do
rightvPtr <- Call.bool rightv
noinitPtr <- Call.bool noinit
nPtr <- Call.cint n
hPtr <- Call.array h
ldhPtr <- Call.cint ldh
wPtr <- Call.complexFloat w
vPtr <- Call.ioarray v
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
rworkPtr <- Call.array rwork
eps3Ptr <- Call.float eps3
smlnumPtr <- Call.float smlnum
infoPtr <- Call.alloca
liftIO $ Lapack.laein rightvPtr noinitPtr nPtr hPtr ldhPtr wPtr vPtr bPtr ldbPtr rworkPtr eps3Ptr smlnumPtr infoPtr
liftIO $ pure (,)
<*> pure b
<*> fmap fromIntegral (peek infoPtr)
laesy ::
Complex Float ->
Complex Float ->
Complex Float ->
IO (Complex Float, Complex Float, Complex Float, Complex Float, Complex Float)
laesy a b c = do
evalContT $ do
aPtr <- Call.complexFloat a
bPtr <- Call.complexFloat b
cPtr <- Call.complexFloat c
rt1Ptr <- Call.alloca
rt2Ptr <- Call.alloca
evscalPtr <- Call.alloca
cs1Ptr <- Call.alloca
sn1Ptr <- Call.alloca
liftIO $ Lapack.laesy aPtr bPtr cPtr rt1Ptr rt2Ptr evscalPtr cs1Ptr sn1Ptr
liftIO $ pure (,,,,)
<*> peek rt1Ptr
<*> peek rt2Ptr
<*> peek evscalPtr
<*> peek cs1Ptr
<*> peek sn1Ptr
laev2 ::
Complex Float ->
Complex Float ->
Complex Float ->
IO (Float, Float, Float, Complex Float)
laev2 a b c = do
evalContT $ do
aPtr <- Call.complexFloat a
bPtr <- Call.complexFloat b
cPtr <- Call.complexFloat c
rt1Ptr <- Call.alloca
rt2Ptr <- Call.alloca
cs1Ptr <- Call.alloca
sn1Ptr <- Call.alloca
liftIO $ Lapack.laev2 aPtr bPtr cPtr rt1Ptr rt2Ptr cs1Ptr sn1Ptr
liftIO $ pure (,,,)
<*> peek rt1Ptr
<*> peek rt2Ptr
<*> peek cs1Ptr
<*> peek sn1Ptr
lag2z ::
Int ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Double), Int)
lag2z m sa lda = do
let (saDim0,saDim1) = Call.sizes2 $ bounds sa
let n = saDim0
let ldsa = saDim1
a <- Call.newArray2 n lda
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
saPtr <- Call.array sa
ldsaPtr <- Call.cint ldsa
aPtr <- Call.array a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.lag2z mPtr nPtr saPtr ldsaPtr aPtr ldaPtr infoPtr
liftIO $ pure (,)
<*> pure a
<*> fmap fromIntegral (peek infoPtr)
lags2 ::
Bool ->
Float ->
Complex Float ->
Float ->
Float ->
Complex Float ->
Float ->
IO (Float, Complex Float, Float, Complex Float, Float, Complex Float)
lags2 upper a1 a2 a3 b1 b2 b3 = do
evalContT $ do
upperPtr <- Call.bool upper
a1Ptr <- Call.float a1
a2Ptr <- Call.complexFloat a2
a3Ptr <- Call.float a3
b1Ptr <- Call.float b1
b2Ptr <- Call.complexFloat b2
b3Ptr <- Call.float b3
csuPtr <- Call.alloca
snuPtr <- Call.alloca
csvPtr <- Call.alloca
snvPtr <- Call.alloca
csqPtr <- Call.alloca
snqPtr <- Call.alloca
liftIO $ Lapack.lags2 upperPtr a1Ptr a2Ptr a3Ptr b1Ptr b2Ptr b3Ptr csuPtr snuPtr csvPtr snvPtr csqPtr snqPtr
liftIO $ pure (,,,,,)
<*> peek csuPtr
<*> peek snuPtr
<*> peek csvPtr
<*> peek snvPtr
<*> peek csqPtr
<*> peek snqPtr
lagtm ::
Char ->
Float ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
Float ->
IOCArray (Int,Int) (Complex Float) ->
IO ()
lagtm trans alpha dl d du x beta b = do
let dlDim0 = Call.sizes1 $ bounds dl
let dDim0 = Call.sizes1 $ bounds d
let duDim0 = Call.sizes1 $ bounds du
let (xDim0,xDim1) = Call.sizes2 $ bounds x
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = dDim0
let nrhs = xDim0
let ldx = xDim1
let ldb = bDim1
Call.assert "lagtm: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "lagtm: n-1 == duDim0" (n1 == duDim0)
Call.assert "lagtm: nrhs == bDim0" (nrhs == bDim0)
evalContT $ do
transPtr <- Call.char trans
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
alphaPtr <- Call.float alpha
dlPtr <- Call.array dl
dPtr <- Call.array d
duPtr <- Call.array du
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
betaPtr <- Call.float beta
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
liftIO $ Lapack.lagtm transPtr nPtr nrhsPtr alphaPtr dlPtr dPtr duPtr xPtr ldxPtr betaPtr bPtr ldbPtr
lahef ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int, CArray Int CInt, CArray (Int,Int) (Complex Float), Int)
lahef uplo nb a ldw = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 n
w <- Call.newArray2 nb ldw
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nbPtr <- Call.cint nb
kbPtr <- Call.alloca
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
wPtr <- Call.array w
ldwPtr <- Call.cint ldw
infoPtr <- Call.alloca
liftIO $ Lapack.lahef uploPtr nPtr nbPtr kbPtr aPtr ldaPtr ipivPtr wPtr ldwPtr infoPtr
liftIO $ pure (,,,)
<*> fmap fromIntegral (peek kbPtr)
<*> pure ipiv
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
lahqr ::
Bool ->
Bool ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
lahqr wantt wantz ilo ihi h iloz ihiz z = do
(hDim0,hDim1) <- Call.sizes2 <$> getBounds h
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = hDim0
let ldh = hDim1
let ldz = zDim1
Call.assert "lahqr: n == zDim0" (n == zDim0)
w <- Call.newArray1 n
evalContT $ do
wanttPtr <- Call.bool wantt
wantzPtr <- Call.bool wantz
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
hPtr <- Call.ioarray h
ldhPtr <- Call.cint ldh
wPtr <- Call.array w
ilozPtr <- Call.cint iloz
ihizPtr <- Call.cint ihiz
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
infoPtr <- Call.alloca
liftIO $ Lapack.lahqr wanttPtr wantzPtr nPtr iloPtr ihiPtr hPtr ldhPtr wPtr ilozPtr ihizPtr zPtr ldzPtr infoPtr
liftIO $ pure (,)
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
lahr2 ::
Int ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float))
lahr2 n k nb a ldt ldy = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let lda = aDim1
Call.assert "lahr2: n-k+1 == aDim0" (nk+1 == aDim0)
tau <- Call.newArray1 nb
t <- Call.newArray2 nb ldt
y <- Call.newArray2 nb ldy
evalContT $ do
nPtr <- Call.cint n
kPtr <- Call.cint k
nbPtr <- Call.cint nb
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
tPtr <- Call.array t
ldtPtr <- Call.cint ldt
yPtr <- Call.array y
ldyPtr <- Call.cint ldy
liftIO $ Lapack.lahr2 nPtr kPtr nbPtr aPtr ldaPtr tauPtr tPtr ldtPtr yPtr ldyPtr
liftIO $ pure (,,)
<*> pure tau
<*> pure t
<*> pure y
laic1 ::
Int ->
CArray Int (Complex Float) ->
Float ->
CArray Int (Complex Float) ->
Complex Float ->
IO (Float, Complex Float, Complex Float)
laic1 job x sest w gamma = do
let xDim0 = Call.sizes1 $ bounds x
let wDim0 = Call.sizes1 $ bounds w
let j = xDim0
Call.assert "laic1: j == wDim0" (j == wDim0)
evalContT $ do
jobPtr <- Call.cint job
jPtr <- Call.cint j
xPtr <- Call.array x
sestPtr <- Call.float sest
wPtr <- Call.array w
gammaPtr <- Call.complexFloat gamma
sestprPtr <- Call.alloca
sPtr <- Call.alloca
cPtr <- Call.alloca
liftIO $ Lapack.laic1 jobPtr jPtr xPtr sestPtr wPtr gammaPtr sestprPtr sPtr cPtr
liftIO $ pure (,,)
<*> peek sestprPtr
<*> peek sPtr
<*> peek cPtr
lals0 ::
Int ->
Int ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
CArray Int CInt ->
Int ->
CArray (Int,Int) CInt ->
CArray (Int,Int) Float ->
CArray (Int,Int) Float ->
CArray Int Float ->
CArray (Int,Int) Float ->
CArray Int Float ->
Float ->
Float ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int)
lals0 icompq nl nr sqre b ldbx perm givptr givcol givnum poles difl difr z c s rworkSize = do
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let permDim0 = Call.sizes1 $ bounds perm
let (givcolDim0,givcolDim1) = Call.sizes2 $ bounds givcol
let (givnumDim0,givnumDim1) = Call.sizes2 $ bounds givnum
let (polesDim0,polesDim1) = Call.sizes2 $ bounds poles
let diflDim0 = Call.sizes1 $ bounds difl
let (difrDim0,difrDim1) = Call.sizes2 $ bounds difr
let zDim0 = Call.sizes1 $ bounds z
let nrhs = bDim0
let ldb = bDim1
let _n = permDim0
let ldgcol = givcolDim1
let ldgnum = givnumDim1
let k = diflDim0
Call.assert "lals0: 2 == givcolDim0" (2 == givcolDim0)
Call.assert "lals0: 2 == givnumDim0" (2 == givnumDim0)
Call.assert "lals0: 2 == polesDim0" (2 == polesDim0)
Call.assert "lals0: ldgnum == polesDim1" (ldgnum == polesDim1)
Call.assert "lals0: 2 == difrDim0" (2 == difrDim0)
Call.assert "lals0: ldgnum == difrDim1" (ldgnum == difrDim1)
Call.assert "lals0: k == zDim0" (k == zDim0)
bx <- Call.newArray2 nrhs ldbx
rwork <- Call.newArray1 rworkSize
evalContT $ do
icompqPtr <- Call.cint icompq
nlPtr <- Call.cint nl
nrPtr <- Call.cint nr
sqrePtr <- Call.cint sqre
nrhsPtr <- Call.cint nrhs
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
bxPtr <- Call.array bx
ldbxPtr <- Call.cint ldbx
permPtr <- Call.array perm
givptrPtr <- Call.cint givptr
givcolPtr <- Call.array givcol
ldgcolPtr <- Call.cint ldgcol
givnumPtr <- Call.array givnum
ldgnumPtr <- Call.cint ldgnum
polesPtr <- Call.array poles
diflPtr <- Call.array difl
difrPtr <- Call.array difr
zPtr <- Call.array z
kPtr <- Call.cint k
cPtr <- Call.float c
sPtr <- Call.float s
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.lals0 icompqPtr nlPtr nrPtr sqrePtr nrhsPtr bPtr ldbPtr bxPtr ldbxPtr permPtr givptrPtr givcolPtr ldgcolPtr givnumPtr ldgnumPtr polesPtr diflPtr difrPtr zPtr kPtr cPtr sPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> pure bx
<*> fmap fromIntegral (peek infoPtr)
lalsa ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
CArray (Int,Int) Float ->
CArray (Int,Int) Float ->
CArray Int CInt ->
CArray (Int,Int) Float ->
CArray (Int,Int) Float ->
CArray (Int,Int) Float ->
CArray (Int,Int) Float ->
CArray Int CInt ->
CArray (Int,Int) CInt ->
CArray (Int,Int) CInt ->
CArray (Int,Int) Float ->
CArray Int Float ->
CArray Int Float ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int)
lalsa icompq b ldbx u vt k difl difr z poles givptr givcol perm givnum c s rworkSize = do
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let (uDim0,uDim1) = Call.sizes2 $ bounds u
let (vtDim0,vtDim1) = Call.sizes2 $ bounds vt
let kDim0 = Call.sizes1 $ bounds k
let (diflDim0,diflDim1) = Call.sizes2 $ bounds difl
let (difrDim0,difrDim1) = Call.sizes2 $ bounds difr
let (zDim0,zDim1) = Call.sizes2 $ bounds z
let (polesDim0,polesDim1) = Call.sizes2 $ bounds poles
let givptrDim0 = Call.sizes1 $ bounds givptr
let (givcolDim0,givcolDim1) = Call.sizes2 $ bounds givcol
let (permDim0,permDim1) = Call.sizes2 $ bounds perm
let (givnumDim0,givnumDim1) = Call.sizes2 $ bounds givnum
let cDim0 = Call.sizes1 $ bounds c
let sDim0 = Call.sizes1 $ bounds s
let nrhs = bDim0
let ldb = bDim1
let smlsiz = uDim0
let ldu = uDim1
let n = kDim0
let nlvl = diflDim0
let ldgcol = givcolDim1
Call.assert "lalsa: smlsiz+1 == vtDim0" (smlsiz+1 == vtDim0)
Call.assert "lalsa: ldu == vtDim1" (ldu == vtDim1)
Call.assert "lalsa: ldu == diflDim1" (ldu == diflDim1)
Call.assert "lalsa: 2*nlvl == difrDim0" (2*nlvl == difrDim0)
Call.assert "lalsa: ldu == difrDim1" (ldu == difrDim1)
Call.assert "lalsa: nlvl == zDim0" (nlvl == zDim0)
Call.assert "lalsa: ldu == zDim1" (ldu == zDim1)
Call.assert "lalsa: 2*nlvl == polesDim0" (2*nlvl == polesDim0)
Call.assert "lalsa: ldu == polesDim1" (ldu == polesDim1)
Call.assert "lalsa: n == givptrDim0" (n == givptrDim0)
Call.assert "lalsa: 2*nlvl == givcolDim0" (2*nlvl == givcolDim0)
Call.assert "lalsa: nlvl == permDim0" (nlvl == permDim0)
Call.assert "lalsa: ldgcol == permDim1" (ldgcol == permDim1)
Call.assert "lalsa: 2*nlvl == givnumDim0" (2*nlvl == givnumDim0)
Call.assert "lalsa: ldu == givnumDim1" (ldu == givnumDim1)
Call.assert "lalsa: n == cDim0" (n == cDim0)
Call.assert "lalsa: n == sDim0" (n == sDim0)
bx <- Call.newArray2 nrhs ldbx
rwork <- Call.newArray1 rworkSize
iwork <- Call.newArray1 (3*n)
evalContT $ do
icompqPtr <- Call.cint icompq
smlsizPtr <- Call.cint smlsiz
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
bxPtr <- Call.array bx
ldbxPtr <- Call.cint ldbx
uPtr <- Call.array u
lduPtr <- Call.cint ldu
vtPtr <- Call.array vt
kPtr <- Call.array k
diflPtr <- Call.array difl
difrPtr <- Call.array difr
zPtr <- Call.array z
polesPtr <- Call.array poles
givptrPtr <- Call.array givptr
givcolPtr <- Call.array givcol
ldgcolPtr <- Call.cint ldgcol
permPtr <- Call.array perm
givnumPtr <- Call.array givnum
cPtr <- Call.array c
sPtr <- Call.array s
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.lalsa icompqPtr smlsizPtr nPtr nrhsPtr bPtr ldbPtr bxPtr ldbxPtr uPtr lduPtr vtPtr kPtr diflPtr difrPtr zPtr polesPtr givptrPtr givcolPtr ldgcolPtr permPtr givnumPtr cPtr sPtr rworkPtr iworkPtr infoPtr
liftIO $ pure (,)
<*> pure bx
<*> fmap fromIntegral (peek infoPtr)
lalsd ::
Char ->
Int ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Int ->
Int ->
IO (Int, Int)
lalsd uplo smlsiz d e b rcond rworkSize nlvl = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "lalsd: n-1 == eDim0" (n1 == eDim0)
work <- Call.newArray1 (n*nrhs)
rwork <- Call.newArray1 rworkSize
iwork <- Call.newArray1 (3*n*nlvl+11*n)
evalContT $ do
uploPtr <- Call.char uplo
smlsizPtr <- Call.cint smlsiz
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
rcondPtr <- Call.float rcond
rankPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.lalsd uploPtr smlsizPtr nPtr nrhsPtr dPtr ePtr bPtr ldbPtr rcondPtr rankPtr workPtr rworkPtr iworkPtr infoPtr
liftIO $ pure (,)
<*> fmap fromIntegral (peek rankPtr)
<*> fmap fromIntegral (peek infoPtr)
langb ::
Char ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
langb norm kl ku ab lwork = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
workPtr <- Call.array work
liftIO $ Lapack.langb normPtr nPtr klPtr kuPtr abPtr ldabPtr workPtr
lange ::
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
lange norm m a lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
workPtr <- Call.array work
liftIO $ Lapack.lange normPtr mPtr nPtr aPtr ldaPtr workPtr
langt ::
Char ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
IO Float
langt norm dl d du = do
let dlDim0 = Call.sizes1 $ bounds dl
let dDim0 = Call.sizes1 $ bounds d
let duDim0 = Call.sizes1 $ bounds du
let n = dDim0
Call.assert "langt: n-1 == dlDim0" (n1 == dlDim0)
Call.assert "langt: n-1 == duDim0" (n1 == duDim0)
evalContT $ do
normPtr <- Call.char norm
nPtr <- Call.cint n
dlPtr <- Call.array dl
dPtr <- Call.array d
duPtr <- Call.array du
liftIO $ Lapack.langt normPtr nPtr dlPtr dPtr duPtr
lanhb ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
lanhb norm uplo k ab lwork = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kPtr <- Call.cint k
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
workPtr <- Call.array work
liftIO $ Lapack.lanhb normPtr uploPtr nPtr kPtr abPtr ldabPtr workPtr
lanhe ::
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
lanhe norm uplo a lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
workPtr <- Call.array work
liftIO $ Lapack.lanhe normPtr uploPtr nPtr aPtr ldaPtr workPtr
lanhf ::
Char ->
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
Int ->
IO Float
lanhf norm transr uplo n a lwork = do
let aDim0 = Call.sizes1 $ bounds a
Call.assert "lanhf: n*(n+1)`div`2 == aDim0" (n*(n+1)`div`2 == aDim0)
work <- Call.newArray1 lwork
evalContT $ do
normPtr <- Call.char norm
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
workPtr <- Call.array work
liftIO $ Lapack.lanhf normPtr transrPtr uploPtr nPtr aPtr workPtr
lanhp ::
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
Int ->
IO Float
lanhp norm uplo n ap lwork = do
let apDim0 = Call.sizes1 $ bounds ap
Call.assert "lanhp: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
workPtr <- Call.array work
liftIO $ Lapack.lanhp normPtr uploPtr nPtr apPtr workPtr
lanhs ::
Char ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
lanhs norm a lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
workPtr <- Call.array work
liftIO $ Lapack.lanhs normPtr nPtr aPtr ldaPtr workPtr
lanht ::
Char ->
CArray Int Float ->
CArray Int (Complex Float) ->
IO Float
lanht norm d e = do
let dDim0 = Call.sizes1 $ bounds d
let eDim0 = Call.sizes1 $ bounds e
let n = dDim0
Call.assert "lanht: n-1 == eDim0" (n1 == eDim0)
evalContT $ do
normPtr <- Call.char norm
nPtr <- Call.cint n
dPtr <- Call.array d
ePtr <- Call.array e
liftIO $ Lapack.lanht normPtr nPtr dPtr ePtr
lansb ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
lansb norm uplo k ab lwork = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kPtr <- Call.cint k
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
workPtr <- Call.array work
liftIO $ Lapack.lansb normPtr uploPtr nPtr kPtr abPtr ldabPtr workPtr
lansp ::
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
Int ->
IO Float
lansp norm uplo n ap lwork = do
let apDim0 = Call.sizes1 $ bounds ap
Call.assert "lansp: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
workPtr <- Call.array work
liftIO $ Lapack.lansp normPtr uploPtr nPtr apPtr workPtr
lansy ::
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
lansy norm uplo a lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
workPtr <- Call.array work
liftIO $ Lapack.lansy normPtr uploPtr nPtr aPtr ldaPtr workPtr
lantb ::
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
lantb norm uplo diag k ab lwork = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
kPtr <- Call.cint k
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
workPtr <- Call.array work
liftIO $ Lapack.lantb normPtr uploPtr diagPtr nPtr kPtr abPtr ldabPtr workPtr
lantp ::
Char ->
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
Int ->
IO Float
lantp norm uplo diag n ap lwork = do
let apDim0 = Call.sizes1 $ bounds ap
Call.assert "lantp: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
apPtr <- Call.array ap
workPtr <- Call.array work
liftIO $ Lapack.lantp normPtr uploPtr diagPtr nPtr apPtr workPtr
lantr ::
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO Float
lantr norm uplo diag m a lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
workPtr <- Call.array work
liftIO $ Lapack.lantr normPtr uploPtr diagPtr mPtr nPtr aPtr ldaPtr workPtr
lapll ::
Int ->
IOCArray Int (Complex Float) ->
Int ->
IOCArray Int (Complex Float) ->
Int ->
IO (Float)
lapll n x incx y incy = do
xDim0 <- Call.sizes1 <$> getBounds x
yDim0 <- Call.sizes1 <$> getBounds y
Call.assert "lapll: 1+(n-1)*incx == xDim0" (1+(n1)*incx == xDim0)
Call.assert "lapll: 1+(n-1)*incy == yDim0" (1+(n1)*incy == yDim0)
evalContT $ do
nPtr <- Call.cint n
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
ssminPtr <- Call.alloca
liftIO $ Lapack.lapll nPtr xPtr incxPtr yPtr incyPtr ssminPtr
liftIO $ peek ssminPtr
lapmr ::
Bool ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
IO ()
lapmr forwrd x k = do
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
kDim0 <- Call.sizes1 <$> getBounds k
let n = xDim0
let ldx = xDim1
let m = kDim0
evalContT $ do
forwrdPtr <- Call.bool forwrd
mPtr <- Call.cint m
nPtr <- Call.cint n
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
kPtr <- Call.ioarray k
liftIO $ Lapack.lapmr forwrdPtr mPtr nPtr xPtr ldxPtr kPtr
lapmt ::
Bool ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
IO ()
lapmt forwrd m x k = do
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
kDim0 <- Call.sizes1 <$> getBounds k
let n = xDim0
let ldx = xDim1
Call.assert "lapmt: n == kDim0" (n == kDim0)
evalContT $ do
forwrdPtr <- Call.bool forwrd
mPtr <- Call.cint m
nPtr <- Call.cint n
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
kPtr <- Call.ioarray k
liftIO $ Lapack.lapmt forwrdPtr mPtr nPtr xPtr ldxPtr kPtr
laqgb ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int Float ->
CArray Int Float ->
Float ->
Float ->
Float ->
IO (Char)
laqgb kl ku ab r c rowcnd colcnd amax = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let rDim0 = Call.sizes1 $ bounds r
let cDim0 = Call.sizes1 $ bounds c
let n = abDim0
let ldab = abDim1
let m = rDim0
Call.assert "laqgb: n == cDim0" (n == cDim0)
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
rPtr <- Call.array r
cPtr <- Call.array c
rowcndPtr <- Call.float rowcnd
colcndPtr <- Call.float colcnd
amaxPtr <- Call.float amax
equedPtr <- Call.alloca
liftIO $ Lapack.laqgb mPtr nPtr klPtr kuPtr abPtr ldabPtr rPtr cPtr rowcndPtr colcndPtr amaxPtr equedPtr
liftIO $ fmap castCCharToChar (peek equedPtr)
laqge ::
IOCArray (Int,Int) (Complex Float) ->
CArray Int Float ->
CArray Int Float ->
Float ->
Float ->
Float ->
IO (Char)
laqge a r c rowcnd colcnd amax = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let rDim0 = Call.sizes1 $ bounds r
let cDim0 = Call.sizes1 $ bounds c
let n = aDim0
let lda = aDim1
let m = rDim0
Call.assert "laqge: n == cDim0" (n == cDim0)
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
rPtr <- Call.array r
cPtr <- Call.array c
rowcndPtr <- Call.float rowcnd
colcndPtr <- Call.float colcnd
amaxPtr <- Call.float amax
equedPtr <- Call.alloca
liftIO $ Lapack.laqge mPtr nPtr aPtr ldaPtr rPtr cPtr rowcndPtr colcndPtr amaxPtr equedPtr
liftIO $ fmap castCCharToChar (peek equedPtr)
laqhb ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Float ->
IO (CArray Int Float, Char)
laqhb uplo kd ab scond amax = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
s <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
sPtr <- Call.array s
scondPtr <- Call.float scond
amaxPtr <- Call.float amax
equedPtr <- Call.alloca
liftIO $ Lapack.laqhb uploPtr nPtr kdPtr abPtr ldabPtr sPtr scondPtr amaxPtr equedPtr
liftIO $ pure (,)
<*> pure s
<*> fmap castCCharToChar (peek equedPtr)
laqhe ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int Float ->
Float ->
Float ->
IO (Char)
laqhe uplo a s scond amax = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let sDim0 = Call.sizes1 $ bounds s
let n = aDim0
let lda = aDim1
Call.assert "laqhe: n == sDim0" (n == sDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
sPtr <- Call.array s
scondPtr <- Call.float scond
amaxPtr <- Call.float amax
equedPtr <- Call.alloca
liftIO $ Lapack.laqhe uploPtr nPtr aPtr ldaPtr sPtr scondPtr amaxPtr equedPtr
liftIO $ fmap castCCharToChar (peek equedPtr)
laqhp ::
Char ->
IOCArray Int (Complex Float) ->
CArray Int Float ->
Float ->
Float ->
IO (Char)
laqhp uplo ap s scond amax = do
apDim0 <- Call.sizes1 <$> getBounds ap
let sDim0 = Call.sizes1 $ bounds s
let n = sDim0
Call.assert "laqhp: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
sPtr <- Call.array s
scondPtr <- Call.float scond
amaxPtr <- Call.float amax
equedPtr <- Call.alloca
liftIO $ Lapack.laqhp uploPtr nPtr apPtr sPtr scondPtr amaxPtr equedPtr
liftIO $ fmap castCCharToChar (peek equedPtr)
laqp2 ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
IOCArray Int Float ->
IOCArray Int Float ->
IO (CArray Int (Complex Float))
laqp2 m offset a jpvt vn1 vn2 = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
jpvtDim0 <- Call.sizes1 <$> getBounds jpvt
vn1Dim0 <- Call.sizes1 <$> getBounds vn1
vn2Dim0 <- Call.sizes1 <$> getBounds vn2
let n = aDim0
let lda = aDim1
Call.assert "laqp2: n == jpvtDim0" (n == jpvtDim0)
Call.assert "laqp2: n == vn1Dim0" (n == vn1Dim0)
Call.assert "laqp2: n == vn2Dim0" (n == vn2Dim0)
tau <- Call.newArray1 (minimum[m,n])
work <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
offsetPtr <- Call.cint offset
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
jpvtPtr <- Call.ioarray jpvt
tauPtr <- Call.array tau
vn1Ptr <- Call.ioarray vn1
vn2Ptr <- Call.ioarray vn2
workPtr <- Call.array work
liftIO $ Lapack.laqp2 mPtr nPtr offsetPtr aPtr ldaPtr jpvtPtr tauPtr vn1Ptr vn2Ptr workPtr
liftIO $ pure tau
laqps ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
Int ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int, CArray Int (Complex Float))
laqps m offset a jpvt kb vn1 vn2 auxv f = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
jpvtDim0 <- Call.sizes1 <$> getBounds jpvt
vn1Dim0 <- Call.sizes1 <$> getBounds vn1
vn2Dim0 <- Call.sizes1 <$> getBounds vn2
auxvDim0 <- Call.sizes1 <$> getBounds auxv
(fDim0,fDim1) <- Call.sizes2 <$> getBounds f
let n = aDim0
let lda = aDim1
let nb = auxvDim0
let ldf = fDim1
Call.assert "laqps: n == jpvtDim0" (n == jpvtDim0)
Call.assert "laqps: n == vn1Dim0" (n == vn1Dim0)
Call.assert "laqps: n == vn2Dim0" (n == vn2Dim0)
Call.assert "laqps: nb == fDim0" (nb == fDim0)
tau <- Call.newArray1 kb
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
offsetPtr <- Call.cint offset
nbPtr <- Call.cint nb
kbPtr <- Call.alloca
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
jpvtPtr <- Call.ioarray jpvt
tauPtr <- Call.array tau
vn1Ptr <- Call.ioarray vn1
vn2Ptr <- Call.ioarray vn2
auxvPtr <- Call.ioarray auxv
fPtr <- Call.ioarray f
ldfPtr <- Call.cint ldf
liftIO $ Lapack.laqps mPtr nPtr offsetPtr nbPtr kbPtr aPtr ldaPtr jpvtPtr tauPtr vn1Ptr vn2Ptr auxvPtr fPtr ldfPtr
liftIO $ pure (,)
<*> fmap fromIntegral (peek kbPtr)
<*> pure tau
laqr0 ::
Bool ->
Bool ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray Int (Complex Float), Int)
laqr0 wantt wantz ilo h iloz ihiz z workSize lwork = do
(hDim0,hDim1) <- Call.sizes2 <$> getBounds h
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = hDim0
let ldh = hDim1
let ihi = zDim0
let ldz = zDim1
w <- Call.newArray1 n
work <- Call.newArray1 workSize
evalContT $ do
wanttPtr <- Call.bool wantt
wantzPtr <- Call.bool wantz
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
hPtr <- Call.ioarray h
ldhPtr <- Call.cint ldh
wPtr <- Call.array w
ilozPtr <- Call.cint iloz
ihizPtr <- Call.cint ihiz
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.laqr0 wanttPtr wantzPtr nPtr iloPtr ihiPtr hPtr ldhPtr wPtr ilozPtr ihizPtr zPtr ldzPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
laqr1 ::
CArray (Int,Int) (Complex Float) ->
Complex Float ->
Complex Float ->
IO (CArray Int (Complex Float))
laqr1 h s1 s2 = do
let (hDim0,hDim1) = Call.sizes2 $ bounds h
let n = hDim0
let ldh = hDim1
v <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
hPtr <- Call.array h
ldhPtr <- Call.cint ldh
s1Ptr <- Call.complexFloat s1
s2Ptr <- Call.complexFloat s2
vPtr <- Call.array v
liftIO $ Lapack.laqr1 nPtr hPtr ldhPtr s1Ptr s2Ptr vPtr
liftIO $ pure v
laqr2 ::
Bool ->
Bool ->
Int ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
Int ->
Int ->
IO (Int, Int, CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float))
laqr2 wantt wantz ktop kbot nw h iloz ihiz z ldv nh ldt nv ldwv lwork = do
(hDim0,hDim1) <- Call.sizes2 <$> getBounds h
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = hDim0
let ldh = hDim1
let ldz = zDim1
Call.assert "laqr2: n == zDim0" (n == zDim0)
sh <- Call.newArray1 kbot
v <- Call.newArray2 nw ldv
t <- Call.newArray2 nw ldt
wv <- Call.newArray2 nw ldwv
work <- Call.newArray1 lwork
evalContT $ do
wanttPtr <- Call.bool wantt
wantzPtr <- Call.bool wantz
nPtr <- Call.cint n
ktopPtr <- Call.cint ktop
kbotPtr <- Call.cint kbot
nwPtr <- Call.cint nw
hPtr <- Call.ioarray h
ldhPtr <- Call.cint ldh
ilozPtr <- Call.cint iloz
ihizPtr <- Call.cint ihiz
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
nsPtr <- Call.alloca
ndPtr <- Call.alloca
shPtr <- Call.array sh
vPtr <- Call.array v
ldvPtr <- Call.cint ldv
nhPtr <- Call.cint nh
tPtr <- Call.array t
ldtPtr <- Call.cint ldt
nvPtr <- Call.cint nv
wvPtr <- Call.array wv
ldwvPtr <- Call.cint ldwv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
liftIO $ Lapack.laqr2 wanttPtr wantzPtr nPtr ktopPtr kbotPtr nwPtr hPtr ldhPtr ilozPtr ihizPtr zPtr ldzPtr nsPtr ndPtr shPtr vPtr ldvPtr nhPtr tPtr ldtPtr nvPtr wvPtr ldwvPtr workPtr lworkPtr
liftIO $ pure (,,,,,)
<*> fmap fromIntegral (peek nsPtr)
<*> fmap fromIntegral (peek ndPtr)
<*> pure sh
<*> pure v
<*> pure t
<*> pure wv
laqr3 ::
Bool ->
Bool ->
Int ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
Int ->
Int ->
IO (Int, Int, CArray Int (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float))
laqr3 wantt wantz ktop kbot nw h iloz ihiz z ldv nh ldt nv ldwv lwork = do
(hDim0,hDim1) <- Call.sizes2 <$> getBounds h
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = hDim0
let ldh = hDim1
let ldz = zDim1
Call.assert "laqr3: n == zDim0" (n == zDim0)
sh <- Call.newArray1 kbot
v <- Call.newArray2 nw ldv
t <- Call.newArray2 nw ldt
wv <- Call.newArray2 nw ldwv
work <- Call.newArray1 lwork
evalContT $ do
wanttPtr <- Call.bool wantt
wantzPtr <- Call.bool wantz
nPtr <- Call.cint n
ktopPtr <- Call.cint ktop
kbotPtr <- Call.cint kbot
nwPtr <- Call.cint nw
hPtr <- Call.ioarray h
ldhPtr <- Call.cint ldh
ilozPtr <- Call.cint iloz
ihizPtr <- Call.cint ihiz
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
nsPtr <- Call.alloca
ndPtr <- Call.alloca
shPtr <- Call.array sh
vPtr <- Call.array v
ldvPtr <- Call.cint ldv
nhPtr <- Call.cint nh
tPtr <- Call.array t
ldtPtr <- Call.cint ldt
nvPtr <- Call.cint nv
wvPtr <- Call.array wv
ldwvPtr <- Call.cint ldwv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
liftIO $ Lapack.laqr3 wanttPtr wantzPtr nPtr ktopPtr kbotPtr nwPtr hPtr ldhPtr ilozPtr ihizPtr zPtr ldzPtr nsPtr ndPtr shPtr vPtr ldvPtr nhPtr tPtr ldtPtr nvPtr wvPtr ldwvPtr workPtr lworkPtr
liftIO $ pure (,,,,,)
<*> fmap fromIntegral (peek nsPtr)
<*> fmap fromIntegral (peek ndPtr)
<*> pure sh
<*> pure v
<*> pure t
<*> pure wv
laqr4 ::
Bool ->
Bool ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray Int (Complex Float), Int)
laqr4 wantt wantz ilo h iloz ihiz z workSize lwork = do
(hDim0,hDim1) <- Call.sizes2 <$> getBounds h
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = hDim0
let ldh = hDim1
let ihi = zDim0
let ldz = zDim1
w <- Call.newArray1 n
work <- Call.newArray1 workSize
evalContT $ do
wanttPtr <- Call.bool wantt
wantzPtr <- Call.bool wantz
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
hPtr <- Call.ioarray h
ldhPtr <- Call.cint ldh
wPtr <- Call.array w
ilozPtr <- Call.cint iloz
ihizPtr <- Call.cint ihiz
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.laqr4 wanttPtr wantzPtr nPtr iloPtr ihiPtr hPtr ldhPtr wPtr ilozPtr ihizPtr zPtr ldzPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
laqr5 ::
Bool ->
Bool ->
Int ->
Int ->
Int ->
IOCArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
Int ->
Int ->
IO (CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float))
laqr5 wantt wantz kacc22 ktop kbot s h iloz z ldv ldu nv ldwv nh ldwh = do
sDim0 <- Call.sizes1 <$> getBounds s
(hDim0,hDim1) <- Call.sizes2 <$> getBounds h
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let nshfts = sDim0
let n = hDim0
let ldh = hDim1
let ihiz = zDim0
let ldz = zDim1
v <- Call.newArray2 (nshfts`div`2) ldv
u <- Call.newArray2 (3*nshfts3) ldu
wv <- Call.newArray2 (3*nshfts3) ldwv
wh <- Call.newArray2 nh ldwh
evalContT $ do
wanttPtr <- Call.bool wantt
wantzPtr <- Call.bool wantz
kacc22Ptr <- Call.cint kacc22
nPtr <- Call.cint n
ktopPtr <- Call.cint ktop
kbotPtr <- Call.cint kbot
nshftsPtr <- Call.cint nshfts
sPtr <- Call.ioarray s
hPtr <- Call.ioarray h
ldhPtr <- Call.cint ldh
ilozPtr <- Call.cint iloz
ihizPtr <- Call.cint ihiz
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
vPtr <- Call.array v
ldvPtr <- Call.cint ldv
uPtr <- Call.array u
lduPtr <- Call.cint ldu
nvPtr <- Call.cint nv
wvPtr <- Call.array wv
ldwvPtr <- Call.cint ldwv
nhPtr <- Call.cint nh
whPtr <- Call.array wh
ldwhPtr <- Call.cint ldwh
liftIO $ Lapack.laqr5 wanttPtr wantzPtr kacc22Ptr nPtr ktopPtr kbotPtr nshftsPtr sPtr hPtr ldhPtr ilozPtr ihizPtr zPtr ldzPtr vPtr ldvPtr uPtr lduPtr nvPtr wvPtr ldwvPtr nhPtr whPtr ldwhPtr
liftIO $ pure (,,,)
<*> pure v
<*> pure u
<*> pure wv
<*> pure wh
laqsb ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int Float ->
Float ->
Float ->
IO (Char)
laqsb uplo kd ab s scond amax = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let sDim0 = Call.sizes1 $ bounds s
let n = abDim0
let ldab = abDim1
Call.assert "laqsb: n == sDim0" (n == sDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
sPtr <- Call.array s
scondPtr <- Call.float scond
amaxPtr <- Call.float amax
equedPtr <- Call.alloca
liftIO $ Lapack.laqsb uploPtr nPtr kdPtr abPtr ldabPtr sPtr scondPtr amaxPtr equedPtr
liftIO $ fmap castCCharToChar (peek equedPtr)
laqsp ::
Char ->
IOCArray Int (Complex Float) ->
CArray Int Float ->
Float ->
Float ->
IO (Char)
laqsp uplo ap s scond amax = do
apDim0 <- Call.sizes1 <$> getBounds ap
let sDim0 = Call.sizes1 $ bounds s
let n = sDim0
Call.assert "laqsp: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
sPtr <- Call.array s
scondPtr <- Call.float scond
amaxPtr <- Call.float amax
equedPtr <- Call.alloca
liftIO $ Lapack.laqsp uploPtr nPtr apPtr sPtr scondPtr amaxPtr equedPtr
liftIO $ fmap castCCharToChar (peek equedPtr)
laqsy ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int Float ->
Float ->
Float ->
IO (Char)
laqsy uplo a s scond amax = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let sDim0 = Call.sizes1 $ bounds s
let n = aDim0
let lda = aDim1
Call.assert "laqsy: n == sDim0" (n == sDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
sPtr <- Call.array s
scondPtr <- Call.float scond
amaxPtr <- Call.float amax
equedPtr <- Call.alloca
liftIO $ Lapack.laqsy uploPtr nPtr aPtr ldaPtr sPtr scondPtr amaxPtr equedPtr
liftIO $ fmap castCCharToChar (peek equedPtr)
lar1v ::
Int ->
Int ->
Float ->
CArray Int Float ->
CArray Int Float ->
CArray Int Float ->
CArray Int Float ->
Float ->
Float ->
IOCArray Int (Complex Float) ->
Bool ->
Int ->
IO (Int, Float, Float, Int, CArray Int CInt, Float, Float, Float)
lar1v b1 bn lambda d l ld lld pivmin gaptol z wantnc r = do
let dDim0 = Call.sizes1 $ bounds d
let lDim0 = Call.sizes1 $ bounds l
let ldDim0 = Call.sizes1 $ bounds ld
let lldDim0 = Call.sizes1 $ bounds lld
zDim0 <- Call.sizes1 <$> getBounds z
let n = dDim0
Call.assert "lar1v: n-1 == lDim0" (n1 == lDim0)
Call.assert "lar1v: n-1 == ldDim0" (n1 == ldDim0)
Call.assert "lar1v: n-1 == lldDim0" (n1 == lldDim0)
Call.assert "lar1v: n == zDim0" (n == zDim0)
isuppz <- Call.newArray1 2
work <- Call.newArray1 (4*n)
evalContT $ do
nPtr <- Call.cint n
b1Ptr <- Call.cint b1
bnPtr <- Call.cint bn
lambdaPtr <- Call.float lambda
dPtr <- Call.array d
lPtr <- Call.array l
ldPtr <- Call.array ld
lldPtr <- Call.array lld
pivminPtr <- Call.float pivmin
gaptolPtr <- Call.float gaptol
zPtr <- Call.ioarray z
wantncPtr <- Call.bool wantnc
negcntPtr <- Call.alloca
ztzPtr <- Call.alloca
mingmaPtr <- Call.alloca
rPtr <- Call.cint r
isuppzPtr <- Call.array isuppz
nrminvPtr <- Call.alloca
residPtr <- Call.alloca
rqcorrPtr <- Call.alloca
workPtr <- Call.array work
liftIO $ Lapack.lar1v nPtr b1Ptr bnPtr lambdaPtr dPtr lPtr ldPtr lldPtr pivminPtr gaptolPtr zPtr wantncPtr negcntPtr ztzPtr mingmaPtr rPtr isuppzPtr nrminvPtr residPtr rqcorrPtr workPtr
liftIO $ pure (,,,,,,,)
<*> fmap fromIntegral (peek negcntPtr)
<*> peek ztzPtr
<*> peek mingmaPtr
<*> fmap fromIntegral (peek rPtr)
<*> pure isuppz
<*> peek nrminvPtr
<*> peek residPtr
<*> peek rqcorrPtr
lar2v ::
Int ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
Int ->
CArray Int Float ->
CArray Int (Complex Float) ->
Int ->
IO ()
lar2v n x y z incx c s incc = do
xDim0 <- Call.sizes1 <$> getBounds x
yDim0 <- Call.sizes1 <$> getBounds y
zDim0 <- Call.sizes1 <$> getBounds z
let cDim0 = Call.sizes1 $ bounds c
let sDim0 = Call.sizes1 $ bounds s
Call.assert "lar2v: 1+(n-1)*incx == xDim0" (1+(n1)*incx == xDim0)
Call.assert "lar2v: 1+(n-1)*incx == yDim0" (1+(n1)*incx == yDim0)
Call.assert "lar2v: 1+(n-1)*incx == zDim0" (1+(n1)*incx == zDim0)
Call.assert "lar2v: 1+(n-1)*incc == cDim0" (1+(n1)*incc == cDim0)
Call.assert "lar2v: 1+(n-1)*incc == sDim0" (1+(n1)*incc == sDim0)
evalContT $ do
nPtr <- Call.cint n
xPtr <- Call.ioarray x
yPtr <- Call.ioarray y
zPtr <- Call.ioarray z
incxPtr <- Call.cint incx
cPtr <- Call.array c
sPtr <- Call.array s
inccPtr <- Call.cint incc
liftIO $ Lapack.lar2v nPtr xPtr yPtr zPtr incxPtr cPtr sPtr inccPtr
larcm ::
CArray (Int,Int) Float ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float))
larcm a b ldc = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let m = aDim0
let lda = aDim1
let n = bDim0
let ldb = bDim1
c <- Call.newArray2 n ldc
rwork <- Call.newArray1 (2*m*n)
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
cPtr <- Call.array c
ldcPtr <- Call.cint ldc
rworkPtr <- Call.array rwork
liftIO $ Lapack.larcm mPtr nPtr aPtr ldaPtr bPtr ldbPtr cPtr ldcPtr rworkPtr
liftIO $ pure c
larf ::
Char ->
Int ->
CArray Int (Complex Float) ->
Int ->
Complex Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO ()
larf side m v incv tau c workSize = do
let vDim0 = Call.sizes1 $ bounds v
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _vSize = vDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
mPtr <- Call.cint m
nPtr <- Call.cint n
vPtr <- Call.array v
incvPtr <- Call.cint incv
tauPtr <- Call.complexFloat tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
liftIO $ Lapack.larf sidePtr mPtr nPtr vPtr incvPtr tauPtr cPtr ldcPtr workPtr
larfb ::
Char ->
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO ()
larfb side trans direct storev m v t c ldwork = do
let (vDim0,vDim1) = Call.sizes2 $ bounds v
let (tDim0,tDim1) = Call.sizes2 $ bounds t
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _vSize = vDim0
let ldv = vDim1
let k = tDim0
let ldt = tDim1
let n = cDim0
let ldc = cDim1
work <- Call.newArray2 k ldwork
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
directPtr <- Call.char direct
storevPtr <- Call.char storev
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
vPtr <- Call.array v
ldvPtr <- Call.cint ldv
tPtr <- Call.array t
ldtPtr <- Call.cint ldt
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
ldworkPtr <- Call.cint ldwork
liftIO $ Lapack.larfb sidePtr transPtr directPtr storevPtr mPtr nPtr kPtr vPtr ldvPtr tPtr ldtPtr cPtr ldcPtr workPtr ldworkPtr
larfg ::
Int ->
Complex Float ->
IOCArray Int (Complex Float) ->
Int ->
IO (Complex Float, Complex Float)
larfg n alpha x incx = do
xDim0 <- Call.sizes1 <$> getBounds x
let _xSize = xDim0
evalContT $ do
nPtr <- Call.cint n
alphaPtr <- Call.complexFloat alpha
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
tauPtr <- Call.alloca
liftIO $ Lapack.larfg nPtr alphaPtr xPtr incxPtr tauPtr
liftIO $ pure (,)
<*> peek alphaPtr
<*> peek tauPtr
larfgp ::
Int ->
Complex Float ->
IOCArray Int (Complex Float) ->
Int ->
IO (Complex Float, Complex Float)
larfgp n alpha x incx = do
xDim0 <- Call.sizes1 <$> getBounds x
let _xSize = xDim0
evalContT $ do
nPtr <- Call.cint n
alphaPtr <- Call.complexFloat alpha
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
tauPtr <- Call.alloca
liftIO $ Lapack.larfgp nPtr alphaPtr xPtr incxPtr tauPtr
liftIO $ pure (,)
<*> peek alphaPtr
<*> peek tauPtr
larft ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float))
larft direct storev n v tau ldt = do
let (vDim0,vDim1) = Call.sizes2 $ bounds v
let tauDim0 = Call.sizes1 $ bounds tau
let _vSize = vDim0
let ldv = vDim1
let k = tauDim0
t <- Call.newArray2 k ldt
evalContT $ do
directPtr <- Call.char direct
storevPtr <- Call.char storev
nPtr <- Call.cint n
kPtr <- Call.cint k
vPtr <- Call.array v
ldvPtr <- Call.cint ldv
tauPtr <- Call.array tau
tPtr <- Call.array t
ldtPtr <- Call.cint ldt
liftIO $ Lapack.larft directPtr storevPtr nPtr kPtr vPtr ldvPtr tauPtr tPtr ldtPtr
liftIO $ pure t
larfx ::
Char ->
Int ->
CArray Int (Complex Float) ->
Complex Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO ()
larfx side m v tau c workSize = do
let vDim0 = Call.sizes1 $ bounds v
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _vSize = vDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
mPtr <- Call.cint m
nPtr <- Call.cint n
vPtr <- Call.array v
tauPtr <- Call.complexFloat tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
liftIO $ Lapack.larfx sidePtr mPtr nPtr vPtr tauPtr cPtr ldcPtr workPtr
largv ::
Int ->
IOCArray Int (Complex Float) ->
Int ->
IOCArray Int (Complex Float) ->
Int ->
Int ->
IO (CArray Int Float)
largv n x incx y incy incc = do
xDim0 <- Call.sizes1 <$> getBounds x
yDim0 <- Call.sizes1 <$> getBounds y
Call.assert "largv: 1+(n-1)*incx == xDim0" (1+(n1)*incx == xDim0)
Call.assert "largv: 1+(n-1)*incy == yDim0" (1+(n1)*incy == yDim0)
c <- Call.newArray1 (1+(n1)*incc)
evalContT $ do
nPtr <- Call.cint n
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
cPtr <- Call.array c
inccPtr <- Call.cint incc
liftIO $ Lapack.largv nPtr xPtr incxPtr yPtr incyPtr cPtr inccPtr
liftIO $ pure c
larnv ::
Int ->
IOCArray Int CInt ->
Int ->
IO (CArray Int (Complex Float))
larnv idist iseed n = do
iseedDim0 <- Call.sizes1 <$> getBounds iseed
Call.assert "larnv: 4 == iseedDim0" (4 == iseedDim0)
x <- Call.newArray1 n
evalContT $ do
idistPtr <- Call.cint idist
iseedPtr <- Call.ioarray iseed
nPtr <- Call.cint n
xPtr <- Call.array x
liftIO $ Lapack.larnv idistPtr iseedPtr nPtr xPtr
liftIO $ pure x
larrv ::
Float ->
Float ->
IOCArray Int Float ->
IOCArray Int Float ->
Float ->
CArray Int CInt ->
Int ->
Int ->
Int ->
Float ->
Float ->
Float ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray Int Float ->
CArray Int CInt ->
CArray Int CInt ->
CArray Int Float ->
Int ->
IO (CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
larrv vl vu d l pivmin isplit m dol dou minrgp rtol1 rtol2 w werr wgap iblock indexw gers ldz = do
dDim0 <- Call.sizes1 <$> getBounds d
lDim0 <- Call.sizes1 <$> getBounds l
let isplitDim0 = Call.sizes1 $ bounds isplit
wDim0 <- Call.sizes1 <$> getBounds w
werrDim0 <- Call.sizes1 <$> getBounds werr
wgapDim0 <- Call.sizes1 <$> getBounds wgap
let iblockDim0 = Call.sizes1 $ bounds iblock
let indexwDim0 = Call.sizes1 $ bounds indexw
let gersDim0 = Call.sizes1 $ bounds gers
let n = dDim0
Call.assert "larrv: n == lDim0" (n == lDim0)
Call.assert "larrv: n == isplitDim0" (n == isplitDim0)
Call.assert "larrv: n == wDim0" (n == wDim0)
Call.assert "larrv: n == werrDim0" (n == werrDim0)
Call.assert "larrv: n == wgapDim0" (n == wgapDim0)
Call.assert "larrv: n == iblockDim0" (n == iblockDim0)
Call.assert "larrv: n == indexwDim0" (n == indexwDim0)
Call.assert "larrv: 2*n == gersDim0" (2*n == gersDim0)
z <- Call.newArray2 (maximum[1,m]) ldz
isuppz <- Call.newArray1 (2*maximum[1,m])
work <- Call.newArray1 (12*n)
iwork <- Call.newArray1 (7*n)
evalContT $ do
nPtr <- Call.cint n
vlPtr <- Call.float vl
vuPtr <- Call.float vu
dPtr <- Call.ioarray d
lPtr <- Call.ioarray l
pivminPtr <- Call.float pivmin
isplitPtr <- Call.array isplit
mPtr <- Call.cint m
dolPtr <- Call.cint dol
douPtr <- Call.cint dou
minrgpPtr <- Call.float minrgp
rtol1Ptr <- Call.float rtol1
rtol2Ptr <- Call.float rtol2
wPtr <- Call.ioarray w
werrPtr <- Call.ioarray werr
wgapPtr <- Call.ioarray wgap
iblockPtr <- Call.array iblock
indexwPtr <- Call.array indexw
gersPtr <- Call.array gers
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
isuppzPtr <- Call.array isuppz
workPtr <- Call.array work
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.larrv nPtr vlPtr vuPtr dPtr lPtr pivminPtr isplitPtr mPtr dolPtr douPtr minrgpPtr rtol1Ptr rtol2Ptr wPtr werrPtr wgapPtr iblockPtr indexwPtr gersPtr zPtr ldzPtr isuppzPtr workPtr iworkPtr infoPtr
liftIO $ pure (,,)
<*> pure z
<*> pure isuppz
<*> fmap fromIntegral (peek infoPtr)
lartg ::
Complex Float ->
Complex Float ->
IO (Float, Complex Float, Complex Float)
lartg f g = do
evalContT $ do
fPtr <- Call.complexFloat f
gPtr <- Call.complexFloat g
csPtr <- Call.alloca
snPtr <- Call.alloca
rPtr <- Call.alloca
liftIO $ Lapack.lartg fPtr gPtr csPtr snPtr rPtr
liftIO $ pure (,,)
<*> peek csPtr
<*> peek snPtr
<*> peek rPtr
lartv ::
Int ->
IOCArray Int (Complex Float) ->
Int ->
IOCArray Int (Complex Float) ->
Int ->
CArray Int Float ->
CArray Int (Complex Float) ->
Int ->
IO ()
lartv n x incx y incy c s incc = do
xDim0 <- Call.sizes1 <$> getBounds x
yDim0 <- Call.sizes1 <$> getBounds y
let cDim0 = Call.sizes1 $ bounds c
let sDim0 = Call.sizes1 $ bounds s
Call.assert "lartv: 1+(n-1)*incx == xDim0" (1+(n1)*incx == xDim0)
Call.assert "lartv: 1+(n-1)*incy == yDim0" (1+(n1)*incy == yDim0)
Call.assert "lartv: 1+(n-1)*incc == cDim0" (1+(n1)*incc == cDim0)
Call.assert "lartv: 1+(n-1)*incc == sDim0" (1+(n1)*incc == sDim0)
evalContT $ do
nPtr <- Call.cint n
xPtr <- Call.ioarray x
incxPtr <- Call.cint incx
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
cPtr <- Call.array c
sPtr <- Call.array s
inccPtr <- Call.cint incc
liftIO $ Lapack.lartv nPtr xPtr incxPtr yPtr incyPtr cPtr sPtr inccPtr
larz ::
Char ->
Int ->
Int ->
CArray Int (Complex Float) ->
Int ->
Complex Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO ()
larz side m l v incv tau c workSize = do
let vDim0 = Call.sizes1 $ bounds v
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let n = cDim0
let ldc = cDim1
Call.ignore "larz: 1+(l-1)*abs(incv) == vDim0" vDim0
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
mPtr <- Call.cint m
nPtr <- Call.cint n
lPtr <- Call.cint l
vPtr <- Call.array v
incvPtr <- Call.cint incv
tauPtr <- Call.complexFloat tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
liftIO $ Lapack.larz sidePtr mPtr nPtr lPtr vPtr incvPtr tauPtr cPtr ldcPtr workPtr
larzb ::
Char ->
Char ->
Char ->
Char ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO ()
larzb side trans direct storev m l v t c ldwork = do
let (vDim0,vDim1) = Call.sizes2 $ bounds v
let (tDim0,tDim1) = Call.sizes2 $ bounds t
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _nv = vDim0
let ldv = vDim1
let k = tDim0
let ldt = tDim1
let n = cDim0
let ldc = cDim1
work <- Call.newArray2 k ldwork
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
directPtr <- Call.char direct
storevPtr <- Call.char storev
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
lPtr <- Call.cint l
vPtr <- Call.array v
ldvPtr <- Call.cint ldv
tPtr <- Call.array t
ldtPtr <- Call.cint ldt
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
ldworkPtr <- Call.cint ldwork
liftIO $ Lapack.larzb sidePtr transPtr directPtr storevPtr mPtr nPtr kPtr lPtr vPtr ldvPtr tPtr ldtPtr cPtr ldcPtr workPtr ldworkPtr
larzt ::
Char ->
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float))
larzt direct storev n v tau ldt = do
(vDim0,vDim1) <- Call.sizes2 <$> getBounds v
let tauDim0 = Call.sizes1 $ bounds tau
let _vSize = vDim0
let ldv = vDim1
let k = tauDim0
t <- Call.newArray2 k ldt
evalContT $ do
directPtr <- Call.char direct
storevPtr <- Call.char storev
nPtr <- Call.cint n
kPtr <- Call.cint k
vPtr <- Call.ioarray v
ldvPtr <- Call.cint ldv
tauPtr <- Call.array tau
tPtr <- Call.array t
ldtPtr <- Call.cint ldt
liftIO $ Lapack.larzt directPtr storevPtr nPtr kPtr vPtr ldvPtr tauPtr tPtr ldtPtr
liftIO $ pure t
lascl ::
Char ->
Int ->
Int ->
Float ->
Float ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
lascl type_ kl ku cfrom cto m a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
type_Ptr <- Call.char type_
klPtr <- Call.cint kl
kuPtr <- Call.cint ku
cfromPtr <- Call.float cfrom
ctoPtr <- Call.float cto
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.lascl type_Ptr klPtr kuPtr cfromPtr ctoPtr mPtr nPtr aPtr ldaPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
laset ::
Char ->
Int ->
Int ->
Complex Float ->
Complex Float ->
Int ->
IO (CArray (Int,Int) (Complex Float))
laset uplo m n alpha beta lda = do
a <- Call.newArray2 n lda
evalContT $ do
uploPtr <- Call.char uplo
mPtr <- Call.cint m
nPtr <- Call.cint n
alphaPtr <- Call.complexFloat alpha
betaPtr <- Call.complexFloat beta
aPtr <- Call.array a
ldaPtr <- Call.cint lda
liftIO $ Lapack.laset uploPtr mPtr nPtr alphaPtr betaPtr aPtr ldaPtr
liftIO $ pure a
lasr ::
Char ->
Char ->
Char ->
Int ->
CArray Int Float ->
CArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
IO ()
lasr side pivot direct m c s a = do
let cDim0 = Call.sizes1 $ bounds c
let sDim0 = Call.sizes1 $ bounds s
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let _cSize = cDim0
let _sSize = sDim0
let n = aDim0
let lda = aDim1
evalContT $ do
sidePtr <- Call.char side
pivotPtr <- Call.char pivot
directPtr <- Call.char direct
mPtr <- Call.cint m
nPtr <- Call.cint n
cPtr <- Call.array c
sPtr <- Call.array s
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
liftIO $ Lapack.lasr sidePtr pivotPtr directPtr mPtr nPtr cPtr sPtr aPtr ldaPtr
lassq ::
CArray Int (Complex Float) ->
Int ->
Float ->
Float ->
IO (Float, Float)
lassq x incx scale sumsq = do
let xDim0 = Call.sizes1 $ bounds x
let n = xDim0
evalContT $ do
nPtr <- Call.cint n
xPtr <- Call.array x
incxPtr <- Call.cint incx
scalePtr <- Call.float scale
sumsqPtr <- Call.float sumsq
liftIO $ Lapack.lassq nPtr xPtr incxPtr scalePtr sumsqPtr
liftIO $ pure (,)
<*> peek scalePtr
<*> peek sumsqPtr
laswp ::
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
CArray Int CInt ->
Int ->
IO ()
laswp a k1 k2 ipiv incx = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.ignore "laswp: k1+(k2-k1)*abs(incx) == ipivDim0" ipivDim0
evalContT $ do
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
k1Ptr <- Call.cint k1
k2Ptr <- Call.cint k2
ipivPtr <- Call.array ipiv
incxPtr <- Call.cint incx
liftIO $ Lapack.laswp nPtr aPtr ldaPtr k1Ptr k2Ptr ipivPtr incxPtr
lasyf ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int, CArray Int CInt, CArray (Int,Int) (Complex Float), Int)
lasyf uplo nb a ldw = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 n
w <- Call.newArray2 nb ldw
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nbPtr <- Call.cint nb
kbPtr <- Call.alloca
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
wPtr <- Call.array w
ldwPtr <- Call.cint ldw
infoPtr <- Call.alloca
liftIO $ Lapack.lasyf uploPtr nPtr nbPtr kbPtr aPtr ldaPtr ipivPtr wPtr ldwPtr infoPtr
liftIO $ pure (,,,)
<*> fmap fromIntegral (peek kbPtr)
<*> pure ipiv
<*> pure w
<*> fmap fromIntegral (peek infoPtr)
latbs ::
Char ->
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int Float ->
IO (Float, Int)
latbs uplo trans diag normin kd ab x cnorm = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
xDim0 <- Call.sizes1 <$> getBounds x
cnormDim0 <- Call.sizes1 <$> getBounds cnorm
let n = abDim0
let ldab = abDim1
Call.assert "latbs: n == xDim0" (n == xDim0)
Call.assert "latbs: n == cnormDim0" (n == cnormDim0)
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
norminPtr <- Call.char normin
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
xPtr <- Call.ioarray x
scalePtr <- Call.alloca
cnormPtr <- Call.ioarray cnorm
infoPtr <- Call.alloca
liftIO $ Lapack.latbs uploPtr transPtr diagPtr norminPtr nPtr kdPtr abPtr ldabPtr xPtr scalePtr cnormPtr infoPtr
liftIO $ pure (,)
<*> peek scalePtr
<*> fmap fromIntegral (peek infoPtr)
latdf ::
Int ->
CArray (Int,Int) (Complex Float) ->
IOCArray Int (Complex Float) ->
Float ->
Float ->
CArray Int CInt ->
CArray Int CInt ->
IO (Float, Float)
latdf ijob z rhs rdsum rdscal ipiv jpiv = do
let (zDim0,zDim1) = Call.sizes2 $ bounds z
rhsDim0 <- Call.sizes1 <$> getBounds rhs
let ipivDim0 = Call.sizes1 $ bounds ipiv
let jpivDim0 = Call.sizes1 $ bounds jpiv
let n = zDim0
let ldz = zDim1
Call.assert "latdf: n == rhsDim0" (n == rhsDim0)
Call.assert "latdf: n == ipivDim0" (n == ipivDim0)
Call.assert "latdf: n == jpivDim0" (n == jpivDim0)
evalContT $ do
ijobPtr <- Call.cint ijob
nPtr <- Call.cint n
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
rhsPtr <- Call.ioarray rhs
rdsumPtr <- Call.float rdsum
rdscalPtr <- Call.float rdscal
ipivPtr <- Call.array ipiv
jpivPtr <- Call.array jpiv
liftIO $ Lapack.latdf ijobPtr nPtr zPtr ldzPtr rhsPtr rdsumPtr rdscalPtr ipivPtr jpivPtr
liftIO $ pure (,)
<*> peek rdsumPtr
<*> peek rdscalPtr
latps ::
Char ->
Char ->
Char ->
Char ->
CArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int Float ->
IO (Float, Int)
latps uplo trans diag normin ap x cnorm = do
let apDim0 = Call.sizes1 $ bounds ap
xDim0 <- Call.sizes1 <$> getBounds x
cnormDim0 <- Call.sizes1 <$> getBounds cnorm
let n = xDim0
Call.assert "latps: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "latps: n == cnormDim0" (n == cnormDim0)
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
norminPtr <- Call.char normin
nPtr <- Call.cint n
apPtr <- Call.array ap
xPtr <- Call.ioarray x
scalePtr <- Call.alloca
cnormPtr <- Call.ioarray cnorm
infoPtr <- Call.alloca
liftIO $ Lapack.latps uploPtr transPtr diagPtr norminPtr nPtr apPtr xPtr scalePtr cnormPtr infoPtr
liftIO $ pure (,)
<*> peek scalePtr
<*> fmap fromIntegral (peek infoPtr)
latrd ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, CArray Int (Complex Float), CArray (Int,Int) (Complex Float))
latrd uplo nb a ldw = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
e <- Call.newArray1 (n1)
tau <- Call.newArray1 (n1)
w <- Call.newArray2 nb ldw
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nbPtr <- Call.cint nb
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ePtr <- Call.array e
tauPtr <- Call.array tau
wPtr <- Call.array w
ldwPtr <- Call.cint ldw
liftIO $ Lapack.latrd uploPtr nPtr nbPtr aPtr ldaPtr ePtr tauPtr wPtr ldwPtr
liftIO $ pure (,,)
<*> pure e
<*> pure tau
<*> pure w
latrs ::
Char ->
Char ->
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int Float ->
IO (Float, Int)
latrs uplo trans diag normin a x cnorm = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
xDim0 <- Call.sizes1 <$> getBounds x
cnormDim0 <- Call.sizes1 <$> getBounds cnorm
let n = aDim0
let lda = aDim1
Call.assert "latrs: n == xDim0" (n == xDim0)
Call.assert "latrs: n == cnormDim0" (n == cnormDim0)
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
norminPtr <- Call.char normin
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.ioarray x
scalePtr <- Call.alloca
cnormPtr <- Call.ioarray cnorm
infoPtr <- Call.alloca
liftIO $ Lapack.latrs uploPtr transPtr diagPtr norminPtr nPtr aPtr ldaPtr xPtr scalePtr cnormPtr infoPtr
liftIO $ pure (,)
<*> peek scalePtr
<*> fmap fromIntegral (peek infoPtr)
latrz ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float))
latrz m l a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 m
work <- Call.newArray1 m
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
lPtr <- Call.cint l
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
liftIO $ Lapack.latrz mPtr nPtr lPtr aPtr ldaPtr tauPtr workPtr
liftIO $ pure tau
lauu2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
lauu2 uplo a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.lauu2 uploPtr nPtr aPtr ldaPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
lauum ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
lauum uplo a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.lauum uploPtr nPtr aPtr ldaPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pbcon ::
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
Float ->
IO (Float, Int)
pbcon uplo kd ab anorm = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.pbcon uploPtr nPtr kdPtr abPtr ldabPtr anormPtr rcondPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
pbequ ::
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, Float, Float, Int)
pbequ uplo kd ab = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
s <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
sPtr <- Call.array s
scondPtr <- Call.alloca
amaxPtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.pbequ uploPtr nPtr kdPtr abPtr ldabPtr sPtr scondPtr amaxPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> peek scondPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
pbrfs ::
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
pbrfs uplo kd ab afb b x = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let (afbDim0,afbDim1) = Call.sizes2 $ bounds afb
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = abDim0
let ldab = abDim1
let ldafb = afbDim1
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "pbrfs: n == afbDim0" (n == afbDim0)
Call.assert "pbrfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
nrhsPtr <- Call.cint nrhs
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
afbPtr <- Call.array afb
ldafbPtr <- Call.cint ldafb
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.pbrfs uploPtr nPtr kdPtr nrhsPtr abPtr ldabPtr afbPtr ldafbPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
pbstf ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pbstf uplo kd ab = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
infoPtr <- Call.alloca
liftIO $ Lapack.pbstf uploPtr nPtr kdPtr abPtr ldabPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pbsv ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pbsv uplo kd ab b = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = abDim0
let ldab = abDim1
let nrhs = bDim0
let ldb = bDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
nrhsPtr <- Call.cint nrhs
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.pbsv uploPtr nPtr kdPtr nrhsPtr abPtr ldabPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pbsvx ::
Char ->
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Char ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Char, CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
pbsvx fact uplo kd ab afb equed s b ldx = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
(afbDim0,afbDim1) <- Call.sizes2 <$> getBounds afb
sDim0 <- Call.sizes1 <$> getBounds s
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = abDim0
let ldab = abDim1
let ldafb = afbDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "pbsvx: n == afbDim0" (n == afbDim0)
Call.assert "pbsvx: n == sDim0" (n == sDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
nrhsPtr <- Call.cint nrhs
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
afbPtr <- Call.ioarray afb
ldafbPtr <- Call.cint ldafb
equedPtr <- Call.char equed
sPtr <- Call.ioarray s
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.pbsvx factPtr uploPtr nPtr kdPtr nrhsPtr abPtr ldabPtr afbPtr ldafbPtr equedPtr sPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> fmap castCCharToChar (peek equedPtr)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
pbtf2 ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pbtf2 uplo kd ab = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
infoPtr <- Call.alloca
liftIO $ Lapack.pbtf2 uploPtr nPtr kdPtr abPtr ldabPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pbtrf ::
Char ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pbtrf uplo kd ab = do
(abDim0,abDim1) <- Call.sizes2 <$> getBounds ab
let n = abDim0
let ldab = abDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.ioarray ab
ldabPtr <- Call.cint ldab
infoPtr <- Call.alloca
liftIO $ Lapack.pbtrf uploPtr nPtr kdPtr abPtr ldabPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pbtrs ::
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pbtrs uplo kd ab b = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = abDim0
let ldab = abDim1
let nrhs = bDim0
let ldb = bDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
kdPtr <- Call.cint kd
nrhsPtr <- Call.cint nrhs
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.pbtrs uploPtr nPtr kdPtr nrhsPtr abPtr ldabPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pftrf ::
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (Int)
pftrf transr uplo n a = do
aDim0 <- Call.sizes1 <$> getBounds a
Call.assert "pftrf: n*(n+1)`div`2 == aDim0" (n*(n+1)`div`2 == aDim0)
evalContT $ do
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
infoPtr <- Call.alloca
liftIO $ Lapack.pftrf transrPtr uploPtr nPtr aPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pftri ::
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (Int)
pftri transr uplo n a = do
aDim0 <- Call.sizes1 <$> getBounds a
Call.assert "pftri: n*(n+1)`div`2 == aDim0" (n*(n+1)`div`2 == aDim0)
evalContT $ do
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
infoPtr <- Call.alloca
liftIO $ Lapack.pftri transrPtr uploPtr nPtr aPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pftrs ::
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pftrs transr uplo n a b = do
let aDim0 = Call.sizes1 $ bounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let nrhs = bDim0
let ldb = bDim1
Call.assert "pftrs: n*(n+1)`div`2 == aDim0" (n*(n+1)`div`2 == aDim0)
evalContT $ do
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.pftrs transrPtr uploPtr nPtr nrhsPtr aPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pocon ::
Char ->
CArray (Int,Int) (Complex Float) ->
Float ->
IO (Float, Int)
pocon uplo a anorm = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.pocon uploPtr nPtr aPtr ldaPtr anormPtr rcondPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
poequ ::
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, Float, Float, Int)
poequ a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
s <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
sPtr <- Call.array s
scondPtr <- Call.alloca
amaxPtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.poequ nPtr aPtr ldaPtr sPtr scondPtr amaxPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> peek scondPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
poequb ::
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, Float, Float, Int)
poequb a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
s <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
sPtr <- Call.array s
scondPtr <- Call.alloca
amaxPtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.poequb nPtr aPtr ldaPtr sPtr scondPtr amaxPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> peek scondPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
porfs ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
porfs uplo a af b x = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (afDim0,afDim1) = Call.sizes2 $ bounds af
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = aDim0
let lda = aDim1
let ldaf = afDim1
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "porfs: n == afDim0" (n == afDim0)
Call.assert "porfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
afPtr <- Call.array af
ldafPtr <- Call.cint ldaf
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.porfs uploPtr nPtr nrhsPtr aPtr ldaPtr afPtr ldafPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
posv ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
posv uplo a b = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.posv uploPtr nPtr nrhsPtr aPtr ldaPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
posvx ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Char ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Char, CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
posvx fact uplo a af equed s b ldx = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(afDim0,afDim1) <- Call.sizes2 <$> getBounds af
sDim0 <- Call.sizes1 <$> getBounds s
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let ldaf = afDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "posvx: n == afDim0" (n == afDim0)
Call.assert "posvx: n == sDim0" (n == sDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
afPtr <- Call.ioarray af
ldafPtr <- Call.cint ldaf
equedPtr <- Call.char equed
sPtr <- Call.ioarray s
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.posvx factPtr uploPtr nPtr nrhsPtr aPtr ldaPtr afPtr ldafPtr equedPtr sPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> fmap castCCharToChar (peek equedPtr)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
potf2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
potf2 uplo a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.potf2 uploPtr nPtr aPtr ldaPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
potrf ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
potrf uplo a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.potrf uploPtr nPtr aPtr ldaPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
potri ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
potri uplo a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.potri uploPtr nPtr aPtr ldaPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
potrs ::
Char ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
potrs uplo a b = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.potrs uploPtr nPtr nrhsPtr aPtr ldaPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ppcon ::
Char ->
Int ->
CArray Int (Complex Float) ->
Float ->
IO (Float, Int)
ppcon uplo n ap anorm = do
let apDim0 = Call.sizes1 $ bounds ap
Call.assert "ppcon: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.ppcon uploPtr nPtr apPtr anormPtr rcondPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
ppequ ::
Char ->
Int ->
CArray Int (Complex Float) ->
IO (CArray Int Float, Float, Float, Int)
ppequ uplo n ap = do
let apDim0 = Call.sizes1 $ bounds ap
Call.assert "ppequ: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
s <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
sPtr <- Call.array s
scondPtr <- Call.alloca
amaxPtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.ppequ uploPtr nPtr apPtr sPtr scondPtr amaxPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> peek scondPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
pprfs ::
Char ->
Int ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
pprfs uplo n ap afp b x = do
let apDim0 = Call.sizes1 $ bounds ap
let afpDim0 = Call.sizes1 $ bounds afp
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "pprfs: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "pprfs: n*(n+1)`div`2 == afpDim0" (n*(n+1)`div`2 == afpDim0)
Call.assert "pprfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
afpPtr <- Call.array afp
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.pprfs uploPtr nPtr nrhsPtr apPtr afpPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
ppsv ::
Char ->
Int ->
IOCArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
ppsv uplo n ap b = do
apDim0 <- Call.sizes1 <$> getBounds ap
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let nrhs = bDim0
let ldb = bDim1
Call.assert "ppsv: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.ioarray ap
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.ppsv uploPtr nPtr nrhsPtr apPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ppsvx ::
Char ->
Char ->
IOCArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
Char ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Char, CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
ppsvx fact uplo ap afp equed s b ldx = do
apDim0 <- Call.sizes1 <$> getBounds ap
afpDim0 <- Call.sizes1 <$> getBounds afp
sDim0 <- Call.sizes1 <$> getBounds s
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = sDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "ppsvx: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "ppsvx: n*(n+1)`div`2 == afpDim0" (n*(n+1)`div`2 == afpDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.ioarray ap
afpPtr <- Call.ioarray afp
equedPtr <- Call.char equed
sPtr <- Call.ioarray s
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.ppsvx factPtr uploPtr nPtr nrhsPtr apPtr afpPtr equedPtr sPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> fmap castCCharToChar (peek equedPtr)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
pptrf ::
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (Int)
pptrf uplo n ap = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "pptrf: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
infoPtr <- Call.alloca
liftIO $ Lapack.pptrf uploPtr nPtr apPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pptri ::
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (Int)
pptri uplo n ap = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "pptri: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
infoPtr <- Call.alloca
liftIO $ Lapack.pptri uploPtr nPtr apPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pptrs ::
Char ->
Int ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pptrs uplo n ap b = do
let apDim0 = Call.sizes1 $ bounds ap
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let nrhs = bDim0
let ldb = bDim1
Call.assert "pptrs: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.pptrs uploPtr nPtr nrhsPtr apPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pstf2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
IO (CArray Int CInt, Int, Int)
pstf2 uplo a tol = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
piv <- Call.newArray1 n
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
pivPtr <- Call.array piv
rankPtr <- Call.alloca
tolPtr <- Call.float tol
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.pstf2 uploPtr nPtr aPtr ldaPtr pivPtr rankPtr tolPtr workPtr infoPtr
liftIO $ pure (,,)
<*> pure piv
<*> fmap fromIntegral (peek rankPtr)
<*> fmap fromIntegral (peek infoPtr)
pstrf ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
IO (CArray Int CInt, Int, Int)
pstrf uplo a tol = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
piv <- Call.newArray1 n
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
pivPtr <- Call.array piv
rankPtr <- Call.alloca
tolPtr <- Call.float tol
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.pstrf uploPtr nPtr aPtr ldaPtr pivPtr rankPtr tolPtr workPtr infoPtr
liftIO $ pure (,,)
<*> pure piv
<*> fmap fromIntegral (peek rankPtr)
<*> fmap fromIntegral (peek infoPtr)
ptcon ::
CArray Int Float ->
CArray Int (Complex Float) ->
Float ->
IO (Float, Int)
ptcon d e anorm = do
let dDim0 = Call.sizes1 $ bounds d
let eDim0 = Call.sizes1 $ bounds e
let n = dDim0
Call.assert "ptcon: n-1 == eDim0" (n1 == eDim0)
rwork <- Call.newArray1 n
evalContT $ do
nPtr <- Call.cint n
dPtr <- Call.array d
ePtr <- Call.array e
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.ptcon nPtr dPtr ePtr anormPtr rcondPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
pteqr ::
Char ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pteqr compz d e z = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = dDim0
let ldz = zDim1
Call.assert "pteqr: n-1 == eDim0" (n1 == eDim0)
Call.assert "pteqr: n == zDim0" (n == zDim0)
work <- Call.newArray1 (4*n)
evalContT $ do
compzPtr <- Call.char compz
nPtr <- Call.cint n
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.pteqr compzPtr nPtr dPtr ePtr zPtr ldzPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ptrfs ::
Char ->
CArray Int Float ->
CArray Int (Complex Float) ->
CArray Int Float ->
CArray Int (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
ptrfs uplo d e df ef b x = do
let dDim0 = Call.sizes1 $ bounds d
let eDim0 = Call.sizes1 $ bounds e
let dfDim0 = Call.sizes1 $ bounds df
let efDim0 = Call.sizes1 $ bounds ef
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "ptrfs: n-1 == eDim0" (n1 == eDim0)
Call.assert "ptrfs: n == dfDim0" (n == dfDim0)
Call.assert "ptrfs: n-1 == efDim0" (n1 == efDim0)
Call.assert "ptrfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 n
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dPtr <- Call.array d
ePtr <- Call.array e
dfPtr <- Call.array df
efPtr <- Call.array ef
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.ptrfs uploPtr nPtr nrhsPtr dPtr ePtr dfPtr efPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
ptsv ::
IOCArray Int Float ->
IOCArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
ptsv d e b = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "ptsv: n-1 == eDim0" (n1 == eDim0)
evalContT $ do
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.ptsv nPtr nrhsPtr dPtr ePtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ptsvx ::
Char ->
CArray Int Float ->
CArray Int (Complex Float) ->
IOCArray Int Float ->
IOCArray Int (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
ptsvx fact d e df ef b ldx = do
let dDim0 = Call.sizes1 $ bounds d
let eDim0 = Call.sizes1 $ bounds e
dfDim0 <- Call.sizes1 <$> getBounds df
efDim0 <- Call.sizes1 <$> getBounds ef
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "ptsvx: n-1 == eDim0" (n1 == eDim0)
Call.assert "ptsvx: n == dfDim0" (n == dfDim0)
Call.assert "ptsvx: n-1 == efDim0" (n1 == efDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 n
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dPtr <- Call.array d
ePtr <- Call.array e
dfPtr <- Call.ioarray df
efPtr <- Call.ioarray ef
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.ptsvx factPtr nPtr nrhsPtr dPtr ePtr dfPtr efPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
pttrf ::
IOCArray Int Float ->
IOCArray Int (Complex Float) ->
IO (Int)
pttrf d e = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
let n = dDim0
Call.assert "pttrf: n-1 == eDim0" (n1 == eDim0)
evalContT $ do
nPtr <- Call.cint n
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
infoPtr <- Call.alloca
liftIO $ Lapack.pttrf nPtr dPtr ePtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
pttrs ::
Char ->
CArray Int Float ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
pttrs uplo d e b = do
let dDim0 = Call.sizes1 $ bounds d
let eDim0 = Call.sizes1 $ bounds e
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "pttrs: n-1 == eDim0" (n1 == eDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dPtr <- Call.array d
ePtr <- Call.array e
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.pttrs uploPtr nPtr nrhsPtr dPtr ePtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ptts2 ::
Int ->
CArray Int Float ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO ()
ptts2 iuplo d e b = do
let dDim0 = Call.sizes1 $ bounds d
let eDim0 = Call.sizes1 $ bounds e
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = dDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "ptts2: n-1 == eDim0" (n1 == eDim0)
evalContT $ do
iuploPtr <- Call.cint iuplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
dPtr <- Call.array d
ePtr <- Call.array e
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
liftIO $ Lapack.ptts2 iuploPtr nPtr nrhsPtr dPtr ePtr bPtr ldbPtr
rot ::
IOCArray Int (Complex Float) ->
Int ->
IOCArray Int (Complex Float) ->
Int ->
Float ->
Complex Float ->
IO ()
rot cx incx cy incy c s = do
cxDim0 <- Call.sizes1 <$> getBounds cx
cyDim0 <- Call.sizes1 <$> getBounds cy
let n = cxDim0
Call.assert "rot: n == cyDim0" (n == cyDim0)
evalContT $ do
nPtr <- Call.cint n
cxPtr <- Call.ioarray cx
incxPtr <- Call.cint incx
cyPtr <- Call.ioarray cy
incyPtr <- Call.cint incy
cPtr <- Call.float c
sPtr <- Call.complexFloat s
liftIO $ Lapack.rot nPtr cxPtr incxPtr cyPtr incyPtr cPtr sPtr
spcon ::
Char ->
CArray Int (Complex Float) ->
CArray Int CInt ->
Float ->
IO (Float, Int)
spcon uplo ap ipiv anorm = do
let apDim0 = Call.sizes1 $ bounds ap
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = ipivDim0
Call.assert "spcon: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
ipivPtr <- Call.array ipiv
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.spcon uploPtr nPtr apPtr ipivPtr anormPtr rcondPtr workPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
spmv ::
Char ->
Int ->
Complex Float ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
Complex Float ->
IOCArray Int (Complex 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.complexFloat alpha
apPtr <- Call.array ap
xPtr <- Call.array x
incxPtr <- Call.cint incx
betaPtr <- Call.complexFloat beta
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
liftIO $ Lapack.spmv uploPtr nPtr alphaPtr apPtr xPtr incxPtr betaPtr yPtr incyPtr
spr ::
Char ->
Int ->
Complex Float ->
CArray Int (Complex Float) ->
Int ->
IOCArray Int (Complex 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.complexFloat alpha
xPtr <- Call.array x
incxPtr <- Call.cint incx
apPtr <- Call.ioarray ap
liftIO $ Lapack.spr uploPtr nPtr alphaPtr xPtr incxPtr apPtr
sprfs ::
Char ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
CArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
sprfs uplo ap afp ipiv b x = do
let apDim0 = Call.sizes1 $ bounds ap
let afpDim0 = Call.sizes1 $ bounds afp
let ipivDim0 = Call.sizes1 $ bounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = ipivDim0
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "sprfs: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "sprfs: n*(n+1)`div`2 == afpDim0" (n*(n+1)`div`2 == afpDim0)
Call.assert "sprfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
afpPtr <- Call.array afp
ipivPtr <- Call.array ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.sprfs uploPtr nPtr nrhsPtr apPtr afpPtr ipivPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
spsv ::
Char ->
Int ->
IOCArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
spsv uplo n ap b = do
apDim0 <- Call.sizes1 <$> getBounds ap
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let nrhs = bDim0
let ldb = bDim1
Call.assert "spsv: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
ipiv <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.ioarray ap
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.spsv uploPtr nPtr nrhsPtr apPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
spsvx ::
Char ->
Char ->
CArray Int (Complex Float) ->
IOCArray Int (Complex Float) ->
IOCArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
spsvx fact uplo ap afp ipiv b ldx = do
let apDim0 = Call.sizes1 $ bounds ap
afpDim0 <- Call.sizes1 <$> getBounds afp
ipivDim0 <- Call.sizes1 <$> getBounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let n = ipivDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "spsvx: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "spsvx: n*(n+1)`div`2 == afpDim0" (n*(n+1)`div`2 == afpDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
afpPtr <- Call.ioarray afp
ipivPtr <- Call.ioarray ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.spsvx factPtr uploPtr nPtr nrhsPtr apPtr afpPtr ipivPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
sptrf ::
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (CArray Int CInt, Int)
sptrf uplo n ap = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "sptrf: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
ipiv <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.sptrf uploPtr nPtr apPtr ipivPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
sptri ::
Char ->
IOCArray Int (Complex Float) ->
CArray Int CInt ->
IO (Int)
sptri uplo ap ipiv = do
apDim0 <- Call.sizes1 <$> getBounds ap
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = ipivDim0
Call.assert "sptri: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.sptri uploPtr nPtr apPtr ipivPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
sptrs ::
Char ->
CArray Int (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
sptrs uplo ap ipiv b = do
let apDim0 = Call.sizes1 $ bounds ap
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = ipivDim0
let nrhs = bDim0
let ldb = bDim1
Call.assert "sptrs: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.sptrs uploPtr nPtr nrhsPtr apPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
srscl ::
Int ->
Float ->
IOCArray Int (Complex Float) ->
Int ->
IO ()
srscl n sa sx incx = do
sxDim0 <- Call.sizes1 <$> getBounds sx
let _sxSize = sxDim0
evalContT $ do
nPtr <- Call.cint n
saPtr <- Call.float sa
sxPtr <- Call.ioarray sx
incxPtr <- Call.cint incx
liftIO $ Lapack.srscl nPtr saPtr sxPtr incxPtr
stedc ::
Char ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
IO (Int)
stedc compz d e z lwork lrwork liwork = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = dDim0
let ldz = zDim1
Call.assert "stedc: n-1 == eDim0" (n1 == eDim0)
Call.assert "stedc: n == zDim0" (n == zDim0)
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 (maximum[1,lrwork])
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
compzPtr <- Call.char compz
nPtr <- Call.cint n
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.stedc compzPtr nPtr dPtr ePtr zPtr ldzPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr liworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
stegr ::
Char ->
Char ->
IOCArray Int Float ->
IOCArray Int Float ->
Float ->
Float ->
Int ->
Int ->
Float ->
Int ->
Int ->
Int ->
Int ->
IO (Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
stegr jobz range d e vl vu il iu abstol m ldz lwork liwork = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
let n = dDim0
Call.assert "stegr: n == eDim0" (n == eDim0)
w <- Call.newArray1 n
z <- Call.newArray2 (maximum[1,m]) ldz
isuppz <- Call.newArray1 (2*maximum[1,m])
work <- Call.newArray1 lwork
iwork <- Call.newArray1 liwork
evalContT $ do
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
nPtr <- Call.cint n
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
abstolPtr <- Call.float abstol
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
isuppzPtr <- Call.array isuppz
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.stegr jobzPtr rangePtr nPtr dPtr ePtr vlPtr vuPtr ilPtr iuPtr abstolPtr mPtr wPtr zPtr ldzPtr isuppzPtr workPtr lworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,,,,)
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure isuppz
<*> fmap fromIntegral (peek infoPtr)
stein ::
CArray Int Float ->
CArray Int Float ->
Int ->
CArray Int Float ->
CArray Int CInt ->
CArray Int CInt ->
Int ->
IO (CArray (Int,Int) (Complex Float), CArray Int CInt, Int)
stein d e m w iblock isplit ldz = do
let dDim0 = Call.sizes1 $ bounds d
let eDim0 = Call.sizes1 $ bounds e
let wDim0 = Call.sizes1 $ bounds w
let iblockDim0 = Call.sizes1 $ bounds iblock
let isplitDim0 = Call.sizes1 $ bounds isplit
let n = dDim0
Call.assert "stein: n-1 == eDim0" (n1 == eDim0)
Call.assert "stein: n == wDim0" (n == wDim0)
Call.assert "stein: n == iblockDim0" (n == iblockDim0)
Call.assert "stein: n == isplitDim0" (n == isplitDim0)
z <- Call.newArray2 m ldz
work <- Call.newArray1 (5*n)
iwork <- Call.newArray1 n
ifail <- Call.newArray1 m
evalContT $ do
nPtr <- Call.cint n
dPtr <- Call.array d
ePtr <- Call.array e
mPtr <- Call.cint m
wPtr <- Call.array w
iblockPtr <- Call.array iblock
isplitPtr <- Call.array isplit
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
iworkPtr <- Call.array iwork
ifailPtr <- Call.array ifail
infoPtr <- Call.alloca
liftIO $ Lapack.stein nPtr dPtr ePtr mPtr wPtr iblockPtr isplitPtr zPtr ldzPtr workPtr iworkPtr ifailPtr infoPtr
liftIO $ pure (,,)
<*> pure z
<*> pure ifail
<*> fmap fromIntegral (peek infoPtr)
stemr ::
Char ->
Char ->
IOCArray Int Float ->
IOCArray Int Float ->
Float ->
Float ->
Int ->
Int ->
Int ->
Int ->
Int ->
Bool ->
Int ->
Int ->
IO (Int, CArray Int Float, CArray (Int,Int) (Complex Float), CArray Int CInt, Bool, Int)
stemr jobz range d e vl vu il iu m ldz nzc tryrac lwork liwork = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
let n = dDim0
Call.assert "stemr: n == eDim0" (n == eDim0)
w <- Call.newArray1 n
z <- Call.newArray2 (maximum[1,m]) ldz
isuppz <- Call.newArray1 (2*maximum[1,m])
work <- Call.newArray1 lwork
iwork <- Call.newArray1 liwork
evalContT $ do
jobzPtr <- Call.char jobz
rangePtr <- Call.char range
nPtr <- Call.cint n
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
vlPtr <- Call.float vl
vuPtr <- Call.float vu
ilPtr <- Call.cint il
iuPtr <- Call.cint iu
mPtr <- Call.alloca
wPtr <- Call.array w
zPtr <- Call.array z
ldzPtr <- Call.cint ldz
nzcPtr <- Call.cint nzc
isuppzPtr <- Call.array isuppz
tryracPtr <- Call.bool tryrac
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.stemr jobzPtr rangePtr nPtr dPtr ePtr vlPtr vuPtr ilPtr iuPtr mPtr wPtr zPtr ldzPtr nzcPtr isuppzPtr tryracPtr workPtr lworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> fmap fromIntegral (peek mPtr)
<*> pure w
<*> pure z
<*> pure isuppz
<*> peek tryracPtr
<*> fmap fromIntegral (peek infoPtr)
steqr ::
Char ->
IOCArray Int Float ->
IOCArray Int Float ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
steqr compz d e z = do
dDim0 <- Call.sizes1 <$> getBounds d
eDim0 <- Call.sizes1 <$> getBounds e
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = dDim0
let ldz = zDim1
Call.assert "steqr: n-1 == eDim0" (n1 == eDim0)
Call.assert "steqr: n == zDim0" (n == zDim0)
work <- Call.newArray1 (maximum[1,2*n2])
evalContT $ do
compzPtr <- Call.char compz
nPtr <- Call.cint n
dPtr <- Call.ioarray d
ePtr <- Call.ioarray e
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.steqr compzPtr nPtr dPtr ePtr zPtr ldzPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
sycon ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
Float ->
IO (Float, Int)
sycon uplo a ipiv anorm = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "sycon: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
anormPtr <- Call.float anorm
rcondPtr <- Call.alloca
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.sycon uploPtr nPtr aPtr ldaPtr ipivPtr anormPtr rcondPtr workPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
syconv ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IO (CArray Int (Complex Float), Int)
syconv uplo way a ipiv = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "syconv: n == ipivDim0" (n == ipivDim0)
e <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
wayPtr <- Call.char way
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
ePtr <- Call.array e
infoPtr <- Call.alloca
liftIO $ Lapack.syconv uploPtr wayPtr nPtr aPtr ldaPtr ipivPtr ePtr infoPtr
liftIO $ pure (,)
<*> pure e
<*> fmap fromIntegral (peek infoPtr)
syequb ::
Char ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, Float, Float, Int)
syequb uplo a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
s <- Call.newArray1 n
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
sPtr <- Call.array s
scondPtr <- Call.alloca
amaxPtr <- Call.alloca
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.syequb uploPtr nPtr aPtr ldaPtr sPtr scondPtr amaxPtr workPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> peek scondPtr
<*> peek amaxPtr
<*> fmap fromIntegral (peek infoPtr)
symv ::
Char ->
Complex Float ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
Complex Float ->
IOCArray Int (Complex 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.complexFloat alpha
aPtr <- Call.array a
ldaPtr <- Call.cint lda
xPtr <- Call.array x
incxPtr <- Call.cint incx
betaPtr <- Call.complexFloat beta
yPtr <- Call.ioarray y
incyPtr <- Call.cint incy
liftIO $ Lapack.symv uploPtr nPtr alphaPtr aPtr ldaPtr xPtr incxPtr betaPtr yPtr incyPtr
syr ::
Char ->
Complex Float ->
CArray Int (Complex Float) ->
Int ->
IOCArray (Int,Int) (Complex 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.complexFloat alpha
xPtr <- Call.array x
incxPtr <- Call.cint incx
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
liftIO $ Lapack.syr uploPtr nPtr alphaPtr xPtr incxPtr aPtr ldaPtr
syrfs ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
syrfs uplo a af ipiv b x = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (afDim0,afDim1) = Call.sizes2 $ bounds af
let ipivDim0 = Call.sizes1 $ bounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(xDim0,xDim1) <- Call.sizes2 <$> getBounds x
let n = aDim0
let lda = aDim1
let ldaf = afDim1
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "syrfs: n == afDim0" (n == afDim0)
Call.assert "syrfs: n == ipivDim0" (n == ipivDim0)
Call.assert "syrfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
afPtr <- Call.array af
ldafPtr <- Call.cint ldaf
ipivPtr <- Call.array ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.ioarray x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.syrfs uploPtr nPtr nrhsPtr aPtr ldaPtr afPtr ldafPtr ipivPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
sysv ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int CInt, Int)
sysv uplo a b lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
ipiv <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.sysv uploPtr nPtr nrhsPtr aPtr ldaPtr ipivPtr bPtr ldbPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
sysvx ::
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray Int CInt ->
CArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray (Int,Int) (Complex Float), Float, CArray Int Float, CArray Int Float, Int)
sysvx fact uplo a af ipiv b ldx lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
(afDim0,afDim1) <- Call.sizes2 <$> getBounds af
ipivDim0 <- Call.sizes1 <$> getBounds ipiv
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let n = aDim0
let lda = aDim1
let ldaf = afDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "sysvx: n == afDim0" (n == afDim0)
Call.assert "sysvx: n == ipivDim0" (n == ipivDim0)
x <- Call.newArray2 nrhs ldx
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 n
evalContT $ do
factPtr <- Call.char fact
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
afPtr <- Call.ioarray af
ldafPtr <- Call.cint ldaf
ipivPtr <- Call.ioarray ipiv
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
rcondPtr <- Call.alloca
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.sysvx factPtr uploPtr nPtr nrhsPtr aPtr ldaPtr afPtr ldafPtr ipivPtr bPtr ldbPtr xPtr ldxPtr rcondPtr ferrPtr berrPtr workPtr lworkPtr rworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure x
<*> peek rcondPtr
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
syswapr ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO ()
syswapr uplo a i1 i2 = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
i1Ptr <- Call.cint i1
i2Ptr <- Call.cint i2
liftIO $ Lapack.syswapr uploPtr nPtr aPtr ldaPtr i1Ptr i2Ptr
sytf2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int CInt, Int)
sytf2 uplo a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
infoPtr <- Call.alloca
liftIO $ Lapack.sytf2 uploPtr nPtr aPtr ldaPtr ipivPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
sytrf ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int CInt, Int)
sytrf uplo a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
ipiv <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.sytrf uploPtr nPtr aPtr ldaPtr ipivPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure ipiv
<*> fmap fromIntegral (peek infoPtr)
sytri ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IO (Int)
sytri uplo a ipiv = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "sytri: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 (2*n)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.sytri uploPtr nPtr aPtr ldaPtr ipivPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
sytri2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
Int ->
Int ->
IO (Int)
sytri2 uplo a ipiv nb lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "sytri2: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 (n+nb+1)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.sytri2 uploPtr nPtr aPtr ldaPtr ipivPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
sytri2x ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
Int ->
IO (Int)
sytri2x uplo a ipiv nb = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
let n = aDim0
let lda = aDim1
Call.assert "sytri2x: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray2 (nb+3) (n+nb+1)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
workPtr <- Call.array work
nbPtr <- Call.cint nb
infoPtr <- Call.alloca
liftIO $ Lapack.sytri2x uploPtr nPtr aPtr ldaPtr ipivPtr workPtr nbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
sytrs ::
Char ->
CArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
sytrs uplo a ipiv b = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "sytrs: n == ipivDim0" (n == ipivDim0)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.sytrs uploPtr nPtr nrhsPtr aPtr ldaPtr ipivPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
sytrs2 ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int CInt ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
sytrs2 uplo a ipiv b = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let ipivDim0 = Call.sizes1 $ bounds ipiv
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
Call.assert "sytrs2: n == ipivDim0" (n == ipivDim0)
work <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
ipivPtr <- Call.array ipiv
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.sytrs2 uploPtr nPtr nrhsPtr aPtr ldaPtr ipivPtr bPtr ldbPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
tbcon ::
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
IO (Float, Int)
tbcon norm uplo diag kd ab = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let n = abDim0
let ldab = abDim1
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
kdPtr <- Call.cint kd
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
rcondPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.tbcon normPtr uploPtr diagPtr nPtr kdPtr abPtr ldabPtr rcondPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
tbrfs ::
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
tbrfs uplo trans diag kd ab b x = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let (xDim0,xDim1) = Call.sizes2 $ bounds x
let n = abDim0
let ldab = abDim1
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "tbrfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
kdPtr <- Call.cint kd
nrhsPtr <- Call.cint nrhs
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.tbrfs uploPtr transPtr diagPtr nPtr kdPtr nrhsPtr abPtr ldabPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
tbtrs ::
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
tbtrs uplo trans diag kd ab b = do
let (abDim0,abDim1) = Call.sizes2 $ bounds ab
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = abDim0
let ldab = abDim1
let nrhs = bDim0
let ldb = bDim1
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
kdPtr <- Call.cint kd
nrhsPtr <- Call.cint nrhs
abPtr <- Call.array ab
ldabPtr <- Call.cint ldab
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.tbtrs uploPtr transPtr diagPtr nPtr kdPtr nrhsPtr abPtr ldabPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
tfsm ::
Char ->
Char ->
Char ->
Char ->
Char ->
Int ->
Complex Float ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO ()
tfsm transr side uplo trans diag m alpha a b = do
let aDim0 = Call.sizes1 $ bounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = bDim0
let ldb = bDim1
Call.assert "tfsm: n*(n+1)`div`2 == aDim0" (n*(n+1)`div`2 == aDim0)
evalContT $ do
transrPtr <- Call.char transr
sidePtr <- Call.char side
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
mPtr <- Call.cint m
nPtr <- Call.cint n
alphaPtr <- Call.complexFloat alpha
aPtr <- Call.array a
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
liftIO $ Lapack.tfsm transrPtr sidePtr uploPtr transPtr diagPtr mPtr nPtr alphaPtr aPtr bPtr ldbPtr
tftri ::
Char ->
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (Int)
tftri transr uplo diag n a = do
aDim0 <- Call.sizes1 <$> getBounds a
Call.assert "tftri: n*(n+1)`div`2 == aDim0" (n*(n+1)`div`2 == aDim0)
evalContT $ do
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
aPtr <- Call.ioarray a
infoPtr <- Call.alloca
liftIO $ Lapack.tftri transrPtr uploPtr diagPtr nPtr aPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
tfttp ::
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
IO (CArray Int (Complex Float), Int)
tfttp transr uplo n arf = do
let arfDim0 = Call.sizes1 $ bounds arf
Call.assert "tfttp: n*(n+1)`div`2 == arfDim0" (n*(n+1)`div`2 == arfDim0)
ap <- Call.newArray1 (n*(n+1)`div`2)
evalContT $ do
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
nPtr <- Call.cint n
arfPtr <- Call.array arf
apPtr <- Call.array ap
infoPtr <- Call.alloca
liftIO $ Lapack.tfttp transrPtr uploPtr nPtr arfPtr apPtr infoPtr
liftIO $ pure (,)
<*> pure ap
<*> fmap fromIntegral (peek infoPtr)
tfttr ::
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int)
tfttr transr uplo n arf lda = do
let arfDim0 = Call.sizes1 $ bounds arf
Call.assert "tfttr: n*(n+1)`div`2 == arfDim0" (n*(n+1)`div`2 == arfDim0)
a <- Call.newArray2 n lda
evalContT $ do
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
nPtr <- Call.cint n
arfPtr <- Call.array arf
aPtr <- Call.array a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.tfttr transrPtr uploPtr nPtr arfPtr aPtr ldaPtr infoPtr
liftIO $ pure (,)
<*> pure a
<*> fmap fromIntegral (peek infoPtr)
tgevc ::
Char ->
Char ->
CArray Int Bool ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int, Int)
tgevc side howmny select s p vl vr = do
let selectDim0 = Call.sizes1 $ bounds select
let (sDim0,sDim1) = Call.sizes2 $ bounds s
let (pDim0,pDim1) = Call.sizes2 $ bounds p
(vlDim0,vlDim1) <- Call.sizes2 <$> getBounds vl
(vrDim0,vrDim1) <- Call.sizes2 <$> getBounds vr
let n = selectDim0
let lds = sDim1
let ldp = pDim1
let mm = vlDim0
let ldvl = vlDim1
let ldvr = vrDim1
Call.assert "tgevc: n == sDim0" (n == sDim0)
Call.assert "tgevc: n == pDim0" (n == pDim0)
Call.assert "tgevc: mm == vrDim0" (mm == vrDim0)
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 (2*n)
evalContT $ do
sidePtr <- Call.char side
howmnyPtr <- Call.char howmny
selectPtr <- Call.array select
nPtr <- Call.cint n
sPtr <- Call.array s
ldsPtr <- Call.cint lds
pPtr <- Call.array p
ldpPtr <- Call.cint ldp
vlPtr <- Call.ioarray vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.ioarray vr
ldvrPtr <- Call.cint ldvr
mmPtr <- Call.cint mm
mPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.tgevc sidePtr howmnyPtr selectPtr nPtr sPtr ldsPtr pPtr ldpPtr vlPtr ldvlPtr vrPtr ldvrPtr mmPtr mPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> fmap fromIntegral (peek mPtr)
<*> fmap fromIntegral (peek infoPtr)
tgex2 ::
Bool ->
Bool ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
tgex2 wantq wantz a b q z j1 = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = aDim0
let lda = aDim1
let ldb = bDim1
let ldq = qDim1
let ldz = zDim1
Call.assert "tgex2: n == bDim0" (n == bDim0)
Call.assert "tgex2: n == qDim0" (n == qDim0)
Call.assert "tgex2: n == zDim0" (n == zDim0)
evalContT $ do
wantqPtr <- Call.bool wantq
wantzPtr <- Call.bool wantz
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
j1Ptr <- Call.cint j1
infoPtr <- Call.alloca
liftIO $ Lapack.tgex2 wantqPtr wantzPtr nPtr aPtr ldaPtr bPtr ldbPtr qPtr ldqPtr zPtr ldzPtr j1Ptr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
tgexc ::
Bool ->
Bool ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (Int, Int)
tgexc wantq wantz a b q z ifst ilst = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = aDim0
let lda = aDim1
let ldb = bDim1
let ldq = qDim1
let ldz = zDim1
Call.assert "tgexc: n == bDim0" (n == bDim0)
Call.assert "tgexc: n == qDim0" (n == qDim0)
Call.assert "tgexc: n == zDim0" (n == zDim0)
evalContT $ do
wantqPtr <- Call.bool wantq
wantzPtr <- Call.bool wantz
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
ifstPtr <- Call.cint ifst
ilstPtr <- Call.cint ilst
infoPtr <- Call.alloca
liftIO $ Lapack.tgexc wantqPtr wantzPtr nPtr aPtr ldaPtr bPtr ldbPtr qPtr ldqPtr zPtr ldzPtr ifstPtr ilstPtr infoPtr
liftIO $ pure (,)
<*> fmap fromIntegral (peek ilstPtr)
<*> fmap fromIntegral (peek infoPtr)
tgsen ::
Int ->
Bool ->
Bool ->
CArray Int Bool ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray Int (Complex Float), CArray Int (Complex Float), Int, Float, Float, CArray Int Float, Int)
tgsen ijob wantq wantz select a b q z lwork liwork = do
let selectDim0 = Call.sizes1 $ bounds select
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
(zDim0,zDim1) <- Call.sizes2 <$> getBounds z
let n = selectDim0
let lda = aDim1
let ldb = bDim1
let ldq = qDim1
let ldz = zDim1
Call.assert "tgsen: n == aDim0" (n == aDim0)
Call.assert "tgsen: n == bDim0" (n == bDim0)
Call.assert "tgsen: n == qDim0" (n == qDim0)
Call.assert "tgsen: n == zDim0" (n == zDim0)
alpha <- Call.newArray1 n
beta <- Call.newArray1 n
dif <- Call.newArray1 2
work <- Call.newArray1 (maximum[1,lwork])
iwork <- Call.newArray1 (maximum[1,liwork])
evalContT $ do
ijobPtr <- Call.cint ijob
wantqPtr <- Call.bool wantq
wantzPtr <- Call.bool wantz
selectPtr <- Call.array select
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
alphaPtr <- Call.array alpha
betaPtr <- Call.array beta
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
zPtr <- Call.ioarray z
ldzPtr <- Call.cint ldz
mPtr <- Call.alloca
plPtr <- Call.alloca
prPtr <- Call.alloca
difPtr <- Call.array dif
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
iworkPtr <- Call.array iwork
liworkPtr <- Call.cint liwork
infoPtr <- Call.alloca
liftIO $ Lapack.tgsen ijobPtr wantqPtr wantzPtr selectPtr nPtr aPtr ldaPtr bPtr ldbPtr alphaPtr betaPtr qPtr ldqPtr zPtr ldzPtr mPtr plPtr prPtr difPtr workPtr lworkPtr iworkPtr liworkPtr infoPtr
liftIO $ pure (,,,,,,)
<*> pure alpha
<*> pure beta
<*> fmap fromIntegral (peek mPtr)
<*> peek plPtr
<*> peek prPtr
<*> pure dif
<*> fmap fromIntegral (peek infoPtr)
tgsja ::
Char ->
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Float ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int, Int)
tgsja jobu jobv jobq k l a b tola tolb u v q = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
(uDim0,uDim1) <- Call.sizes2 <$> getBounds u
(vDim0,vDim1) <- Call.sizes2 <$> getBounds v
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
let n = aDim0
let lda = aDim1
let ldb = bDim1
let m = uDim0
let ldu = uDim1
let p = vDim0
let ldv = vDim1
let ldq = qDim1
Call.assert "tgsja: n == bDim0" (n == bDim0)
Call.assert "tgsja: n == qDim0" (n == qDim0)
alpha <- Call.newArray1 n
beta <- Call.newArray1 n
work <- Call.newArray1 (2*n)
evalContT $ do
jobuPtr <- Call.char jobu
jobvPtr <- Call.char jobv
jobqPtr <- Call.char jobq
mPtr <- Call.cint m
pPtr <- Call.cint p
nPtr <- Call.cint n
kPtr <- Call.cint k
lPtr <- Call.cint l
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
tolaPtr <- Call.float tola
tolbPtr <- Call.float tolb
alphaPtr <- Call.array alpha
betaPtr <- Call.array beta
uPtr <- Call.ioarray u
lduPtr <- Call.cint ldu
vPtr <- Call.ioarray v
ldvPtr <- Call.cint ldv
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
workPtr <- Call.array work
ncyclePtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.tgsja jobuPtr jobvPtr jobqPtr mPtr pPtr nPtr kPtr lPtr aPtr ldaPtr bPtr ldbPtr tolaPtr tolbPtr alphaPtr betaPtr uPtr lduPtr vPtr ldvPtr qPtr ldqPtr workPtr ncyclePtr infoPtr
liftIO $ pure (,,,)
<*> pure alpha
<*> pure beta
<*> fmap fromIntegral (peek ncyclePtr)
<*> fmap fromIntegral (peek infoPtr)
tgsna ::
Char ->
Char ->
CArray Int Bool ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray Int Float, CArray Int Float, Int, Int)
tgsna job howmny select a b vl vr mm lwork = do
let selectDim0 = Call.sizes1 $ bounds select
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let (vlDim0,vlDim1) = Call.sizes2 $ bounds vl
let (vrDim0,vrDim1) = Call.sizes2 $ bounds vr
let n = selectDim0
let lda = aDim1
let ldb = bDim1
let m = vlDim0
let ldvl = vlDim1
let ldvr = vrDim1
Call.assert "tgsna: n == aDim0" (n == aDim0)
Call.assert "tgsna: n == bDim0" (n == bDim0)
Call.assert "tgsna: m == vrDim0" (m == vrDim0)
s <- Call.newArray1 mm
dif <- Call.newArray1 mm
work <- Call.newArray1 (maximum[1,lwork])
iwork <- Call.newArray1 (n+2)
evalContT $ do
jobPtr <- Call.char job
howmnyPtr <- Call.char howmny
selectPtr <- Call.array select
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
vlPtr <- Call.array vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.array vr
ldvrPtr <- Call.cint ldvr
sPtr <- Call.array s
difPtr <- Call.array dif
mmPtr <- Call.cint mm
mPtr <- Call.alloca
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.tgsna jobPtr howmnyPtr selectPtr nPtr aPtr ldaPtr bPtr ldbPtr vlPtr ldvlPtr vrPtr ldvrPtr sPtr difPtr mmPtr mPtr workPtr lworkPtr iworkPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> pure dif
<*> fmap fromIntegral (peek mPtr)
<*> fmap fromIntegral (peek infoPtr)
tgsy2 ::
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Float ->
Float ->
IO (Float, Float, Float, Int)
tgsy2 trans ijob a b c d e f rdsum rdscal = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let (dDim0,dDim1) = Call.sizes2 $ bounds d
let (eDim0,eDim1) = Call.sizes2 $ bounds e
(fDim0,fDim1) <- Call.sizes2 <$> getBounds f
let m = aDim0
let lda = aDim1
let n = bDim0
let ldb = bDim1
let ldc = cDim1
let ldd = dDim1
let lde = eDim1
let ldf = fDim1
Call.assert "tgsy2: n == cDim0" (n == cDim0)
Call.assert "tgsy2: m == dDim0" (m == dDim0)
Call.assert "tgsy2: n == eDim0" (n == eDim0)
Call.assert "tgsy2: n == fDim0" (n == fDim0)
evalContT $ do
transPtr <- Call.char trans
ijobPtr <- Call.cint ijob
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
dPtr <- Call.array d
lddPtr <- Call.cint ldd
ePtr <- Call.array e
ldePtr <- Call.cint lde
fPtr <- Call.ioarray f
ldfPtr <- Call.cint ldf
scalePtr <- Call.alloca
rdsumPtr <- Call.float rdsum
rdscalPtr <- Call.float rdscal
infoPtr <- Call.alloca
liftIO $ Lapack.tgsy2 transPtr ijobPtr mPtr nPtr aPtr ldaPtr bPtr ldbPtr cPtr ldcPtr dPtr lddPtr ePtr ldePtr fPtr ldfPtr scalePtr rdsumPtr rdscalPtr infoPtr
liftIO $ pure (,,,)
<*> peek scalePtr
<*> peek rdsumPtr
<*> peek rdscalPtr
<*> fmap fromIntegral (peek infoPtr)
tgsyl ::
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Float, Float, Int)
tgsyl trans ijob a b c d e f lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let (dDim0,dDim1) = Call.sizes2 $ bounds d
let (eDim0,eDim1) = Call.sizes2 $ bounds e
(fDim0,fDim1) <- Call.sizes2 <$> getBounds f
let m = aDim0
let lda = aDim1
let n = bDim0
let ldb = bDim1
let ldc = cDim1
let ldd = dDim1
let lde = eDim1
let ldf = fDim1
Call.assert "tgsyl: n == cDim0" (n == cDim0)
Call.assert "tgsyl: m == dDim0" (m == dDim0)
Call.assert "tgsyl: n == eDim0" (n == eDim0)
Call.assert "tgsyl: n == fDim0" (n == fDim0)
work <- Call.newArray1 (maximum[1,lwork])
iwork <- Call.newArray1 (m+n+2)
evalContT $ do
transPtr <- Call.char trans
ijobPtr <- Call.cint ijob
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
dPtr <- Call.array d
lddPtr <- Call.cint ldd
ePtr <- Call.array e
ldePtr <- Call.cint lde
fPtr <- Call.ioarray f
ldfPtr <- Call.cint ldf
scalePtr <- Call.alloca
difPtr <- Call.alloca
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.tgsyl transPtr ijobPtr mPtr nPtr aPtr ldaPtr bPtr ldbPtr cPtr ldcPtr dPtr lddPtr ePtr ldePtr fPtr ldfPtr scalePtr difPtr workPtr lworkPtr iworkPtr infoPtr
liftIO $ pure (,,)
<*> peek scalePtr
<*> peek difPtr
<*> fmap fromIntegral (peek infoPtr)
tpcon ::
Char ->
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
IO (Float, Int)
tpcon norm uplo diag n ap = do
let apDim0 = Call.sizes1 $ bounds ap
Call.assert "tpcon: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
apPtr <- Call.array ap
rcondPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.tpcon normPtr uploPtr diagPtr nPtr apPtr rcondPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
tprfs ::
Char ->
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
tprfs uplo trans diag n ap b x = do
let apDim0 = Call.sizes1 $ bounds ap
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let (xDim0,xDim1) = Call.sizes2 $ bounds x
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "tprfs: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "tprfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.tprfs uploPtr transPtr diagPtr nPtr nrhsPtr apPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
tptri ::
Char ->
Char ->
Int ->
IOCArray Int (Complex Float) ->
IO (Int)
tptri uplo diag n ap = do
apDim0 <- Call.sizes1 <$> getBounds ap
Call.assert "tptri: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
apPtr <- Call.ioarray ap
infoPtr <- Call.alloca
liftIO $ Lapack.tptri uploPtr diagPtr nPtr apPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
tptrs ::
Char ->
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
tptrs uplo trans diag n ap b = do
let apDim0 = Call.sizes1 $ bounds ap
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let nrhs = bDim0
let ldb = bDim1
Call.assert "tptrs: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
apPtr <- Call.array ap
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.tptrs uploPtr transPtr diagPtr nPtr nrhsPtr apPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
tpttf ::
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
IO (CArray Int (Complex Float), Int)
tpttf transr uplo n ap = do
let apDim0 = Call.sizes1 $ bounds ap
Call.assert "tpttf: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
arf <- Call.newArray1 (n*(n+1)`div`2)
evalContT $ do
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
arfPtr <- Call.array arf
infoPtr <- Call.alloca
liftIO $ Lapack.tpttf transrPtr uploPtr nPtr apPtr arfPtr infoPtr
liftIO $ pure (,)
<*> pure arf
<*> fmap fromIntegral (peek infoPtr)
tpttr ::
Char ->
Int ->
CArray Int (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int)
tpttr uplo n ap lda = do
let apDim0 = Call.sizes1 $ bounds ap
Call.assert "tpttr: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
a <- Call.newArray2 n lda
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
aPtr <- Call.array a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.tpttr uploPtr nPtr apPtr aPtr ldaPtr infoPtr
liftIO $ pure (,)
<*> pure a
<*> fmap fromIntegral (peek infoPtr)
trcon ::
Char ->
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
IO (Float, Int)
trcon norm uplo diag a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
normPtr <- Call.char norm
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
rcondPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.trcon normPtr uploPtr diagPtr nPtr aPtr ldaPtr rcondPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> peek rcondPtr
<*> fmap fromIntegral (peek infoPtr)
trevc ::
Char ->
Char ->
CArray Int Bool ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int, Int)
trevc side howmny select t vl vr = do
let selectDim0 = Call.sizes1 $ bounds select
(tDim0,tDim1) <- Call.sizes2 <$> getBounds t
(vlDim0,vlDim1) <- Call.sizes2 <$> getBounds vl
(vrDim0,vrDim1) <- Call.sizes2 <$> getBounds vr
let n = selectDim0
let ldt = tDim1
let mm = vlDim0
let ldvl = vlDim1
let ldvr = vrDim1
Call.assert "trevc: n == tDim0" (n == tDim0)
Call.assert "trevc: mm == vrDim0" (mm == vrDim0)
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
sidePtr <- Call.char side
howmnyPtr <- Call.char howmny
selectPtr <- Call.array select
nPtr <- Call.cint n
tPtr <- Call.ioarray t
ldtPtr <- Call.cint ldt
vlPtr <- Call.ioarray vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.ioarray vr
ldvrPtr <- Call.cint ldvr
mmPtr <- Call.cint mm
mPtr <- Call.alloca
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.trevc sidePtr howmnyPtr selectPtr nPtr tPtr ldtPtr vlPtr ldvlPtr vrPtr ldvrPtr mmPtr mPtr workPtr rworkPtr infoPtr
liftIO $ pure (,)
<*> fmap fromIntegral (peek mPtr)
<*> fmap fromIntegral (peek infoPtr)
trexc ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (Int)
trexc compq t q ifst ilst = do
(tDim0,tDim1) <- Call.sizes2 <$> getBounds t
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
let n = tDim0
let ldt = tDim1
let ldq = qDim1
Call.assert "trexc: n == qDim0" (n == qDim0)
evalContT $ do
compqPtr <- Call.char compq
nPtr <- Call.cint n
tPtr <- Call.ioarray t
ldtPtr <- Call.cint ldt
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
ifstPtr <- Call.cint ifst
ilstPtr <- Call.cint ilst
infoPtr <- Call.alloca
liftIO $ Lapack.trexc compqPtr nPtr tPtr ldtPtr qPtr ldqPtr ifstPtr ilstPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
trrfs ::
Char ->
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int Float, CArray Int Float, Int)
trrfs uplo trans diag a b x = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
let (xDim0,xDim1) = Call.sizes2 $ bounds x
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
let ldx = xDim1
Call.assert "trrfs: nrhs == xDim0" (nrhs == xDim0)
ferr <- Call.newArray1 nrhs
berr <- Call.newArray1 nrhs
work <- Call.newArray1 (2*n)
rwork <- Call.newArray1 n
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
xPtr <- Call.array x
ldxPtr <- Call.cint ldx
ferrPtr <- Call.array ferr
berrPtr <- Call.array berr
workPtr <- Call.array work
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.trrfs uploPtr transPtr diagPtr nPtr nrhsPtr aPtr ldaPtr bPtr ldbPtr xPtr ldxPtr ferrPtr berrPtr workPtr rworkPtr infoPtr
liftIO $ pure (,,)
<*> pure ferr
<*> pure berr
<*> fmap fromIntegral (peek infoPtr)
trsen ::
Char ->
Char ->
CArray Int Bool ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int, Float, Float, Int)
trsen job compq select t q lwork = do
let selectDim0 = Call.sizes1 $ bounds select
(tDim0,tDim1) <- Call.sizes2 <$> getBounds t
(qDim0,qDim1) <- Call.sizes2 <$> getBounds q
let n = selectDim0
let ldt = tDim1
let ldq = qDim1
Call.assert "trsen: n == tDim0" (n == tDim0)
Call.assert "trsen: n == qDim0" (n == qDim0)
w <- Call.newArray1 n
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
jobPtr <- Call.char job
compqPtr <- Call.char compq
selectPtr <- Call.array select
nPtr <- Call.cint n
tPtr <- Call.ioarray t
ldtPtr <- Call.cint ldt
qPtr <- Call.ioarray q
ldqPtr <- Call.cint ldq
wPtr <- Call.array w
mPtr <- Call.alloca
sPtr <- Call.alloca
sepPtr <- Call.alloca
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.trsen jobPtr compqPtr selectPtr nPtr tPtr ldtPtr qPtr ldqPtr wPtr mPtr sPtr sepPtr workPtr lworkPtr infoPtr
liftIO $ pure (,,,,)
<*> pure w
<*> fmap fromIntegral (peek mPtr)
<*> peek sPtr
<*> peek sepPtr
<*> fmap fromIntegral (peek infoPtr)
trsna ::
Char ->
Char ->
CArray Int Bool ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
Int ->
Int ->
IO (CArray Int Float, CArray Int Float, Int, Int)
trsna job howmny select t vl vr mm ldwork = do
let selectDim0 = Call.sizes1 $ bounds select
let (tDim0,tDim1) = Call.sizes2 $ bounds t
let (vlDim0,vlDim1) = Call.sizes2 $ bounds vl
let (vrDim0,vrDim1) = Call.sizes2 $ bounds vr
let n = selectDim0
let ldt = tDim1
let m = vlDim0
let ldvl = vlDim1
let ldvr = vrDim1
Call.assert "trsna: n == tDim0" (n == tDim0)
Call.assert "trsna: m == vrDim0" (m == vrDim0)
s <- Call.newArray1 mm
sep <- Call.newArray1 mm
work <- Call.newArray2 (n+6) ldwork
rwork <- Call.newArray1 n
evalContT $ do
jobPtr <- Call.char job
howmnyPtr <- Call.char howmny
selectPtr <- Call.array select
nPtr <- Call.cint n
tPtr <- Call.array t
ldtPtr <- Call.cint ldt
vlPtr <- Call.array vl
ldvlPtr <- Call.cint ldvl
vrPtr <- Call.array vr
ldvrPtr <- Call.cint ldvr
sPtr <- Call.array s
sepPtr <- Call.array sep
mmPtr <- Call.cint mm
mPtr <- Call.alloca
workPtr <- Call.array work
ldworkPtr <- Call.cint ldwork
rworkPtr <- Call.array rwork
infoPtr <- Call.alloca
liftIO $ Lapack.trsna jobPtr howmnyPtr selectPtr nPtr tPtr ldtPtr vlPtr ldvlPtr vrPtr ldvrPtr sPtr sepPtr mmPtr mPtr workPtr ldworkPtr rworkPtr infoPtr
liftIO $ pure (,,,)
<*> pure s
<*> pure sep
<*> fmap fromIntegral (peek mPtr)
<*> fmap fromIntegral (peek infoPtr)
trsyl ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Float, Int)
trsyl trana tranb isgn a b c = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let (bDim0,bDim1) = Call.sizes2 $ bounds b
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let m = aDim0
let lda = aDim1
let n = bDim0
let ldb = bDim1
let ldc = cDim1
Call.assert "trsyl: n == cDim0" (n == cDim0)
evalContT $ do
tranaPtr <- Call.char trana
tranbPtr <- Call.char tranb
isgnPtr <- Call.cint isgn
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.array b
ldbPtr <- Call.cint ldb
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
scalePtr <- Call.alloca
infoPtr <- Call.alloca
liftIO $ Lapack.trsyl tranaPtr tranbPtr isgnPtr mPtr nPtr aPtr ldaPtr bPtr ldbPtr cPtr ldcPtr scalePtr infoPtr
liftIO $ pure (,)
<*> peek scalePtr
<*> fmap fromIntegral (peek infoPtr)
trti2 ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
trti2 uplo diag a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.trti2 uploPtr diagPtr nPtr aPtr ldaPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
trtri ::
Char ->
Char ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
trtri uplo diag a = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
evalContT $ do
uploPtr <- Call.char uplo
diagPtr <- Call.char diag
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
infoPtr <- Call.alloca
liftIO $ Lapack.trtri uploPtr diagPtr nPtr aPtr ldaPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
trtrs ::
Char ->
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IO (Int)
trtrs uplo trans diag a b = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
(bDim0,bDim1) <- Call.sizes2 <$> getBounds b
let n = aDim0
let lda = aDim1
let nrhs = bDim0
let ldb = bDim1
evalContT $ do
uploPtr <- Call.char uplo
transPtr <- Call.char trans
diagPtr <- Call.char diag
nPtr <- Call.cint n
nrhsPtr <- Call.cint nrhs
aPtr <- Call.array a
ldaPtr <- Call.cint lda
bPtr <- Call.ioarray b
ldbPtr <- Call.cint ldb
infoPtr <- Call.alloca
liftIO $ Lapack.trtrs uploPtr transPtr diagPtr nPtr nrhsPtr aPtr ldaPtr bPtr ldbPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
trttf ::
Char ->
Char ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
trttf transr uplo a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
arf <- Call.newArray1 (n*(n+1)`div`2)
evalContT $ do
transrPtr <- Call.char transr
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
arfPtr <- Call.array arf
infoPtr <- Call.alloca
liftIO $ Lapack.trttf transrPtr uploPtr nPtr aPtr ldaPtr arfPtr infoPtr
liftIO $ pure (,)
<*> pure arf
<*> fmap fromIntegral (peek infoPtr)
trttp ::
Char ->
CArray (Int,Int) (Complex Float) ->
IO (CArray Int (Complex Float), Int)
trttp uplo a = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let n = aDim0
let lda = aDim1
ap <- Call.newArray1 (n*(n+1)`div`2)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
apPtr <- Call.array ap
infoPtr <- Call.alloca
liftIO $ Lapack.trttp uploPtr nPtr aPtr ldaPtr apPtr infoPtr
liftIO $ pure (,)
<*> pure ap
<*> fmap fromIntegral (peek infoPtr)
tzrzf ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int (Complex Float), Int)
tzrzf m a lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let n = aDim0
let lda = aDim1
tau <- Call.newArray1 m
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.tzrzf mPtr nPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ pure (,)
<*> pure tau
<*> fmap fromIntegral (peek infoPtr)
unbdb ::
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (CArray Int Float, CArray Int Float, CArray Int (Complex Float), CArray Int (Complex Float), CArray Int (Complex Float), CArray Int (Complex Float), Int)
unbdb trans signs m p x11 x12 x21 x22 lwork = do
(x11Dim0,x11Dim1) <- Call.sizes2 <$> getBounds x11
(x12Dim0,x12Dim1) <- Call.sizes2 <$> getBounds x12
(x21Dim0,x21Dim1) <- Call.sizes2 <$> getBounds x21
(x22Dim0,x22Dim1) <- Call.sizes2 <$> getBounds x22
let q = x11Dim0
let ldx11 = x11Dim1
let ldx12 = x12Dim1
let ldx21 = x21Dim1
let ldx22 = x22Dim1
Call.assert "unbdb: m-q == x12Dim0" (mq == x12Dim0)
Call.assert "unbdb: q == x21Dim0" (q == x21Dim0)
Call.assert "unbdb: m-q == x22Dim0" (mq == x22Dim0)
theta <- Call.newArray1 q
phi <- Call.newArray1 (q1)
taup1 <- Call.newArray1 p
taup2 <- Call.newArray1 (mp)
tauq1 <- Call.newArray1 q
tauq2 <- Call.newArray1 (mq)
work <- Call.newArray1 lwork
evalContT $ do
transPtr <- Call.char trans
signsPtr <- Call.char signs
mPtr <- Call.cint m
pPtr <- Call.cint p
qPtr <- Call.cint q
x11Ptr <- Call.ioarray x11
ldx11Ptr <- Call.cint ldx11
x12Ptr <- Call.ioarray x12
ldx12Ptr <- Call.cint ldx12
x21Ptr <- Call.ioarray x21
ldx21Ptr <- Call.cint ldx21
x22Ptr <- Call.ioarray x22
ldx22Ptr <- Call.cint ldx22
thetaPtr <- Call.array theta
phiPtr <- Call.array phi
taup1Ptr <- Call.array taup1
taup2Ptr <- Call.array taup2
tauq1Ptr <- Call.array tauq1
tauq2Ptr <- Call.array tauq2
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unbdb transPtr signsPtr mPtr pPtr qPtr x11Ptr ldx11Ptr x12Ptr ldx12Ptr x21Ptr ldx21Ptr x22Ptr ldx22Ptr thetaPtr phiPtr taup1Ptr taup2Ptr tauq1Ptr tauq2Ptr workPtr lworkPtr infoPtr
liftIO $ pure (,,,,,,)
<*> pure theta
<*> pure phi
<*> pure taup1
<*> pure taup2
<*> pure tauq1
<*> pure tauq2
<*> fmap fromIntegral (peek infoPtr)
uncsd ::
Char ->
Char ->
Char ->
Char ->
Char ->
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
Int ->
Int ->
Int ->
Int ->
Int ->
Int ->
Int ->
IO (CArray Int Float, CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), CArray (Int,Int) (Complex Float), Int)
uncsd jobu1 jobu2 jobv1t jobv2t trans signs m p x11 x12 x21 x22 r ldu1 ldu2 ldv1t ldv2t lwork rworkSize lrwork = do
(x11Dim0,x11Dim1) <- Call.sizes2 <$> getBounds x11
(x12Dim0,x12Dim1) <- Call.sizes2 <$> getBounds x12
(x21Dim0,x21Dim1) <- Call.sizes2 <$> getBounds x21
(x22Dim0,x22Dim1) <- Call.sizes2 <$> getBounds x22
let q = x11Dim0
let ldx11 = x11Dim1
let ldx12 = x12Dim1
let ldx21 = x21Dim1
let ldx22 = x22Dim1
Call.assert "uncsd: m-q == x12Dim0" (mq == x12Dim0)
Call.assert "uncsd: q == x21Dim0" (q == x21Dim0)
Call.assert "uncsd: m-q == x22Dim0" (mq == x22Dim0)
theta <- Call.newArray1 r
u1 <- Call.newArray2 p ldu1
u2 <- Call.newArray2 (mp) ldu2
v1t <- Call.newArray2 q ldv1t
v2t <- Call.newArray2 (mq) ldv2t
work <- Call.newArray1 (maximum[1,lwork])
rwork <- Call.newArray1 rworkSize
iwork <- Call.newArray1 (mminimum[p,mp,q,mq])
evalContT $ do
jobu1Ptr <- Call.char jobu1
jobu2Ptr <- Call.char jobu2
jobv1tPtr <- Call.char jobv1t
jobv2tPtr <- Call.char jobv2t
transPtr <- Call.char trans
signsPtr <- Call.char signs
mPtr <- Call.cint m
pPtr <- Call.cint p
qPtr <- Call.cint q
x11Ptr <- Call.ioarray x11
ldx11Ptr <- Call.cint ldx11
x12Ptr <- Call.ioarray x12
ldx12Ptr <- Call.cint ldx12
x21Ptr <- Call.ioarray x21
ldx21Ptr <- Call.cint ldx21
x22Ptr <- Call.ioarray x22
ldx22Ptr <- Call.cint ldx22
thetaPtr <- Call.array theta
u1Ptr <- Call.array u1
ldu1Ptr <- Call.cint ldu1
u2Ptr <- Call.array u2
ldu2Ptr <- Call.cint ldu2
v1tPtr <- Call.array v1t
ldv1tPtr <- Call.cint ldv1t
v2tPtr <- Call.array v2t
ldv2tPtr <- Call.cint ldv2t
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
rworkPtr <- Call.array rwork
lrworkPtr <- Call.cint lrwork
iworkPtr <- Call.array iwork
infoPtr <- Call.alloca
liftIO $ Lapack.uncsd jobu1Ptr jobu2Ptr jobv1tPtr jobv2tPtr transPtr signsPtr mPtr pPtr qPtr x11Ptr ldx11Ptr x12Ptr ldx12Ptr x21Ptr ldx21Ptr x22Ptr ldx22Ptr thetaPtr u1Ptr ldu1Ptr u2Ptr ldu2Ptr v1tPtr ldv1tPtr v2tPtr ldv2tPtr workPtr lworkPtr rworkPtr lrworkPtr iworkPtr infoPtr
liftIO $ pure (,,,,,)
<*> pure theta
<*> pure u1
<*> pure u2
<*> pure v1t
<*> pure v2t
<*> fmap fromIntegral (peek infoPtr)
ung2l ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IO (Int)
ung2l m a tau = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let k = tauDim0
work <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.ung2l mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ung2r ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IO (Int)
ung2r m a tau = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let k = tauDim0
work <- Call.newArray1 n
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.ung2r mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ungbr ::
Char ->
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (Int)
ungbr vect m k a tau lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let _tauSize = tauDim0
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
vectPtr <- Call.char vect
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.ungbr vectPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unghr ::
Int ->
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (Int)
unghr ilo ihi a tau lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
Call.assert "unghr: n-1 == tauDim0" (n1 == tauDim0)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unghr nPtr iloPtr ihiPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ungl2 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IO (Int)
ungl2 m a tau = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let k = tauDim0
work <- Call.newArray1 m
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.ungl2 mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unglq ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (Int)
unglq m a tau lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let k = tauDim0
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unglq mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ungql ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (Int)
ungql m a tau lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let k = tauDim0
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.ungql mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ungqr ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (Int)
ungqr m a tau lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let k = tauDim0
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.ungqr mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ungr2 ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IO (Int)
ungr2 m a tau = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let k = tauDim0
work <- Call.newArray1 m
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.ungr2 mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ungrq ::
Int ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (Int)
ungrq m a tau lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
let k = tauDim0
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.ungrq mPtr nPtr kPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
ungtr ::
Char ->
IOCArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (Int)
ungtr uplo a tau lwork = do
(aDim0,aDim1) <- Call.sizes2 <$> getBounds a
let tauDim0 = Call.sizes1 $ bounds tau
let n = aDim0
let lda = aDim1
Call.assert "ungtr: n-1 == tauDim0" (n1 == tauDim0)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
aPtr <- Call.ioarray a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.ungtr uploPtr nPtr aPtr ldaPtr tauPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unm2l ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unm2l side trans m a tau c workSize = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let k = aDim0
let lda = aDim1
let n = cDim0
let ldc = cDim1
Call.assert "unm2l: k == tauDim0" (k == tauDim0)
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.unm2l sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unm2r ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unm2r side trans m a tau c workSize = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let k = aDim0
let lda = aDim1
let n = cDim0
let ldc = cDim1
Call.assert "unm2r: k == tauDim0" (k == tauDim0)
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.unm2r sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmbr ::
Char ->
Char ->
Char ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmbr vect side trans m k a tau c lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let n = cDim0
let ldc = cDim1
Call.ignore "unmbr: minimum[nq,k] == tauDim0" tauDim0
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
vectPtr <- Call.char vect
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unmbr vectPtr sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmhr ::
Char ->
Char ->
Int ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmhr side trans m ilo ihi a tau c lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let _tauSize = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
iloPtr <- Call.cint ilo
ihiPtr <- Call.cint ihi
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unmhr sidePtr transPtr mPtr nPtr iloPtr ihiPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unml2 ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unml2 side trans m a tau c workSize = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let k = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.unml2 sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmlq ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmlq side trans m a tau c lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let k = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unmlq sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmql ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmql side trans m a tau c lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let k = aDim0
let lda = aDim1
let n = cDim0
let ldc = cDim1
Call.assert "unmql: k == tauDim0" (k == tauDim0)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unmql sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmqr ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmqr side trans m a tau c lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let k = aDim0
let lda = aDim1
let n = cDim0
let ldc = cDim1
Call.assert "unmqr: k == tauDim0" (k == tauDim0)
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unmqr sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmr2 ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmr2 side trans m a tau c workSize = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let k = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.unmr2 sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmr3 ::
Char ->
Char ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmr3 side trans m l a tau c workSize = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let k = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
lPtr <- Call.cint l
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.unmr3 sidePtr transPtr mPtr nPtr kPtr lPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmrq ::
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmrq side trans m a tau c lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let k = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unmrq sidePtr transPtr mPtr nPtr kPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmrz ::
Char ->
Char ->
Int ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmrz side trans m l a tau c lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let k = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
sidePtr <- Call.char side
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
kPtr <- Call.cint k
lPtr <- Call.cint l
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unmrz sidePtr transPtr mPtr nPtr kPtr lPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
unmtr ::
Char ->
Char ->
Char ->
Int ->
CArray (Int,Int) (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
unmtr side uplo trans m a tau c lwork = do
let (aDim0,aDim1) = Call.sizes2 $ bounds a
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _aSize = aDim0
let lda = aDim1
let _tauSize = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 (maximum[1,lwork])
evalContT $ do
sidePtr <- Call.char side
uploPtr <- Call.char uplo
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
aPtr <- Call.array a
ldaPtr <- Call.cint lda
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
lworkPtr <- Call.cint lwork
infoPtr <- Call.alloca
liftIO $ Lapack.unmtr sidePtr uploPtr transPtr mPtr nPtr aPtr ldaPtr tauPtr cPtr ldcPtr workPtr lworkPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)
upgtr ::
Char ->
Int ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
Int ->
IO (CArray (Int,Int) (Complex Float), Int)
upgtr uplo n ap tau ldq = do
let apDim0 = Call.sizes1 $ bounds ap
let tauDim0 = Call.sizes1 $ bounds tau
Call.assert "upgtr: n*(n+1)`div`2 == apDim0" (n*(n+1)`div`2 == apDim0)
Call.assert "upgtr: n-1 == tauDim0" (n1 == tauDim0)
q <- Call.newArray2 n ldq
work <- Call.newArray1 (n1)
evalContT $ do
uploPtr <- Call.char uplo
nPtr <- Call.cint n
apPtr <- Call.array ap
tauPtr <- Call.array tau
qPtr <- Call.array q
ldqPtr <- Call.cint ldq
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.upgtr uploPtr nPtr apPtr tauPtr qPtr ldqPtr workPtr infoPtr
liftIO $ pure (,)
<*> pure q
<*> fmap fromIntegral (peek infoPtr)
upmtr ::
Char ->
Char ->
Char ->
Int ->
CArray Int (Complex Float) ->
CArray Int (Complex Float) ->
IOCArray (Int,Int) (Complex Float) ->
Int ->
IO (Int)
upmtr side uplo trans m ap tau c workSize = do
let apDim0 = Call.sizes1 $ bounds ap
let tauDim0 = Call.sizes1 $ bounds tau
(cDim0,cDim1) <- Call.sizes2 <$> getBounds c
let _apSize = apDim0
let _tauSize = tauDim0
let n = cDim0
let ldc = cDim1
work <- Call.newArray1 workSize
evalContT $ do
sidePtr <- Call.char side
uploPtr <- Call.char uplo
transPtr <- Call.char trans
mPtr <- Call.cint m
nPtr <- Call.cint n
apPtr <- Call.array ap
tauPtr <- Call.array tau
cPtr <- Call.ioarray c
ldcPtr <- Call.cint ldc
workPtr <- Call.array work
infoPtr <- Call.alloca
liftIO $ Lapack.upmtr sidePtr uploPtr transPtr mPtr nPtr apPtr tauPtr cPtr ldcPtr workPtr infoPtr
liftIO $ fmap fromIntegral (peek infoPtr)