diff options
Diffstat (limited to 'packages/base/src/Internal/Matrix.hs')
-rw-r--r-- | packages/base/src/Internal/Matrix.hs | 22 |
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 | ||
336 | instance 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 | ||
338 | transdataAux fun c1 d c2 = | 348 | transdataAux fun c1 d c2 = |
@@ -357,6 +367,7 @@ foreign import ccall unsafe "transR" ctransR :: TMM Double | |||
357 | foreign import ccall unsafe "transQ" ctransQ :: TMM (Complex Float) | 367 | foreign import ccall unsafe "transQ" ctransQ :: TMM (Complex Float) |
358 | foreign import ccall unsafe "transC" ctransC :: TMM (Complex Double) | 368 | foreign import ccall unsafe "transC" ctransC :: TMM (Complex Double) |
359 | foreign import ccall unsafe "transI" ctransI :: TMM CInt | 369 | foreign import ccall unsafe "transI" ctransI :: TMM CInt |
370 | foreign 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 | |||
433 | foreign import ccall unsafe "extractC" c_extractC :: Extr (Complex Double) | 444 | foreign import ccall unsafe "extractC" c_extractC :: Extr (Complex Double) |
434 | foreign import ccall unsafe "extractQ" c_extractQ :: Extr (Complex Float) | 445 | foreign import ccall unsafe "extractQ" c_extractQ :: Extr (Complex Float) |
435 | foreign import ccall unsafe "extractI" c_extractI :: Extr CInt | 446 | foreign import ccall unsafe "extractI" c_extractI :: Extr CInt |
447 | foreign import ccall unsafe "extractL" c_extractL :: Extr Z | ||
436 | 448 | ||
437 | -------------------------------------------------------------------------------- | 449 | -------------------------------------------------------------------------------- |
438 | 450 | ||
@@ -444,18 +456,22 @@ sortG f v = unsafePerformIO $ do | |||
444 | sortIdxD = sortG c_sort_indexD | 456 | sortIdxD = sortG c_sort_indexD |
445 | sortIdxF = sortG c_sort_indexF | 457 | sortIdxF = sortG c_sort_indexF |
446 | sortIdxI = sortG c_sort_indexI | 458 | sortIdxI = sortG c_sort_indexI |
459 | sortIdxL = sortG c_sort_indexL | ||
447 | 460 | ||
448 | sortValD = sortG c_sort_valD | 461 | sortValD = sortG c_sort_valD |
449 | sortValF = sortG c_sort_valF | 462 | sortValF = sortG c_sort_valF |
450 | sortValI = sortG c_sort_valI | 463 | sortValI = sortG c_sort_valI |
464 | sortValL = sortG c_sort_valL | ||
451 | 465 | ||
452 | foreign import ccall unsafe "sort_indexD" c_sort_indexD :: CV Double (CV CInt (IO CInt)) | 466 | foreign import ccall unsafe "sort_indexD" c_sort_indexD :: CV Double (CV CInt (IO CInt)) |
453 | foreign import ccall unsafe "sort_indexF" c_sort_indexF :: CV Float (CV CInt (IO CInt)) | 467 | foreign import ccall unsafe "sort_indexF" c_sort_indexF :: CV Float (CV CInt (IO CInt)) |
454 | foreign import ccall unsafe "sort_indexI" c_sort_indexI :: CV CInt (CV CInt (IO CInt)) | 468 | foreign import ccall unsafe "sort_indexI" c_sort_indexI :: CV CInt (CV CInt (IO CInt)) |
469 | foreign import ccall unsafe "sort_indexL" c_sort_indexL :: Z :> I :> Ok | ||
455 | 470 | ||
456 | foreign import ccall unsafe "sort_valuesD" c_sort_valD :: CV Double (CV Double (IO CInt)) | 471 | foreign import ccall unsafe "sort_valuesD" c_sort_valD :: CV Double (CV Double (IO CInt)) |
457 | foreign import ccall unsafe "sort_valuesF" c_sort_valF :: CV Float (CV Float (IO CInt)) | 472 | foreign import ccall unsafe "sort_valuesF" c_sort_valF :: CV Float (CV Float (IO CInt)) |
458 | foreign import ccall unsafe "sort_valuesI" c_sort_valI :: CV CInt (CV CInt (IO CInt)) | 473 | foreign import ccall unsafe "sort_valuesI" c_sort_valI :: CV CInt (CV CInt (IO CInt)) |
474 | foreign 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 | |||
467 | compareD = compareG c_compareD | 483 | compareD = compareG c_compareD |
468 | compareF = compareG c_compareF | 484 | compareF = compareG c_compareF |
469 | compareI = compareG c_compareI | 485 | compareI = compareG c_compareI |
486 | compareL = compareG c_compareL | ||
470 | 487 | ||
471 | foreign import ccall unsafe "compareD" c_compareD :: CV Double (CV Double (CV CInt (IO CInt))) | 488 | foreign import ccall unsafe "compareD" c_compareD :: CV Double (CV Double (CV CInt (IO CInt))) |
472 | foreign import ccall unsafe "compareF" c_compareF :: CV Float (CV Float (CV CInt (IO CInt))) | 489 | foreign import ccall unsafe "compareF" c_compareF :: CV Float (CV Float (CV CInt (IO CInt))) |
473 | foreign import ccall unsafe "compareI" c_compareI :: CV CInt (CV CInt (CV CInt (IO CInt))) | 490 | foreign import ccall unsafe "compareI" c_compareI :: CV CInt (CV CInt (CV CInt (IO CInt))) |
491 | foreign 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 | |||
482 | selectD = selectG c_selectD | 500 | selectD = selectG c_selectD |
483 | selectF = selectG c_selectF | 501 | selectF = selectG c_selectF |
484 | selectI = selectG c_selectI | 502 | selectI = selectG c_selectI |
503 | selectL = selectG c_selectL | ||
485 | selectC = selectG c_selectC | 504 | selectC = selectG c_selectC |
486 | selectQ = selectG c_selectQ | 505 | selectQ = selectG c_selectQ |
487 | 506 | ||
@@ -492,6 +511,7 @@ foreign import ccall unsafe "chooseF" c_selectF :: Sel Float | |||
492 | foreign import ccall unsafe "chooseI" c_selectI :: Sel CInt | 511 | foreign import ccall unsafe "chooseI" c_selectI :: Sel CInt |
493 | foreign import ccall unsafe "chooseC" c_selectC :: Sel (Complex Double) | 512 | foreign import ccall unsafe "chooseC" c_selectC :: Sel (Complex Double) |
494 | foreign import ccall unsafe "chooseQ" c_selectQ :: Sel (Complex Float) | 513 | foreign import ccall unsafe "chooseQ" c_selectQ :: Sel (Complex Float) |
514 | foreign 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 | |||
503 | remapD = remapG c_remapD | 523 | remapD = remapG c_remapD |
504 | remapF = remapG c_remapF | 524 | remapF = remapG c_remapF |
505 | remapI = remapG c_remapI | 525 | remapI = remapG c_remapI |
526 | remapL = remapG c_remapL | ||
506 | remapC = remapG c_remapC | 527 | remapC = remapG c_remapC |
507 | remapQ = remapG c_remapQ | 528 | remapQ = remapG c_remapQ |
508 | 529 | ||
@@ -513,6 +534,7 @@ foreign import ccall unsafe "remapF" c_remapF :: Rem Float | |||
513 | foreign import ccall unsafe "remapI" c_remapI :: Rem CInt | 534 | foreign import ccall unsafe "remapI" c_remapI :: Rem CInt |
514 | foreign import ccall unsafe "remapC" c_remapC :: Rem (Complex Double) | 535 | foreign import ccall unsafe "remapC" c_remapC :: Rem (Complex Double) |
515 | foreign import ccall unsafe "remapQ" c_remapQ :: Rem (Complex Float) | 536 | foreign import ccall unsafe "remapQ" c_remapQ :: Rem (Complex Float) |
537 | foreign import ccall unsafe "remapL" c_remapL :: Rem Z | ||
516 | 538 | ||
517 | -------------------------------------------------------------------------------- | 539 | -------------------------------------------------------------------------------- |
518 | 540 | ||