diff options
Diffstat (limited to 'lib/Numeric')
-rw-r--r-- | lib/Numeric/GSL/Differentiation.hs | 10 | ||||
-rw-r--r-- | lib/Numeric/GSL/Fourier.hs | 3 | ||||
-rw-r--r-- | lib/Numeric/GSL/Integration.hs | 11 | ||||
-rw-r--r-- | lib/Numeric/GSL/Minimization.hs | 31 | ||||
-rw-r--r-- | lib/Numeric/GSL/Vector.hs | 31 | ||||
-rw-r--r-- | lib/Numeric/GSL/gsl-aux.h | 2 |
6 files changed, 50 insertions, 38 deletions
diff --git a/lib/Numeric/GSL/Differentiation.hs b/lib/Numeric/GSL/Differentiation.hs index 841f2a0..ebbada0 100644 --- a/lib/Numeric/GSL/Differentiation.hs +++ b/lib/Numeric/GSL/Differentiation.hs | |||
@@ -24,10 +24,10 @@ module Numeric.GSL.Differentiation ( | |||
24 | 24 | ||
25 | import Foreign | 25 | import Foreign |
26 | import Foreign.C.Types(CInt) | 26 | import Foreign.C.Types(CInt) |
27 | import Data.Packed.Internal(mkfun,check,(//)) | 27 | import Data.Packed.Internal(check,(//)) |
28 | 28 | ||
29 | derivGen :: | 29 | derivGen :: |
30 | Int -- ^ type: 0 central, 1 forward, 2 backward | 30 | CInt -- ^ type: 0 central, 1 forward, 2 backward |
31 | -> Double -- ^ initial step size | 31 | -> Double -- ^ initial step size |
32 | -> (Double -> Double) -- ^ function | 32 | -> (Double -> Double) -- ^ function |
33 | -> Double -- ^ point where the derivative is taken | 33 | -> Double -- ^ point where the derivative is taken |
@@ -46,7 +46,7 @@ derivGen c h f x = unsafePerformIO $ do | |||
46 | return result | 46 | return result |
47 | 47 | ||
48 | foreign import ccall "gsl-aux.h deriv" | 48 | foreign import ccall "gsl-aux.h deriv" |
49 | c_deriv :: Int -> FunPtr (Double -> Ptr () -> Double) -> Double -> Double | 49 | c_deriv :: CInt -> FunPtr (Double -> Ptr () -> Double) -> Double -> Double |
50 | -> Ptr Double -> Ptr Double -> IO CInt | 50 | -> Ptr Double -> Ptr Double -> IO CInt |
51 | 51 | ||
52 | 52 | ||
@@ -78,3 +78,7 @@ derivBackward ::Double -- ^ initial step size | |||
78 | -> Double -- ^ point where the derivative is taken | 78 | -> Double -- ^ point where the derivative is taken |
79 | -> (Double, Double) -- ^ result and absolute error | 79 | -> (Double, Double) -- ^ result and absolute error |
80 | derivBackward = derivGen 2 | 80 | derivBackward = derivGen 2 |
81 | |||
82 | {- | conversion of Haskell functions into function pointers that can be used in the C side | ||
83 | -} | ||
84 | foreign import ccall "wrapper" mkfun:: (Double -> Ptr() -> Double) -> IO( FunPtr (Double -> Ptr() -> Double)) | ||
diff --git a/lib/Numeric/GSL/Fourier.hs b/lib/Numeric/GSL/Fourier.hs index 149c1e1..98bfb9c 100644 --- a/lib/Numeric/GSL/Fourier.hs +++ b/lib/Numeric/GSL/Fourier.hs | |||
@@ -23,13 +23,14 @@ module Numeric.GSL.Fourier ( | |||
23 | import Data.Packed.Internal | 23 | import Data.Packed.Internal |
24 | import Complex | 24 | import Complex |
25 | import Foreign | 25 | import Foreign |
26 | import Foreign.C.Types(CInt) | ||
26 | 27 | ||
27 | genfft code v = unsafePerformIO $ do | 28 | genfft code v = unsafePerformIO $ do |
28 | r <- createVector (dim v) | 29 | r <- createVector (dim v) |
29 | app2 (c_fft code) vec v vec r "fft" | 30 | app2 (c_fft code) vec v vec r "fft" |
30 | return r | 31 | return r |
31 | 32 | ||
32 | foreign import ccall "gsl-aux.h fft" c_fft :: Int -> TCVCV | 33 | foreign import ccall "gsl-aux.h fft" c_fft :: CInt -> TCVCV |
33 | 34 | ||
34 | 35 | ||
35 | {- | Fast 1D Fourier transform of a 'Vector' @(@'Complex' 'Double'@)@ using /gsl_fft_complex_forward/. It uses the same scaling conventions as GNU Octave. | 36 | {- | Fast 1D Fourier transform of a 'Vector' @(@'Complex' 'Double'@)@ using /gsl_fft_complex_forward/. It uses the same scaling conventions as GNU Octave. |
diff --git a/lib/Numeric/GSL/Integration.hs b/lib/Numeric/GSL/Integration.hs index b5f5930..7103ea4 100644 --- a/lib/Numeric/GSL/Integration.hs +++ b/lib/Numeric/GSL/Integration.hs | |||
@@ -22,9 +22,13 @@ module Numeric.GSL.Integration ( | |||
22 | 22 | ||
23 | import Foreign | 23 | import Foreign |
24 | import Foreign.C.Types(CInt) | 24 | import Foreign.C.Types(CInt) |
25 | import Data.Packed.Internal(mkfun,check,(//)) | 25 | import Data.Packed.Internal(check,(//)) |
26 | 26 | ||
27 | 27 | ||
28 | {- | conversion of Haskell functions into function pointers that can be used in the C side | ||
29 | -} | ||
30 | foreign import ccall "wrapper" mkfun:: (Double -> Ptr() -> Double) -> IO( FunPtr (Double -> Ptr() -> Double)) | ||
31 | |||
28 | -------------------------------------------------------------------- | 32 | -------------------------------------------------------------------- |
29 | {- | Numerical integration using /gsl_integration_qags/ (adaptive integration with singularities). For example: | 33 | {- | Numerical integration using /gsl_integration_qags/ (adaptive integration with singularities). For example: |
30 | 34 | ||
@@ -45,7 +49,7 @@ integrateQAGS prec n f a b = unsafePerformIO $ do | |||
45 | r <- malloc | 49 | r <- malloc |
46 | e <- malloc | 50 | e <- malloc |
47 | fp <- mkfun (\x _ -> f x) | 51 | fp <- mkfun (\x _ -> f x) |
48 | c_integrate_qags fp a b prec n r e // check "integrate_qags" | 52 | c_integrate_qags fp a b prec (fromIntegral n) r e // check "integrate_qags" |
49 | vr <- peek r | 53 | vr <- peek r |
50 | ve <- peek e | 54 | ve <- peek e |
51 | let result = (vr,ve) | 55 | let result = (vr,ve) |
@@ -55,7 +59,7 @@ integrateQAGS prec n f a b = unsafePerformIO $ do | |||
55 | return result | 59 | return result |
56 | 60 | ||
57 | foreign import ccall "gsl-aux.h integrate_qags" | 61 | foreign import ccall "gsl-aux.h integrate_qags" |
58 | c_integrate_qags :: FunPtr (Double-> Ptr() -> Double) -> Double -> Double -> Double -> Int | 62 | c_integrate_qags :: FunPtr (Double-> Ptr() -> Double) -> Double -> Double -> Double -> CInt |
59 | -> Ptr Double -> Ptr Double -> IO CInt | 63 | -> Ptr Double -> Ptr Double -> IO CInt |
60 | 64 | ||
61 | ----------------------------------------------------------------- | 65 | ----------------------------------------------------------------- |
@@ -88,4 +92,3 @@ integrateQNG prec f a b = unsafePerformIO $ do | |||
88 | foreign import ccall "gsl-aux.h integrate_qng" | 92 | foreign import ccall "gsl-aux.h integrate_qng" |
89 | c_integrate_qng :: FunPtr (Double-> Ptr() -> Double) -> Double -> Double -> Double | 93 | c_integrate_qng :: FunPtr (Double-> Ptr() -> Double) -> Double -> Double -> Double |
90 | -> Ptr Double -> Ptr Double -> IO CInt | 94 | -> Ptr Double -> Ptr Double -> IO CInt |
91 | |||
diff --git a/lib/Numeric/GSL/Minimization.hs b/lib/Numeric/GSL/Minimization.hs index 98c0ca9..65705cc 100644 --- a/lib/Numeric/GSL/Minimization.hs +++ b/lib/Numeric/GSL/Minimization.hs | |||
@@ -24,6 +24,7 @@ module Numeric.GSL.Minimization ( | |||
24 | import Data.Packed.Internal | 24 | import Data.Packed.Internal |
25 | import Data.Packed.Matrix | 25 | import Data.Packed.Matrix |
26 | import Foreign | 26 | import Foreign |
27 | import Foreign.C.Types(CInt) | ||
27 | 28 | ||
28 | ------------------------------------------------------------------------- | 29 | ------------------------------------------------------------------------- |
29 | 30 | ||
@@ -85,7 +86,7 @@ minimizeNMSimplex f xi sz tol maxit = unsafePerformIO $ do | |||
85 | fp <- mkVecfun (iv (f.toList)) | 86 | fp <- mkVecfun (iv (f.toList)) |
86 | rawpath <- ww2 withVector xiv withVector szv $ \xiv' szv' -> | 87 | rawpath <- ww2 withVector xiv withVector szv $ \xiv' szv' -> |
87 | createMIO maxit (n+3) | 88 | createMIO maxit (n+3) |
88 | (c_minimizeNMSimplex fp tol maxit // xiv' // szv') | 89 | (c_minimizeNMSimplex fp tol (fromIntegral maxit) // xiv' // szv') |
89 | "minimizeNMSimplex" | 90 | "minimizeNMSimplex" |
90 | let it = round (rawpath @@> (maxit-1,0)) | 91 | let it = round (rawpath @@> (maxit-1,0)) |
91 | path = takeRows it rawpath | 92 | path = takeRows it rawpath |
@@ -95,7 +96,7 @@ minimizeNMSimplex f xi sz tol maxit = unsafePerformIO $ do | |||
95 | 96 | ||
96 | 97 | ||
97 | foreign import ccall "gsl-aux.h minimize" | 98 | foreign import ccall "gsl-aux.h minimize" |
98 | c_minimizeNMSimplex:: FunPtr (Int -> Ptr Double -> Double) -> Double -> Int | 99 | c_minimizeNMSimplex:: FunPtr (CInt -> Ptr Double -> Double) -> Double -> CInt |
99 | -> TVVM | 100 | -> TVVM |
100 | 101 | ||
101 | ---------------------------------------------------------------------------------- | 102 | ---------------------------------------------------------------------------------- |
@@ -151,7 +152,7 @@ minimizeConjugateGradient istep minimpar tol maxit f df xi = unsafePerformIO $ d | |||
151 | dfp <- mkVecVecfun (aux_vTov df') | 152 | dfp <- mkVecVecfun (aux_vTov df') |
152 | rawpath <- withVector xiv $ \xiv' -> | 153 | rawpath <- withVector xiv $ \xiv' -> |
153 | createMIO maxit (n+2) | 154 | createMIO maxit (n+2) |
154 | (c_minimizeConjugateGradient fp dfp istep minimpar tol maxit // xiv') | 155 | (c_minimizeConjugateGradient fp dfp istep minimpar tol (fromIntegral maxit) // xiv') |
155 | "minimizeDerivV" | 156 | "minimizeDerivV" |
156 | let it = round (rawpath @@> (maxit-1,0)) | 157 | let it = round (rawpath @@> (maxit-1,0)) |
157 | path = takeRows it rawpath | 158 | path = takeRows it rawpath |
@@ -162,36 +163,36 @@ minimizeConjugateGradient istep minimpar tol maxit f df xi = unsafePerformIO $ d | |||
162 | 163 | ||
163 | 164 | ||
164 | foreign import ccall "gsl-aux.h minimizeWithDeriv" | 165 | foreign import ccall "gsl-aux.h minimizeWithDeriv" |
165 | c_minimizeConjugateGradient :: FunPtr (Int -> Ptr Double -> Double) | 166 | c_minimizeConjugateGradient :: FunPtr (CInt -> Ptr Double -> Double) |
166 | -> FunPtr (Int -> Ptr Double -> Ptr Double -> IO ()) | 167 | -> FunPtr (CInt -> Ptr Double -> Ptr Double -> IO ()) |
167 | -> Double -> Double -> Double -> Int | 168 | -> Double -> Double -> Double -> CInt |
168 | -> TVM | 169 | -> TVM |
169 | 170 | ||
170 | --------------------------------------------------------------------- | 171 | --------------------------------------------------------------------- |
171 | iv :: (Vector Double -> Double) -> (Int -> Ptr Double -> Double) | 172 | iv :: (Vector Double -> Double) -> (CInt -> Ptr Double -> Double) |
172 | iv f n p = f (createV n copy "iv") where | 173 | iv f n p = f (createV (fromIntegral n) copy "iv") where |
173 | copy n' q = do | 174 | copy n' q = do |
174 | copyArray q p n' | 175 | copyArray q p n' |
175 | return 0 | 176 | return 0 |
176 | 177 | ||
177 | -- | conversion of Haskell functions into function pointers that can be used in the C side | 178 | -- | conversion of Haskell functions into function pointers that can be used in the C side |
178 | foreign import ccall "wrapper" | 179 | foreign import ccall "wrapper" |
179 | mkVecfun :: (Int -> Ptr Double -> Double) | 180 | mkVecfun :: (CInt -> Ptr Double -> Double) |
180 | -> IO( FunPtr (Int -> Ptr Double -> Double)) | 181 | -> IO( FunPtr (CInt -> Ptr Double -> Double)) |
181 | 182 | ||
182 | -- | another required conversion | 183 | -- | another required conversion |
183 | foreign import ccall "wrapper" | 184 | foreign import ccall "wrapper" |
184 | mkVecVecfun :: (Int -> Ptr Double -> Ptr Double -> IO ()) | 185 | mkVecVecfun :: (CInt -> Ptr Double -> Ptr Double -> IO ()) |
185 | -> IO (FunPtr (Int -> Ptr Double -> Ptr Double->IO())) | 186 | -> IO (FunPtr (CInt -> Ptr Double -> Ptr Double->IO())) |
186 | 187 | ||
187 | aux_vTov :: (Vector Double -> Vector Double) -> (Int -> Ptr Double -> Ptr Double -> IO()) | 188 | aux_vTov :: (Vector Double -> Vector Double) -> (CInt -> Ptr Double -> Ptr Double -> IO()) |
188 | aux_vTov f n p r = g where | 189 | aux_vTov f n p r = g where |
189 | V {fptr = pr} = f x | 190 | V {fptr = pr} = f x |
190 | x = createV n copy "aux_vTov" | 191 | x = createV (fromIntegral n) copy "aux_vTov" |
191 | copy n' q = do | 192 | copy n' q = do |
192 | copyArray q p n' | 193 | copyArray q p n' |
193 | return 0 | 194 | return 0 |
194 | g = withForeignPtr pr $ \p' -> copyArray r p' n | 195 | g = withForeignPtr pr $ \p' -> copyArray r p' (fromIntegral n) |
195 | 196 | ||
196 | -------------------------------------------------------------------- | 197 | -------------------------------------------------------------------- |
197 | 198 | ||
diff --git a/lib/Numeric/GSL/Vector.hs b/lib/Numeric/GSL/Vector.hs index 86d8f10..0db2f84 100644 --- a/lib/Numeric/GSL/Vector.hs +++ b/lib/Numeric/GSL/Vector.hs | |||
@@ -25,6 +25,9 @@ import Data.Packed.Internal.Vector | |||
25 | 25 | ||
26 | import Complex | 26 | import Complex |
27 | import Foreign | 27 | import Foreign |
28 | import Foreign.C.Types(CInt) | ||
29 | |||
30 | fromei = fromIntegral . fromei | ||
28 | 31 | ||
29 | data FunCodeV = Sin | 32 | data FunCodeV = Sin |
30 | | Cos | 33 | | Cos |
@@ -73,33 +76,33 @@ data FunCodeS = Norm2 | |||
73 | 76 | ||
74 | toScalarAux fun code v = unsafePerformIO $ do | 77 | toScalarAux fun code v = unsafePerformIO $ do |
75 | r <- createVector 1 | 78 | r <- createVector 1 |
76 | app2 (fun (fromEnum code)) vec v vec r "toScalarAux" | 79 | app2 (fun (fromei code)) vec v vec r "toScalarAux" |
77 | return (r `at` 0) | 80 | return (r `at` 0) |
78 | 81 | ||
79 | vectorMapAux fun code v = unsafePerformIO $ do | 82 | vectorMapAux fun code v = unsafePerformIO $ do |
80 | r <- createVector (dim v) | 83 | r <- createVector (dim v) |
81 | app2 (fun (fromEnum code)) vec v vec r "vectorMapAux" | 84 | app2 (fun (fromei code)) vec v vec r "vectorMapAux" |
82 | return r | 85 | return r |
83 | 86 | ||
84 | vectorMapValAux fun code val v = unsafePerformIO $ do | 87 | vectorMapValAux fun code val v = unsafePerformIO $ do |
85 | r <- createVector (dim v) | 88 | r <- createVector (dim v) |
86 | pval <- newArray [val] | 89 | pval <- newArray [val] |
87 | app2 (fun (fromEnum code) pval) vec v vec r "vectorMapValAux" | 90 | app2 (fun (fromei code) pval) vec v vec r "vectorMapValAux" |
88 | free pval | 91 | free pval |
89 | return r | 92 | return r |
90 | 93 | ||
91 | vectorZipAux fun code u v = unsafePerformIO $ do | 94 | vectorZipAux fun code u v = unsafePerformIO $ do |
92 | r <- createVector (dim u) | 95 | r <- createVector (dim u) |
93 | app3 (fun (fromEnum code)) vec u vec v vec r "vectorZipAux" | 96 | app3 (fun (fromei code)) vec u vec v vec r "vectorZipAux" |
94 | return r | 97 | return r |
95 | 98 | ||
96 | --------------------------------------------------------------------- | 99 | --------------------------------------------------------------------- |
97 | 100 | ||
98 | -- | obtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc. | 101 | -- | obtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc. |
99 | toScalarR :: FunCodeS -> Vector Double -> Double | 102 | toScalarR :: FunCodeS -> Vector Double -> Double |
100 | toScalarR oper = toScalarAux c_toScalarR (fromEnum oper) | 103 | toScalarR oper = toScalarAux c_toScalarR (fromei oper) |
101 | 104 | ||
102 | foreign import ccall safe "gsl-aux.h toScalarR" c_toScalarR :: Int -> TVV | 105 | foreign import ccall safe "gsl-aux.h toScalarR" c_toScalarR :: CInt -> TVV |
103 | 106 | ||
104 | ------------------------------------------------------------------ | 107 | ------------------------------------------------------------------ |
105 | 108 | ||
@@ -107,27 +110,27 @@ foreign import ccall safe "gsl-aux.h toScalarR" c_toScalarR :: Int -> TVV | |||
107 | vectorMapR :: FunCodeV -> Vector Double -> Vector Double | 110 | vectorMapR :: FunCodeV -> Vector Double -> Vector Double |
108 | vectorMapR = vectorMapAux c_vectorMapR | 111 | vectorMapR = vectorMapAux c_vectorMapR |
109 | 112 | ||
110 | foreign import ccall safe "gsl-aux.h mapR" c_vectorMapR :: Int -> TVV | 113 | foreign import ccall safe "gsl-aux.h mapR" c_vectorMapR :: CInt -> TVV |
111 | 114 | ||
112 | -- | map of complex vectors with given function | 115 | -- | map of complex vectors with given function |
113 | vectorMapC :: FunCodeV -> Vector (Complex Double) -> Vector (Complex Double) | 116 | vectorMapC :: FunCodeV -> Vector (Complex Double) -> Vector (Complex Double) |
114 | vectorMapC oper = vectorMapAux c_vectorMapC (fromEnum oper) | 117 | vectorMapC oper = vectorMapAux c_vectorMapC (fromei oper) |
115 | 118 | ||
116 | foreign import ccall safe "gsl-aux.h mapC" c_vectorMapC :: Int -> TCVCV | 119 | foreign import ccall safe "gsl-aux.h mapC" c_vectorMapC :: CInt -> TCVCV |
117 | 120 | ||
118 | ------------------------------------------------------------------- | 121 | ------------------------------------------------------------------- |
119 | 122 | ||
120 | -- | map of real vectors with given function | 123 | -- | map of real vectors with given function |
121 | vectorMapValR :: FunCodeSV -> Double -> Vector Double -> Vector Double | 124 | vectorMapValR :: FunCodeSV -> Double -> Vector Double -> Vector Double |
122 | vectorMapValR oper = vectorMapValAux c_vectorMapValR (fromEnum oper) | 125 | vectorMapValR oper = vectorMapValAux c_vectorMapValR (fromei oper) |
123 | 126 | ||
124 | foreign import ccall safe "gsl-aux.h mapValR" c_vectorMapValR :: Int -> Ptr Double -> TVV | 127 | foreign import ccall safe "gsl-aux.h mapValR" c_vectorMapValR :: CInt -> Ptr Double -> TVV |
125 | 128 | ||
126 | -- | map of complex vectors with given function | 129 | -- | map of complex vectors with given function |
127 | vectorMapValC :: FunCodeSV -> Complex Double -> Vector (Complex Double) -> Vector (Complex Double) | 130 | vectorMapValC :: FunCodeSV -> Complex Double -> Vector (Complex Double) -> Vector (Complex Double) |
128 | vectorMapValC = vectorMapValAux c_vectorMapValC | 131 | vectorMapValC = vectorMapValAux c_vectorMapValC |
129 | 132 | ||
130 | foreign import ccall safe "gsl-aux.h mapValC" c_vectorMapValC :: Int -> Ptr (Complex Double) -> TCVCV | 133 | foreign import ccall safe "gsl-aux.h mapValC" c_vectorMapValC :: CInt -> Ptr (Complex Double) -> TCVCV |
131 | 134 | ||
132 | ------------------------------------------------------------------- | 135 | ------------------------------------------------------------------- |
133 | 136 | ||
@@ -135,10 +138,10 @@ foreign import ccall safe "gsl-aux.h mapValC" c_vectorMapValC :: Int -> Ptr (Com | |||
135 | vectorZipR :: FunCodeVV -> Vector Double -> Vector Double -> Vector Double | 138 | vectorZipR :: FunCodeVV -> Vector Double -> Vector Double -> Vector Double |
136 | vectorZipR = vectorZipAux c_vectorZipR | 139 | vectorZipR = vectorZipAux c_vectorZipR |
137 | 140 | ||
138 | foreign import ccall safe "gsl-aux.h zipR" c_vectorZipR :: Int -> TVVV | 141 | foreign import ccall safe "gsl-aux.h zipR" c_vectorZipR :: CInt -> TVVV |
139 | 142 | ||
140 | -- | elementwise operation on complex vectors | 143 | -- | elementwise operation on complex vectors |
141 | vectorZipC :: FunCodeVV -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) | 144 | vectorZipC :: FunCodeVV -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) |
142 | vectorZipC = vectorZipAux c_vectorZipC | 145 | vectorZipC = vectorZipAux c_vectorZipC |
143 | 146 | ||
144 | foreign import ccall safe "gsl-aux.h zipC" c_vectorZipC :: Int -> TCVCVCV | 147 | foreign import ccall safe "gsl-aux.h zipC" c_vectorZipC :: CInt -> TCVCVCV |
diff --git a/lib/Numeric/GSL/gsl-aux.h b/lib/Numeric/GSL/gsl-aux.h index cf22024..eee15e7 100644 --- a/lib/Numeric/GSL/gsl-aux.h +++ b/lib/Numeric/GSL/gsl-aux.h | |||
@@ -50,7 +50,7 @@ int fft(int code, KCVEC(a), CVEC(b)); | |||
50 | int integrate_qng(double f(double, void*), double a, double b, double prec, | 50 | int integrate_qng(double f(double, void*), double a, double b, double prec, |
51 | double *result, double*error); | 51 | double *result, double*error); |
52 | 52 | ||
53 | int integrate_qags(double f(double,void*), double a, double b, double prec, int w, | 53 | int integrate_qags(double f(double,void*), double a, double b, double prec, int w, |
54 | double *result, double* error); | 54 | double *result, double* error); |
55 | 55 | ||
56 | int polySolve(KRVEC(a), CVEC(z)); | 56 | int polySolve(KRVEC(a), CVEC(z)); |