diff options
author | Jeshiba <baconp@gmail.com> | 2017-07-12 16:03:31 -0400 |
---|---|---|
committer | Jeshiba <baconp@gmail.com> | 2017-07-12 16:03:31 -0400 |
commit | 523ba0227915169ad2423caf21d80c0252f26165 (patch) | |
tree | 4358e65668a0d32081d0487080af2f1af25d5e05 /Math | |
parent | 6ce11c525d765b22261d06a939247b9f1e0e3a38 (diff) |
revised longestElement
Diffstat (limited to 'Math')
-rw-r--r-- | Math/Combinatorics/RootSystem.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Math/Combinatorics/RootSystem.hs b/Math/Combinatorics/RootSystem.hs index 53cf65c..e388a23 100644 --- a/Math/Combinatorics/RootSystem.hs +++ b/Math/Combinatorics/RootSystem.hs @@ -76,7 +76,7 @@ longestElement ss = longestElement' [] posRoots posRoots = positiveRoots ss
longestElement' :: [[Q]] -> [[Q]] -> [[Q]]
longestElement' xs rs =
- let ys = (S.fromList ss) S.\\ (S.fromList $ negateM rs) in
+ let ys = (S.fromList ss) S.\\ (S.fromList $ negateM rs) S.\\ (if null xs then S.empty else S.singleton (head xs)) in
if S.null ys
then xs
else let alpha = (head (S.toList ys)) in
|