diff options
Diffstat (limited to 'packages/base')
-rw-r--r-- | packages/base/src/Internal/Algorithms.hs | 2 | ||||
-rw-r--r-- | packages/base/src/Internal/LAPACK.hs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/packages/base/src/Internal/Algorithms.hs b/packages/base/src/Internal/Algorithms.hs index 1ca373f..f5bddc6 100644 --- a/packages/base/src/Internal/Algorithms.hs +++ b/packages/base/src/Internal/Algorithms.hs | |||
@@ -522,7 +522,7 @@ eig = {-# SCC "eig" #-} eig' | |||
522 | -- Eigenvalues are represented as pairs of alpha, beta, where eigenvalue = alpha / beta. Alpha is always | 522 | -- Eigenvalues are represented as pairs of alpha, beta, where eigenvalue = alpha / beta. Alpha is always |
523 | -- complex, but betas has the same type as the input matrix. | 523 | -- complex, but betas has the same type as the input matrix. |
524 | -- | 524 | -- |
525 | -- If @(alphas, betas, v) = geig a b@, then @a \<> v == diag (alphas / betas) \<> b \<> v@ | 525 | -- If @(alphas, betas, v) = geig a b@, then @a \<> v == b \<> v \<> diag (alphas / betas)@ |
526 | -- | 526 | -- |
527 | -- Note that beta can be 0 and that has reasonable interpretation. | 527 | -- Note that beta can be 0 and that has reasonable interpretation. |
528 | geig :: Field t => Matrix t -> Matrix t -> (Vector (Complex Double), Vector t, Matrix (Complex Double)) | 528 | geig :: Field t => Matrix t -> Matrix t -> (Vector (Complex Double), Vector t, Matrix (Complex Double)) |
diff --git a/packages/base/src/Internal/LAPACK.hs b/packages/base/src/Internal/LAPACK.hs index c9f5d0f..ff55688 100644 --- a/packages/base/src/Internal/LAPACK.hs +++ b/packages/base/src/Internal/LAPACK.hs | |||
@@ -307,9 +307,10 @@ fixeig _ _ = error "fixeig with impossible inputs" | |||
307 | -- can be different. Therefore old 'fixeig' would fail for 'eigG'. | 307 | -- can be different. Therefore old 'fixeig' would fail for 'eigG'. |
308 | fixeigG [] _ = [] | 308 | fixeigG [] _ = [] |
309 | fixeigG [_] [v] = [comp' v] | 309 | fixeigG [_] [v] = [comp' v] |
310 | fixeigG ((ar1:+ai1) : an : as) (v1:v2:vs) | 310 | fixeigG ((_:+ai1) : an : as) (v1:v2:vs) |
311 | | abs ai1 > 1e-13 = toComplex' (v1, v2) : toComplex' (v1, mapVector negate v2) : fixeigG as vs | 311 | | abs ai1 > 1e-13 = toComplex' (v1, v2) : toComplex' (v1, mapVector negate v2) : fixeigG as vs |
312 | | otherwise = comp' v1 : fixeigG (an:as) (v2:vs) | 312 | | otherwise = comp' v1 : fixeigG (an:as) (v2:vs) |
313 | fixeigG _ _ = error "fixeigG with impossible inputs" | ||
313 | 314 | ||
314 | -- | Eigenvalues of a general real matrix, using LAPACK's /dgeev/ with jobz == \'N\'. | 315 | -- | Eigenvalues of a general real matrix, using LAPACK's /dgeev/ with jobz == \'N\'. |
315 | -- The eigenvalues are not sorted. | 316 | -- The eigenvalues are not sorted. |