diff options
Diffstat (limited to 'packages/base/src/Numeric/LinearAlgebra/Util.hs')
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Util.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Util.hs b/packages/base/src/Numeric/LinearAlgebra/Util.hs index 2e632b7..eadd2a2 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Util.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Util.hs | |||
@@ -66,7 +66,7 @@ import Control.Monad(when) | |||
66 | import Text.Printf | 66 | import Text.Printf |
67 | import Data.List.Split(splitOn) | 67 | import Data.List.Split(splitOn) |
68 | import Data.List(intercalate) | 68 | import Data.List(intercalate) |
69 | import Foreign.C.Types(CInt) | 69 | import Data.Packed.Internal.Numeric(I) |
70 | 70 | ||
71 | type ℝ = Double | 71 | type ℝ = Double |
72 | type ℕ = Int | 72 | type ℕ = Int |
@@ -271,7 +271,7 @@ instance Normed (Matrix ℂ) | |||
271 | norm_2 = pnorm PNorm2 | 271 | norm_2 = pnorm PNorm2 |
272 | norm_Inf = pnorm Infinity | 272 | norm_Inf = pnorm Infinity |
273 | 273 | ||
274 | instance Normed (Vector CInt) | 274 | instance Normed (Vector I) |
275 | where | 275 | where |
276 | norm_0 = fromIntegral . sumElements . step . abs | 276 | norm_0 = fromIntegral . sumElements . step . abs |
277 | norm_1 = fromIntegral . norm1 | 277 | norm_1 = fromIntegral . norm1 |
@@ -299,7 +299,7 @@ mt = trans . inv | |||
299 | -------------------------------------------------------------------------------- | 299 | -------------------------------------------------------------------------------- |
300 | {- | | 300 | {- | |
301 | 301 | ||
302 | >>> size $ fromList[1..10::Double] | 302 | >>> size $ vector [1..10] |
303 | 10 | 303 | 10 |
304 | >>> size $ (2><5)[1..10::Double] | 304 | >>> size $ (2><5)[1..10::Double] |
305 | (2,5) | 305 | (2,5) |
@@ -308,15 +308,15 @@ mt = trans . inv | |||
308 | size :: Container c t => c t -> IndexOf c | 308 | size :: Container c t => c t -> IndexOf c |
309 | size = size' | 309 | size = size' |
310 | 310 | ||
311 | {- | | 311 | {- | Alternative indexing function. |
312 | 312 | ||
313 | >>> vect [1..10] ! 3 | 313 | >>> vector [1..10] ! 3 |
314 | 4.0 | 314 | 4.0 |
315 | 315 | ||
316 | >>> mat 5 [1..15] ! 1 | 316 | >>> matrix 5 [1..15] ! 1 |
317 | fromList [6.0,7.0,8.0,9.0,10.0] | 317 | fromList [6.0,7.0,8.0,9.0,10.0] |
318 | 318 | ||
319 | >>> mat 5 [1..15] ! 1 ! 3 | 319 | >>> matrix 5 [1..15] ! 1 ! 3 |
320 | 9.0 | 320 | 9.0 |
321 | 321 | ||
322 | -} | 322 | -} |
@@ -333,7 +333,7 @@ instance Indexable (Vector Float) Float | |||
333 | where | 333 | where |
334 | (!) = (@>) | 334 | (!) = (@>) |
335 | 335 | ||
336 | instance Indexable (Vector CInt) CInt | 336 | instance Indexable (Vector I) I |
337 | where | 337 | where |
338 | (!) = (@>) | 338 | (!) = (@>) |
339 | 339 | ||