diff options
author | Alberto Ruiz <aruiz@um.es> | 2011-12-22 17:26:09 +0100 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2011-12-22 17:26:09 +0100 |
commit | d7b7ff9dff27a6a74785c92c9393704fe0072e0e (patch) | |
tree | eb47835d7629f68ab700eec1f8ee7399ba4c06ad /lib/Numeric/ContainerBoot.hs | |
parent | 49219343d035992c2942a309a1d5594f4f96a8b1 (diff) |
ok hmatrix, hmatrix-tests, hmatrix-glpk
Diffstat (limited to 'lib/Numeric/ContainerBoot.hs')
-rw-r--r-- | lib/Numeric/ContainerBoot.hs | 89 |
1 files changed, 3 insertions, 86 deletions
diff --git a/lib/Numeric/ContainerBoot.hs b/lib/Numeric/ContainerBoot.hs index a605545..d913435 100644 --- a/lib/Numeric/ContainerBoot.hs +++ b/lib/Numeric/ContainerBoot.hs | |||
@@ -3,6 +3,7 @@ | |||
3 | {-# LANGUAGE FlexibleInstances #-} | 3 | {-# LANGUAGE FlexibleInstances #-} |
4 | {-# LANGUAGE MultiParamTypeClasses #-} | 4 | {-# LANGUAGE MultiParamTypeClasses #-} |
5 | {-# LANGUAGE UndecidableInstances #-} | 5 | {-# LANGUAGE UndecidableInstances #-} |
6 | {-# LANGUAGE PolyKinds #-} | ||
6 | 7 | ||
7 | ----------------------------------------------------------------------------- | 8 | ----------------------------------------------------------------------------- |
8 | -- | | 9 | -- | |
@@ -37,11 +38,7 @@ module Numeric.ContainerBoot ( | |||
37 | IndexOf, | 38 | IndexOf, |
38 | module Data.Complex, | 39 | module Data.Complex, |
39 | -- * Experimental | 40 | -- * Experimental |
40 | build', konst', | 41 | build', konst' |
41 | -- * Deprecated | ||
42 | (.*),(*/),(<|>),(<->), | ||
43 | vectorMax,vectorMin, | ||
44 | vectorMaxIndex, vectorMinIndex | ||
45 | ) where | 42 | ) where |
46 | 43 | ||
47 | import Data.Packed | 44 | import Data.Packed |
@@ -49,7 +46,7 @@ import Data.Packed.ST as ST | |||
49 | import Numeric.Conversion | 46 | import Numeric.Conversion |
50 | import Data.Packed.Internal | 47 | import Data.Packed.Internal |
51 | import Numeric.GSL.Vector | 48 | import Numeric.GSL.Vector |
52 | 49 | import Foreign.C.Types(CInt(..)) | |
53 | import Data.Complex | 50 | import Data.Complex |
54 | import Control.Monad(ap) | 51 | import Control.Monad(ap) |
55 | 52 | ||
@@ -526,86 +523,6 @@ conjugateC :: Vector (Complex Double) -> Vector (Complex Double) | |||
526 | conjugateC = conjugateAux c_conjugateC | 523 | conjugateC = conjugateAux c_conjugateC |
527 | foreign import ccall "conjugateC" c_conjugateC :: TCVCV | 524 | foreign import ccall "conjugateC" c_conjugateC :: TCVCV |
528 | 525 | ||
529 | ---------------------------------------------------- | ||
530 | |||
531 | {-# DEPRECATED (.*) "use scale a x or scalar a * x" #-} | ||
532 | |||
533 | -- -- | @x .* a = scale x a@ | ||
534 | -- (.*) :: (Linear c a) => a -> c a -> c a | ||
535 | infixl 7 .* | ||
536 | a .* x = scale a x | ||
537 | |||
538 | ---------------------------------------------------- | ||
539 | |||
540 | {-# DEPRECATED (*/) "use scale (recip a) x or x / scalar a" #-} | ||
541 | |||
542 | -- -- | @a *\/ x = scale (recip x) a@ | ||
543 | -- (*/) :: (Linear c a) => c a -> a -> c a | ||
544 | infixl 7 */ | ||
545 | v */ x = scale (recip x) v | ||
546 | |||
547 | |||
548 | ------------------------------------------------ | ||
549 | |||
550 | {-# DEPRECATED (<|>) "define operator a & b = fromBlocks[[a,b]] and use asRow/asColumn to join vectors" #-} | ||
551 | {-# DEPRECATED (<->) "define operator a // b = fromBlocks[[a],[b]] and use asRow/asColumn to join vectors" #-} | ||
552 | |||
553 | class Joinable a b where | ||
554 | joinH :: Element t => a t -> b t -> Matrix t | ||
555 | joinV :: Element t => a t -> b t -> Matrix t | ||
556 | |||
557 | instance Joinable Matrix Matrix where | ||
558 | joinH m1 m2 = fromBlocks [[m1,m2]] | ||
559 | joinV m1 m2 = fromBlocks [[m1],[m2]] | ||
560 | |||
561 | instance Joinable Matrix Vector where | ||
562 | joinH m v = joinH m (asColumn v) | ||
563 | joinV m v = joinV m (asRow v) | ||
564 | |||
565 | instance Joinable Vector Matrix where | ||
566 | joinH v m = joinH (asColumn v) m | ||
567 | joinV v m = joinV (asRow v) m | ||
568 | |||
569 | infixl 4 <|> | ||
570 | infixl 3 <-> | ||
571 | |||
572 | {-- - | Horizontal concatenation of matrices and vectors: | ||
573 | |||
574 | @> (ident 3 \<-\> 3 * ident 3) \<|\> fromList [1..6.0] | ||
575 | (6><4) | ||
576 | [ 1.0, 0.0, 0.0, 1.0 | ||
577 | , 0.0, 1.0, 0.0, 2.0 | ||
578 | , 0.0, 0.0, 1.0, 3.0 | ||
579 | , 3.0, 0.0, 0.0, 4.0 | ||
580 | , 0.0, 3.0, 0.0, 5.0 | ||
581 | , 0.0, 0.0, 3.0, 6.0 ]@ | ||
582 | -} | ||
583 | -- (<|>) :: (Element t, Joinable a b) => a t -> b t -> Matrix t | ||
584 | a <|> b = joinH a b | ||
585 | |||
586 | -- -- | Vertical concatenation of matrices and vectors. | ||
587 | -- (<->) :: (Element t, Joinable a b) => a t -> b t -> Matrix t | ||
588 | a <-> b = joinV a b | ||
589 | |||
590 | ------------------------------------------------------------------- | ||
591 | |||
592 | {-# DEPRECATED vectorMin "use minElement" #-} | ||
593 | vectorMin :: (Container Vector t, Element t) => Vector t -> t | ||
594 | vectorMin = minElement | ||
595 | |||
596 | {-# DEPRECATED vectorMax "use maxElement" #-} | ||
597 | vectorMax :: (Container Vector t, Element t) => Vector t -> t | ||
598 | vectorMax = maxElement | ||
599 | |||
600 | |||
601 | {-# DEPRECATED vectorMaxIndex "use minIndex" #-} | ||
602 | vectorMaxIndex :: Vector Double -> Int | ||
603 | vectorMaxIndex = round . toScalarR MaxIdx | ||
604 | |||
605 | {-# DEPRECATED vectorMinIndex "use maxIndex" #-} | ||
606 | vectorMinIndex :: Vector Double -> Int | ||
607 | vectorMinIndex = round . toScalarR MinIdx | ||
608 | |||
609 | ----------------------------------------------------- | 526 | ----------------------------------------------------- |
610 | 527 | ||
611 | class Build f where | 528 | class Build f where |