diff options
Diffstat (limited to 'lib/Numeric/ContainerBoot.hs')
-rw-r--r-- | lib/Numeric/ContainerBoot.hs | 108 |
1 files changed, 1 insertions, 107 deletions
diff --git a/lib/Numeric/ContainerBoot.hs b/lib/Numeric/ContainerBoot.hs index 0215711..d50dd36 100644 --- a/lib/Numeric/ContainerBoot.hs +++ b/lib/Numeric/ContainerBoot.hs | |||
@@ -38,11 +38,7 @@ module Numeric.ContainerBoot ( | |||
38 | IndexOf, | 38 | IndexOf, |
39 | module Data.Complex, | 39 | module Data.Complex, |
40 | -- * Experimental | 40 | -- * Experimental |
41 | build', konst', | 41 | build', konst' |
42 | -- * Deprecated | ||
43 | (.*),(*/),(<|>),(<->), | ||
44 | vectorMax,vectorMin, | ||
45 | vectorMaxIndex, vectorMinIndex | ||
46 | ) where | 42 | ) where |
47 | 43 | ||
48 | import Data.Packed | 44 | import Data.Packed |
@@ -50,18 +46,11 @@ import Data.Packed.ST as ST | |||
50 | import Numeric.Conversion | 46 | import Numeric.Conversion |
51 | import Data.Packed.Internal | 47 | import Data.Packed.Internal |
52 | import Numeric.GSL.Vector | 48 | import Numeric.GSL.Vector |
53 | |||
54 | #if __GLASGOW_HASKELL__ >= 704 | ||
55 | import Foreign.C.Types(CInt(..)) | ||
56 | #endif | ||
57 | |||
58 | import Data.Complex | 49 | import Data.Complex |
59 | import Control.Monad(ap) | 50 | import Control.Monad(ap) |
60 | 51 | ||
61 | import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) | 52 | import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) |
62 | 53 | ||
63 | import System.IO.Unsafe | ||
64 | |||
65 | ------------------------------------------------------------------- | 54 | ------------------------------------------------------------------- |
66 | 55 | ||
67 | type family IndexOf (c :: * -> *) | 56 | type family IndexOf (c :: * -> *) |
@@ -518,101 +507,6 @@ type instance ElementOf (Matrix a) = a | |||
518 | 507 | ||
519 | ------------------------------------------------------------ | 508 | ------------------------------------------------------------ |
520 | 509 | ||
521 | conjugateAux fun x = unsafePerformIO $ do | ||
522 | v <- createVector (dim x) | ||
523 | app2 fun vec x vec v "conjugateAux" | ||
524 | return v | ||
525 | |||
526 | conjugateQ :: Vector (Complex Float) -> Vector (Complex Float) | ||
527 | conjugateQ = conjugateAux c_conjugateQ | ||
528 | foreign import ccall "conjugateQ" c_conjugateQ :: TQVQV | ||
529 | |||
530 | conjugateC :: Vector (Complex Double) -> Vector (Complex Double) | ||
531 | conjugateC = conjugateAux c_conjugateC | ||
532 | foreign import ccall "conjugateC" c_conjugateC :: TCVCV | ||
533 | |||
534 | ---------------------------------------------------- | ||
535 | |||
536 | {-# DEPRECATED (.*) "use scale a x or scalar a * x" #-} | ||
537 | |||
538 | -- -- | @x .* a = scale x a@ | ||
539 | -- (.*) :: (Linear c a) => a -> c a -> c a | ||
540 | infixl 7 .* | ||
541 | a .* x = scale a x | ||
542 | |||
543 | ---------------------------------------------------- | ||
544 | |||
545 | {-# DEPRECATED (*/) "use scale (recip a) x or x / scalar a" #-} | ||
546 | |||
547 | -- -- | @a *\/ x = scale (recip x) a@ | ||
548 | -- (*/) :: (Linear c a) => c a -> a -> c a | ||
549 | infixl 7 */ | ||
550 | v */ x = scale (recip x) v | ||
551 | |||
552 | |||
553 | ------------------------------------------------ | ||
554 | |||
555 | {-# DEPRECATED (<|>) "define operator a & b = fromBlocks[[a,b]] and use asRow/asColumn to join vectors" #-} | ||
556 | {-# DEPRECATED (<->) "define operator a // b = fromBlocks[[a],[b]] and use asRow/asColumn to join vectors" #-} | ||
557 | |||
558 | class Joinable a b where | ||
559 | joinH :: Element t => a t -> b t -> Matrix t | ||
560 | joinV :: Element t => a t -> b t -> Matrix t | ||
561 | |||
562 | instance Joinable Matrix Matrix where | ||
563 | joinH m1 m2 = fromBlocks [[m1,m2]] | ||
564 | joinV m1 m2 = fromBlocks [[m1],[m2]] | ||
565 | |||
566 | instance Joinable Matrix Vector where | ||
567 | joinH m v = joinH m (asColumn v) | ||
568 | joinV m v = joinV m (asRow v) | ||
569 | |||
570 | instance Joinable Vector Matrix where | ||
571 | joinH v m = joinH (asColumn v) m | ||
572 | joinV v m = joinV (asRow v) m | ||
573 | |||
574 | infixl 4 <|> | ||
575 | infixl 3 <-> | ||
576 | |||
577 | {-- - | Horizontal concatenation of matrices and vectors: | ||
578 | |||
579 | @> (ident 3 \<-\> 3 * ident 3) \<|\> fromList [1..6.0] | ||
580 | (6><4) | ||
581 | [ 1.0, 0.0, 0.0, 1.0 | ||
582 | , 0.0, 1.0, 0.0, 2.0 | ||
583 | , 0.0, 0.0, 1.0, 3.0 | ||
584 | , 3.0, 0.0, 0.0, 4.0 | ||
585 | , 0.0, 3.0, 0.0, 5.0 | ||
586 | , 0.0, 0.0, 3.0, 6.0 ]@ | ||
587 | -} | ||
588 | -- (<|>) :: (Element t, Joinable a b) => a t -> b t -> Matrix t | ||
589 | a <|> b = joinH a b | ||
590 | |||
591 | -- -- | Vertical concatenation of matrices and vectors. | ||
592 | -- (<->) :: (Element t, Joinable a b) => a t -> b t -> Matrix t | ||
593 | a <-> b = joinV a b | ||
594 | |||
595 | ------------------------------------------------------------------- | ||
596 | |||
597 | {-# DEPRECATED vectorMin "use minElement" #-} | ||
598 | vectorMin :: (Container Vector t, Element t) => Vector t -> t | ||
599 | vectorMin = minElement | ||
600 | |||
601 | {-# DEPRECATED vectorMax "use maxElement" #-} | ||
602 | vectorMax :: (Container Vector t, Element t) => Vector t -> t | ||
603 | vectorMax = maxElement | ||
604 | |||
605 | |||
606 | {-# DEPRECATED vectorMaxIndex "use minIndex" #-} | ||
607 | vectorMaxIndex :: Vector Double -> Int | ||
608 | vectorMaxIndex = round . toScalarR MaxIdx | ||
609 | |||
610 | {-# DEPRECATED vectorMinIndex "use maxIndex" #-} | ||
611 | vectorMinIndex :: Vector Double -> Int | ||
612 | vectorMinIndex = round . toScalarR MinIdx | ||
613 | |||
614 | ----------------------------------------------------- | ||
615 | |||
616 | class Build f where | 510 | class Build f where |
617 | build' :: BoundsOf f -> f -> ContainerOf f | 511 | build' :: BoundsOf f -> f -> ContainerOf f |
618 | 512 | ||