diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-06-05 17:55:08 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-06-05 17:55:08 +0200 |
commit | a40ed5c42f779561151b3119df0ebeddfcec183c (patch) | |
tree | a7ae3d3b15a4e96bdcc4ca2a595fe4ac750c4fd9 /packages/base/src/Numeric | |
parent | f459fcb1adfd733de406f2eb81bb0a57f5ce6779 (diff) |
maybe variant of linearSolve
Diffstat (limited to 'packages/base/src/Numeric')
-rw-r--r-- | packages/base/src/Numeric/HMatrix.hs | 6 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Algorithms.hs | 8 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/LAPACK.hs | 19 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Real.hs | 33 |
4 files changed, 44 insertions, 22 deletions
diff --git a/packages/base/src/Numeric/HMatrix.hs b/packages/base/src/Numeric/HMatrix.hs index 786fb6d..024e462 100644 --- a/packages/base/src/Numeric/HMatrix.hs +++ b/packages/base/src/Numeric/HMatrix.hs | |||
@@ -152,7 +152,8 @@ import Numeric.LinearAlgebra.Data | |||
152 | import Numeric.Matrix() | 152 | import Numeric.Matrix() |
153 | import Numeric.Vector() | 153 | import Numeric.Vector() |
154 | import Data.Packed.Numeric hiding ((<>)) | 154 | import Data.Packed.Numeric hiding ((<>)) |
155 | import Numeric.LinearAlgebra.Algorithms | 155 | import Numeric.LinearAlgebra.Algorithms hiding (linearSolve) |
156 | import qualified Numeric.LinearAlgebra.Algorithms as A | ||
156 | import Numeric.LinearAlgebra.Util | 157 | import Numeric.LinearAlgebra.Util |
157 | import Numeric.LinearAlgebra.Random | 158 | import Numeric.LinearAlgebra.Random |
158 | import Numeric.Sparse((!#>)) | 159 | import Numeric.Sparse((!#>)) |
@@ -163,3 +164,6 @@ import Numeric.LinearAlgebra.Util.CG | |||
163 | (<>) = mXm | 164 | (<>) = mXm |
164 | infixr 8 <> | 165 | infixr 8 <> |
165 | 166 | ||
167 | -- | Solve a linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, returning Nothing for a singular system. For underconstrained or overconstrained systems use 'linearSolveLS' or 'linearSolveSVD'. | ||
168 | linearSolve m b = A.mbLinearSolve m b | ||
169 | |||
diff --git a/packages/base/src/Numeric/LinearAlgebra/Algorithms.hs b/packages/base/src/Numeric/LinearAlgebra/Algorithms.hs index bbcc513..7e36978 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Algorithms.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -26,6 +26,7 @@ module Numeric.LinearAlgebra.Algorithms ( | |||
26 | Field(), | 26 | Field(), |
27 | -- * Linear Systems | 27 | -- * Linear Systems |
28 | linearSolve, | 28 | linearSolve, |
29 | mbLinearSolve, | ||
29 | luSolve, | 30 | luSolve, |
30 | cholSolve, | 31 | cholSolve, |
31 | linearSolveLS, | 32 | linearSolveLS, |
@@ -102,6 +103,7 @@ class (Product t, | |||
102 | sv' :: Matrix t -> Vector Double | 103 | sv' :: Matrix t -> Vector Double |
103 | luPacked' :: Matrix t -> (Matrix t, [Int]) | 104 | luPacked' :: Matrix t -> (Matrix t, [Int]) |
104 | luSolve' :: (Matrix t, [Int]) -> Matrix t -> Matrix t | 105 | luSolve' :: (Matrix t, [Int]) -> Matrix t -> Matrix t |
106 | mbLinearSolve' :: Matrix t -> Matrix t -> Maybe (Matrix t) | ||
105 | linearSolve' :: Matrix t -> Matrix t -> Matrix t | 107 | linearSolve' :: Matrix t -> Matrix t -> Matrix t |
106 | cholSolve' :: Matrix t -> Matrix t -> Matrix t | 108 | cholSolve' :: Matrix t -> Matrix t -> Matrix t |
107 | linearSolveSVD' :: Matrix t -> Matrix t -> Matrix t | 109 | linearSolveSVD' :: Matrix t -> Matrix t -> Matrix t |
@@ -125,6 +127,7 @@ instance Field Double where | |||
125 | luPacked' = luR | 127 | luPacked' = luR |
126 | luSolve' (l_u,perm) = lusR l_u perm | 128 | luSolve' (l_u,perm) = lusR l_u perm |
127 | linearSolve' = linearSolveR -- (luSolve . luPacked) ?? | 129 | linearSolve' = linearSolveR -- (luSolve . luPacked) ?? |
130 | mbLinearSolve' = mbLinearSolveR | ||
128 | cholSolve' = cholSolveR | 131 | cholSolve' = cholSolveR |
129 | linearSolveLS' = linearSolveLSR | 132 | linearSolveLS' = linearSolveLSR |
130 | linearSolveSVD' = linearSolveSVDR Nothing | 133 | linearSolveSVD' = linearSolveSVDR Nothing |
@@ -151,6 +154,7 @@ instance Field (Complex Double) where | |||
151 | luPacked' = luC | 154 | luPacked' = luC |
152 | luSolve' (l_u,perm) = lusC l_u perm | 155 | luSolve' (l_u,perm) = lusC l_u perm |
153 | linearSolve' = linearSolveC | 156 | linearSolve' = linearSolveC |
157 | mbLinearSolve' = mbLinearSolveC | ||
154 | cholSolve' = cholSolveC | 158 | cholSolve' = cholSolveC |
155 | linearSolveLS' = linearSolveLSC | 159 | linearSolveLS' = linearSolveLSC |
156 | linearSolveSVD' = linearSolveSVDC Nothing | 160 | linearSolveSVD' = linearSolveSVDC Nothing |
@@ -234,6 +238,10 @@ luSolve = {-# SCC "luSolve" #-} luSolve' | |||
234 | linearSolve :: Field t => Matrix t -> Matrix t -> Matrix t | 238 | linearSolve :: Field t => Matrix t -> Matrix t -> Matrix t |
235 | linearSolve = {-# SCC "linearSolve" #-} linearSolve' | 239 | linearSolve = {-# SCC "linearSolve" #-} linearSolve' |
236 | 240 | ||
241 | -- | Solve a linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, returning Nothing for a singular system. For underconstrained or overconstrained systems use 'linearSolveLS' or 'linearSolveSVD'. | ||
242 | mbLinearSolve :: Field t => Matrix t -> Matrix t -> Maybe (Matrix t) | ||
243 | mbLinearSolve = {-# SCC "linearSolve" #-} mbLinearSolve' | ||
244 | |||
237 | -- | Solve a symmetric or Hermitian positive definite linear system using a precomputed Cholesky decomposition obtained by 'chol'. | 245 | -- | Solve a symmetric or Hermitian positive definite linear system using a precomputed Cholesky decomposition obtained by 'chol'. |
238 | cholSolve :: Field t => Matrix t -> Matrix t -> Matrix t | 246 | cholSolve :: Field t => Matrix t -> Matrix t -> Matrix t |
239 | cholSolve = {-# SCC "cholSolve" #-} cholSolve' | 247 | cholSolve = {-# SCC "cholSolve" #-} cholSolve' |
diff --git a/packages/base/src/Numeric/LinearAlgebra/LAPACK.hs b/packages/base/src/Numeric/LinearAlgebra/LAPACK.hs index 40fef45..b32b67f 100644 --- a/packages/base/src/Numeric/LinearAlgebra/LAPACK.hs +++ b/packages/base/src/Numeric/LinearAlgebra/LAPACK.hs | |||
@@ -17,6 +17,7 @@ module Numeric.LinearAlgebra.LAPACK ( | |||
17 | multiplyR, multiplyC, multiplyF, multiplyQ, | 17 | multiplyR, multiplyC, multiplyF, multiplyQ, |
18 | -- * Linear systems | 18 | -- * Linear systems |
19 | linearSolveR, linearSolveC, | 19 | linearSolveR, linearSolveC, |
20 | mbLinearSolveR, mbLinearSolveC, | ||
20 | lusR, lusC, | 21 | lusR, lusC, |
21 | cholSolveR, cholSolveC, | 22 | cholSolveR, cholSolveC, |
22 | linearSolveLSR, linearSolveLSC, | 23 | linearSolveLSR, linearSolveLSC, |
@@ -329,8 +330,8 @@ foreign import ccall unsafe "linearSolveC_l" zgesv :: TCMCMCM | |||
329 | foreign import ccall unsafe "cholSolveR_l" dpotrs :: TMMM | 330 | foreign import ccall unsafe "cholSolveR_l" dpotrs :: TMMM |
330 | foreign import ccall unsafe "cholSolveC_l" zpotrs :: TCMCMCM | 331 | foreign import ccall unsafe "cholSolveC_l" zpotrs :: TCMCMCM |
331 | 332 | ||
332 | linearSolveSQAux f st a b | 333 | linearSolveSQAux g f st a b |
333 | | n1==n2 && n1==r = unsafePerformIO $ do | 334 | | n1==n2 && n1==r = unsafePerformIO . g $ do |
334 | s <- createMatrix ColumnMajor r c | 335 | s <- createMatrix ColumnMajor r c |
335 | app3 f mat a mat b mat s st | 336 | app3 f mat a mat b mat s st |
336 | return s | 337 | return s |
@@ -342,20 +343,26 @@ linearSolveSQAux f st a b | |||
342 | 343 | ||
343 | -- | Solve a real linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, based on LAPACK's /dgesv/. For underconstrained or overconstrained systems use 'linearSolveLSR' or 'linearSolveSVDR'. See also 'lusR'. | 344 | -- | Solve a real linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, based on LAPACK's /dgesv/. For underconstrained or overconstrained systems use 'linearSolveLSR' or 'linearSolveSVDR'. See also 'lusR'. |
344 | linearSolveR :: Matrix Double -> Matrix Double -> Matrix Double | 345 | linearSolveR :: Matrix Double -> Matrix Double -> Matrix Double |
345 | linearSolveR a b = linearSolveSQAux dgesv "linearSolveR" (fmat a) (fmat b) | 346 | linearSolveR a b = linearSolveSQAux id dgesv "linearSolveR" (fmat a) (fmat b) |
347 | |||
348 | mbLinearSolveR :: Matrix Double -> Matrix Double -> Maybe (Matrix Double) | ||
349 | mbLinearSolveR a b = linearSolveSQAux mbCatch dgesv "linearSolveR" (fmat a) (fmat b) | ||
350 | |||
346 | 351 | ||
347 | -- | Solve a complex linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, based on LAPACK's /zgesv/. For underconstrained or overconstrained systems use 'linearSolveLSC' or 'linearSolveSVDC'. See also 'lusC'. | 352 | -- | Solve a complex linear system (for square coefficient matrix and several right-hand sides) using the LU decomposition, based on LAPACK's /zgesv/. For underconstrained or overconstrained systems use 'linearSolveLSC' or 'linearSolveSVDC'. See also 'lusC'. |
348 | linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) | 353 | linearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) |
349 | linearSolveC a b = linearSolveSQAux zgesv "linearSolveC" (fmat a) (fmat b) | 354 | linearSolveC a b = linearSolveSQAux id zgesv "linearSolveC" (fmat a) (fmat b) |
350 | 355 | ||
356 | mbLinearSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Maybe (Matrix (Complex Double)) | ||
357 | mbLinearSolveC a b = linearSolveSQAux mbCatch zgesv "linearSolveC" (fmat a) (fmat b) | ||
351 | 358 | ||
352 | -- | Solves a symmetric positive definite system of linear equations using a precomputed Cholesky factorization obtained by 'cholS'. | 359 | -- | Solves a symmetric positive definite system of linear equations using a precomputed Cholesky factorization obtained by 'cholS'. |
353 | cholSolveR :: Matrix Double -> Matrix Double -> Matrix Double | 360 | cholSolveR :: Matrix Double -> Matrix Double -> Matrix Double |
354 | cholSolveR a b = linearSolveSQAux dpotrs "cholSolveR" (fmat a) (fmat b) | 361 | cholSolveR a b = linearSolveSQAux id dpotrs "cholSolveR" (fmat a) (fmat b) |
355 | 362 | ||
356 | -- | Solves a Hermitian positive definite system of linear equations using a precomputed Cholesky factorization obtained by 'cholH'. | 363 | -- | Solves a Hermitian positive definite system of linear equations using a precomputed Cholesky factorization obtained by 'cholH'. |
357 | cholSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) | 364 | cholSolveC :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) |
358 | cholSolveC a b = linearSolveSQAux zpotrs "cholSolveC" (fmat a) (fmat b) | 365 | cholSolveC a b = linearSolveSQAux id zpotrs "cholSolveC" (fmat a) (fmat b) |
359 | 366 | ||
360 | ----------------------------------------------------------------------------------- | 367 | ----------------------------------------------------------------------------------- |
361 | foreign import ccall unsafe "linearSolveLSR_l" dgels :: TMMM | 368 | foreign import ccall unsafe "linearSolveLSR_l" dgels :: TMMM |
diff --git a/packages/base/src/Numeric/LinearAlgebra/Real.hs b/packages/base/src/Numeric/LinearAlgebra/Real.hs index 0e54555..8627084 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Real.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Real.hs | |||
@@ -29,7 +29,7 @@ module Numeric.LinearAlgebra.Real( | |||
29 | -- * Vector | 29 | -- * Vector |
30 | R, C, | 30 | R, C, |
31 | vec2, vec3, vec4, (&), (#), | 31 | vec2, vec3, vec4, (&), (#), |
32 | vect, | 32 | vector, |
33 | linspace, range, dim, | 33 | linspace, range, dim, |
34 | -- * Matrix | 34 | -- * Matrix |
35 | L, Sq, M, | 35 | L, Sq, M, |
@@ -39,7 +39,7 @@ module Numeric.LinearAlgebra.Real( | |||
39 | eye, | 39 | eye, |
40 | diagR, diag, | 40 | diagR, diag, |
41 | blockAt, | 41 | blockAt, |
42 | mat, | 42 | matrix, |
43 | -- * Products | 43 | -- * Products |
44 | (<>),(#>),(<ยท>), | 44 | (<>),(#>),(<ยท>), |
45 | -- * Linear Systems | 45 | -- * Linear Systems |
@@ -64,6 +64,7 @@ import Data.Proxy(Proxy) | |||
64 | import Numeric.LinearAlgebra.Static | 64 | import Numeric.LinearAlgebra.Static |
65 | import Text.Printf | 65 | import Text.Printf |
66 | 66 | ||
67 | |||
67 | ๐ :: Sized โ s c => s | 68 | ๐ :: Sized โ s c => s |
68 | ๐ = konst i_C | 69 | ๐ = konst i_C |
69 | 70 | ||
@@ -71,7 +72,7 @@ instance forall n . KnownNat n => Show (R n) | |||
71 | where | 72 | where |
72 | show (ud1 -> v) | 73 | show (ud1 -> v) |
73 | | singleV v = "("++show (v!0)++" :: R "++show d++")" | 74 | | singleV v = "("++show (v!0)++" :: R "++show d++")" |
74 | | otherwise = "(vect"++ drop 8 (show v)++" :: R "++show d++")" | 75 | | otherwise = "(vector"++ drop 8 (show v)++" :: R "++show d++")" |
75 | where | 76 | where |
76 | d = fromIntegral . natVal $ (undefined :: Proxy n) :: Int | 77 | d = fromIntegral . natVal $ (undefined :: Proxy n) :: Int |
77 | 78 | ||
@@ -79,7 +80,7 @@ instance forall n . KnownNat n => Show (C n) | |||
79 | where | 80 | where |
80 | show (C (Dim v)) | 81 | show (C (Dim v)) |
81 | | singleV v = "("++show (v!0)++" :: C "++show d++")" | 82 | | singleV v = "("++show (v!0)++" :: C "++show d++")" |
82 | | otherwise = "(fromList"++ drop 8 (show v)++" :: C "++show d++")" | 83 | | otherwise = "(vector"++ drop 8 (show v)++" :: C "++show d++")" |
83 | where | 84 | where |
84 | d = fromIntegral . natVal $ (undefined :: Proxy n) :: Int | 85 | d = fromIntegral . natVal $ (undefined :: Proxy n) :: Int |
85 | 86 | ||
@@ -117,8 +118,11 @@ vec3 a b c = R (gvec3 a b c) | |||
117 | vec4 :: โ -> โ -> โ -> โ -> R 4 | 118 | vec4 :: โ -> โ -> โ -> โ -> R 4 |
118 | vec4 a b c d = R (gvec4 a b c d) | 119 | vec4 a b c d = R (gvec4 a b c d) |
119 | 120 | ||
120 | vect :: forall n . KnownNat n => [โ] -> R n | 121 | vector :: KnownNat n => [โ] -> R n |
121 | vect xs = R (gvect "R" xs) | 122 | vector = fromList |
123 | |||
124 | matrix :: (KnownNat m, KnownNat n) => [โ] -> L m n | ||
125 | matrix = fromList | ||
122 | 126 | ||
123 | linspace :: forall n . KnownNat n => (โ,โ) -> R n | 127 | linspace :: forall n . KnownNat n => (โ,โ) -> R n |
124 | linspace (a,b) = mkR (LA.linspace d (a,b)) | 128 | linspace (a,b) = mkR (LA.linspace d (a,b)) |
@@ -157,7 +161,7 @@ instance forall m n . (KnownNat m, KnownNat n) => Show (L m n) | |||
157 | show (isDiag -> Just (z,y,(m',n'))) = printf "(diag %s %s :: L %d %d)" (show z) (drop 9 $ show y) m' n' | 161 | show (isDiag -> Just (z,y,(m',n'))) = printf "(diag %s %s :: L %d %d)" (show z) (drop 9 $ show y) m' n' |
158 | show (ud2 -> x) | 162 | show (ud2 -> x) |
159 | | singleM x = printf "(%s :: L %d %d)" (show (x `atIndex` (0,0))) m' n' | 163 | | singleM x = printf "(%s :: L %d %d)" (show (x `atIndex` (0,0))) m' n' |
160 | | otherwise = "(mat"++ dropWhile (/='\n') (show x)++" :: L "++show m'++" "++show n'++")" | 164 | | otherwise = "(matrix"++ dropWhile (/='\n') (show x)++" :: L "++show m'++" "++show n'++")" |
161 | where | 165 | where |
162 | m' = fromIntegral . natVal $ (undefined :: Proxy m) :: Int | 166 | m' = fromIntegral . natVal $ (undefined :: Proxy m) :: Int |
163 | n' = fromIntegral . natVal $ (undefined :: Proxy n) :: Int | 167 | n' = fromIntegral . natVal $ (undefined :: Proxy n) :: Int |
@@ -167,7 +171,7 @@ instance forall m n . (KnownNat m, KnownNat n) => Show (M m n) | |||
167 | show (isDiagC -> Just (z,y,(m',n'))) = printf "(diag %s %s :: M %d %d)" (show z) (drop 9 $ show y) m' n' | 171 | show (isDiagC -> Just (z,y,(m',n'))) = printf "(diag %s %s :: M %d %d)" (show z) (drop 9 $ show y) m' n' |
168 | show (M (Dim (Dim x))) | 172 | show (M (Dim (Dim x))) |
169 | | singleM x = printf "(%s :: M %d %d)" (show (x `atIndex` (0,0))) m' n' | 173 | | singleM x = printf "(%s :: M %d %d)" (show (x `atIndex` (0,0))) m' n' |
170 | | otherwise = "(fromList"++ dropWhile (/='\n') (show x)++" :: M "++show m'++" "++show n'++")" | 174 | | otherwise = "(matrix"++ dropWhile (/='\n') (show x)++" :: M "++show m'++" "++show n'++")" |
171 | where | 175 | where |
172 | m' = fromIntegral . natVal $ (undefined :: Proxy m) :: Int | 176 | m' = fromIntegral . natVal $ (undefined :: Proxy m) :: Int |
173 | n' = fromIntegral . natVal $ (undefined :: Proxy n) :: Int | 177 | n' = fromIntegral . natVal $ (undefined :: Proxy n) :: Int |
@@ -191,7 +195,7 @@ instance forall n. KnownNat n => Sized โ (R n) (Vector โ) | |||
191 | where | 195 | where |
192 | konst x = mkR (LA.scalar x) | 196 | konst x = mkR (LA.scalar x) |
193 | unwrap = ud1 | 197 | unwrap = ud1 |
194 | fromList = vect | 198 | fromList xs = R (gvect "R" xs) |
195 | extract (unwrap -> v) | 199 | extract (unwrap -> v) |
196 | | singleV v = LA.konst (v!0) d | 200 | | singleV v = LA.konst (v!0) d |
197 | | otherwise = v | 201 | | otherwise = v |
@@ -203,7 +207,7 @@ instance forall n. KnownNat n => Sized โ (R n) (Vector โ) | |||
203 | instance forall m n . (KnownNat m, KnownNat n) => Sized โ (L m n) (Matrix โ) | 207 | instance forall m n . (KnownNat m, KnownNat n) => Sized โ (L m n) (Matrix โ) |
204 | where | 208 | where |
205 | konst x = mkL (LA.scalar x) | 209 | konst x = mkL (LA.scalar x) |
206 | fromList = mat | 210 | fromList xs = L (gmat "L" xs) |
207 | unwrap = ud2 | 211 | unwrap = ud2 |
208 | extract (isDiag -> Just (z,y,(m',n'))) = diagRect z y m' n' | 212 | extract (isDiag -> Just (z,y,(m',n'))) = diagRect z y m' n' |
209 | extract (unwrap -> a) | 213 | extract (unwrap -> a) |
@@ -260,8 +264,7 @@ blockAt x r c a = mkL res | |||
260 | 264 | ||
261 | 265 | ||
262 | 266 | ||
263 | mat :: forall m n . (KnownNat m, KnownNat n) => [โ] -> L m n | 267 | |
264 | mat xs = L (gmat "L" xs) | ||
265 | 268 | ||
266 | -------------------------------------------------------------------------------- | 269 | -------------------------------------------------------------------------------- |
267 | 270 | ||
@@ -505,8 +508,8 @@ instance forall m n . (KnownNat m, KnownNat n, n <= m+1) => Diag (L m n) (R n) | |||
505 | 508 | ||
506 | -------------------------------------------------------------------------------- | 509 | -------------------------------------------------------------------------------- |
507 | 510 | ||
508 | linSolve :: (KnownNat m, KnownNat n) => L m m -> L m n -> L m n | 511 | linSolve :: (KnownNat m, KnownNat n) => L m m -> L m n -> Maybe (L m n) |
509 | linSolve (extract -> a) (extract -> b) = mkL (LA.linearSolve a b) | 512 | linSolve (extract -> a) (extract -> b) = fmap mkL (LA.linearSolve a b) |
510 | 513 | ||
511 | (<\>) :: (KnownNat m, KnownNat n, KnownNat r) => L m n -> L m r -> L n r | 514 | (<\>) :: (KnownNat m, KnownNat n, KnownNat r) => L m n -> L m r -> L n r |
512 | (extract -> a) <\> (extract -> b) = mkL (a LA.<\> b) | 515 | (extract -> a) <\> (extract -> b) = mkL (a LA.<\> b) |
@@ -617,7 +620,7 @@ test = (ok,info) | |||
617 | 620 | ||
618 | u = vec2 3 5 | 621 | u = vec2 3 5 |
619 | 622 | ||
620 | ๐ง x = vect [x] :: R 1 | 623 | ๐ง x = vector [x] :: R 1 |
621 | 624 | ||
622 | v = ๐ง 2 & 4 & 7 | 625 | v = ๐ง 2 & 4 & 7 |
623 | 626 | ||