aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeshiba <baconp@gmail.com>2017-07-12 16:03:31 -0400
committerJeshiba <baconp@gmail.com>2017-07-12 16:03:31 -0400
commit523ba0227915169ad2423caf21d80c0252f26165 (patch)
tree4358e65668a0d32081d0487080af2f1af25d5e05
parent6ce11c525d765b22261d06a939247b9f1e0e3a38 (diff)
revised longestElement
-rw-r--r--Math/Combinatorics/RootSystem.hs2
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