From ae83e43b4e66c49c3ab60b139e6b5b25881c3549 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Thu, 18 Jan 2024 13:29:08 +0100 Subject: [PATCH] small addition to permutation.h --- permutation.h | 5 +++-- t.cc | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/permutation.h b/permutation.h index a43c5f3..48af5d1 100644 --- a/permutation.h +++ b/permutation.h @@ -121,6 +121,7 @@ public: WeightPermutation operator*(const R &x) const {return WeightPermutation(weight*x,perm); } bool operator==(const WeightPermutation &rhs) const {return this->perm == rhs.perm;}; //NOTE for sorting, compares only the permutation not the weight! + bool operator!=(const WeightPermutation &rhs) const {return !(*this==rhs);} //NOTE: compares only the permutation bool operator>(const WeightPermutation &rhs) const {return this->perm > rhs.perm;}; bool operator<(const WeightPermutation &rhs) const {return this->perm < rhs.perm;}; bool operator>=(const WeightPermutation &rhs) const {return !(*this < rhs);}; @@ -185,8 +186,8 @@ public: void simplify(const typename LA_traits::normtype thr=0) {NRVec_simplify(*this,thr);}; bool operator==(PermutationAlgebra &rhs); //do NOT inherit from NRVec, as the underlying one ignores weights for the simplification; also we have to simplify before comparison bool is_zero() const {return size()==0;}; //assume it was simplified - bool is_scaled_identity() const {return size()==1 && (*this)[0]. is_scaledidentity();}; //assume it was simplified - bool is_identity() const {return size()==1 && (*this)[0]. is_identity();}; //assume it was simplified + bool is_scaled_identity() const {return size()==1 && (*this)[0].is_scaledidentity();}; //assume it was simplified + bool is_identity() const {return size()==1 && (*this)[0].is_identity();}; //assume it was simplified }; diff --git a/t.cc b/t.cc index 5f6cf38..f8a79ec 100644 --- a/t.cc +++ b/t.cc @@ -3095,7 +3095,16 @@ for(int i=0; i > groups; cin >> groups; int ntot=0;