summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Matrix.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/Matrix.hs')
-rw-r--r--packages/base/src/Internal/Matrix.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/base/src/Internal/Matrix.hs b/packages/base/src/Internal/Matrix.hs
index d715cbf..8de06ce 100644
--- a/packages/base/src/Internal/Matrix.hs
+++ b/packages/base/src/Internal/Matrix.hs
@@ -333,6 +333,16 @@ instance Element (CInt) where
333 selectV = selectI 333 selectV = selectI
334 remapM = remapI 334 remapM = remapI
335 335
336instance Element Z where
337 transdata = transdataAux ctransL
338 constantD = constantAux cconstantL
339 extractR = extractAux c_extractL
340 sortI = sortIdxL
341 sortV = sortValL
342 compareV = compareL
343 selectV = selectL
344 remapM = remapL
345
336------------------------------------------------------------------- 346-------------------------------------------------------------------
337 347
338transdataAux fun c1 d c2 = 348transdataAux fun c1 d c2 =
@@ -357,6 +367,7 @@ foreign import ccall unsafe "transR" ctransR :: TMM Double
357foreign import ccall unsafe "transQ" ctransQ :: TMM (Complex Float) 367foreign import ccall unsafe "transQ" ctransQ :: TMM (Complex Float)
358foreign import ccall unsafe "transC" ctransC :: TMM (Complex Double) 368foreign import ccall unsafe "transC" ctransC :: TMM (Complex Double)
359foreign import ccall unsafe "transI" ctransI :: TMM CInt 369foreign import ccall unsafe "transI" ctransI :: TMM CInt
370foreign import ccall unsafe "transL" ctransL :: TMM Z
360 371
361---------------------------------------------------------------------- 372----------------------------------------------------------------------
362 373
@@ -433,6 +444,7 @@ foreign import ccall unsafe "extractF" c_extractF :: Extr Float
433foreign import ccall unsafe "extractC" c_extractC :: Extr (Complex Double) 444foreign import ccall unsafe "extractC" c_extractC :: Extr (Complex Double)
434foreign import ccall unsafe "extractQ" c_extractQ :: Extr (Complex Float) 445foreign import ccall unsafe "extractQ" c_extractQ :: Extr (Complex Float)
435foreign import ccall unsafe "extractI" c_extractI :: Extr CInt 446foreign import ccall unsafe "extractI" c_extractI :: Extr CInt
447foreign import ccall unsafe "extractL" c_extractL :: Extr Z
436 448
437-------------------------------------------------------------------------------- 449--------------------------------------------------------------------------------
438 450
@@ -444,18 +456,22 @@ sortG f v = unsafePerformIO $ do
444sortIdxD = sortG c_sort_indexD 456sortIdxD = sortG c_sort_indexD
445sortIdxF = sortG c_sort_indexF 457sortIdxF = sortG c_sort_indexF
446sortIdxI = sortG c_sort_indexI 458sortIdxI = sortG c_sort_indexI
459sortIdxL = sortG c_sort_indexL
447 460
448sortValD = sortG c_sort_valD 461sortValD = sortG c_sort_valD
449sortValF = sortG c_sort_valF 462sortValF = sortG c_sort_valF
450sortValI = sortG c_sort_valI 463sortValI = sortG c_sort_valI
464sortValL = sortG c_sort_valL
451 465
452foreign import ccall unsafe "sort_indexD" c_sort_indexD :: CV Double (CV CInt (IO CInt)) 466foreign import ccall unsafe "sort_indexD" c_sort_indexD :: CV Double (CV CInt (IO CInt))
453foreign import ccall unsafe "sort_indexF" c_sort_indexF :: CV Float (CV CInt (IO CInt)) 467foreign import ccall unsafe "sort_indexF" c_sort_indexF :: CV Float (CV CInt (IO CInt))
454foreign import ccall unsafe "sort_indexI" c_sort_indexI :: CV CInt (CV CInt (IO CInt)) 468foreign import ccall unsafe "sort_indexI" c_sort_indexI :: CV CInt (CV CInt (IO CInt))
469foreign import ccall unsafe "sort_indexL" c_sort_indexL :: Z :> I :> Ok
455 470
456foreign import ccall unsafe "sort_valuesD" c_sort_valD :: CV Double (CV Double (IO CInt)) 471foreign import ccall unsafe "sort_valuesD" c_sort_valD :: CV Double (CV Double (IO CInt))
457foreign import ccall unsafe "sort_valuesF" c_sort_valF :: CV Float (CV Float (IO CInt)) 472foreign import ccall unsafe "sort_valuesF" c_sort_valF :: CV Float (CV Float (IO CInt))
458foreign import ccall unsafe "sort_valuesI" c_sort_valI :: CV CInt (CV CInt (IO CInt)) 473foreign import ccall unsafe "sort_valuesI" c_sort_valI :: CV CInt (CV CInt (IO CInt))
474foreign import ccall unsafe "sort_valuesL" c_sort_valL :: Z :> Z :> Ok
459 475
460-------------------------------------------------------------------------------- 476--------------------------------------------------------------------------------
461 477
@@ -467,10 +483,12 @@ compareG f u v = unsafePerformIO $ do
467compareD = compareG c_compareD 483compareD = compareG c_compareD
468compareF = compareG c_compareF 484compareF = compareG c_compareF
469compareI = compareG c_compareI 485compareI = compareG c_compareI
486compareL = compareG c_compareL
470 487
471foreign import ccall unsafe "compareD" c_compareD :: CV Double (CV Double (CV CInt (IO CInt))) 488foreign import ccall unsafe "compareD" c_compareD :: CV Double (CV Double (CV CInt (IO CInt)))
472foreign import ccall unsafe "compareF" c_compareF :: CV Float (CV Float (CV CInt (IO CInt))) 489foreign import ccall unsafe "compareF" c_compareF :: CV Float (CV Float (CV CInt (IO CInt)))
473foreign import ccall unsafe "compareI" c_compareI :: CV CInt (CV CInt (CV CInt (IO CInt))) 490foreign import ccall unsafe "compareI" c_compareI :: CV CInt (CV CInt (CV CInt (IO CInt)))
491foreign import ccall unsafe "compareL" c_compareL :: Z :> Z :> I :> Ok
474 492
475-------------------------------------------------------------------------------- 493--------------------------------------------------------------------------------
476 494
@@ -482,6 +500,7 @@ selectG f c u v w = unsafePerformIO $ do
482selectD = selectG c_selectD 500selectD = selectG c_selectD
483selectF = selectG c_selectF 501selectF = selectG c_selectF
484selectI = selectG c_selectI 502selectI = selectG c_selectI
503selectL = selectG c_selectL
485selectC = selectG c_selectC 504selectC = selectG c_selectC
486selectQ = selectG c_selectQ 505selectQ = selectG c_selectQ
487 506
@@ -492,6 +511,7 @@ foreign import ccall unsafe "chooseF" c_selectF :: Sel Float
492foreign import ccall unsafe "chooseI" c_selectI :: Sel CInt 511foreign import ccall unsafe "chooseI" c_selectI :: Sel CInt
493foreign import ccall unsafe "chooseC" c_selectC :: Sel (Complex Double) 512foreign import ccall unsafe "chooseC" c_selectC :: Sel (Complex Double)
494foreign import ccall unsafe "chooseQ" c_selectQ :: Sel (Complex Float) 513foreign import ccall unsafe "chooseQ" c_selectQ :: Sel (Complex Float)
514foreign import ccall unsafe "chooseL" c_selectL :: Sel Z
495 515
496--------------------------------------------------------------------------- 516---------------------------------------------------------------------------
497 517
@@ -503,6 +523,7 @@ remapG f i j m = unsafePerformIO $ do
503remapD = remapG c_remapD 523remapD = remapG c_remapD
504remapF = remapG c_remapF 524remapF = remapG c_remapF
505remapI = remapG c_remapI 525remapI = remapG c_remapI
526remapL = remapG c_remapL
506remapC = remapG c_remapC 527remapC = remapG c_remapC
507remapQ = remapG c_remapQ 528remapQ = remapG c_remapQ
508 529
@@ -513,6 +534,7 @@ foreign import ccall unsafe "remapF" c_remapF :: Rem Float
513foreign import ccall unsafe "remapI" c_remapI :: Rem CInt 534foreign import ccall unsafe "remapI" c_remapI :: Rem CInt
514foreign import ccall unsafe "remapC" c_remapC :: Rem (Complex Double) 535foreign import ccall unsafe "remapC" c_remapC :: Rem (Complex Double)
515foreign import ccall unsafe "remapQ" c_remapQ :: Rem (Complex Float) 536foreign import ccall unsafe "remapQ" c_remapQ :: Rem (Complex Float)
537foreign import ccall unsafe "remapL" c_remapL :: Rem Z
516 538
517-------------------------------------------------------------------------------- 539--------------------------------------------------------------------------------
518 540