1 8 package org.lsmp.djep.groupJep.groups; 9 10 import org.lsmp.djep.groupJep.GroupI; 11 import org.lsmp.djep.groupJep.values.*; 12 import org.lsmp.djep.groupJep.interfaces.*; 13 14 23 public class PermutationGroup extends Group implements GroupI , HasListI { 24 25 protected Permutation zeroPerm; 26 27 public PermutationGroup(int n) 28 { 29 Integer perm[] = new Integer [n]; 30 for(int i=0;i<n;++i) 31 perm[i]=new Integer (i+1); 32 zeroPerm = new Permutation(this,perm); 33 } 34 35 public Number getZERO() { 36 return zeroPerm; 37 } 38 39 public Number getInverse(Number a) { 40 return ((Permutation) a).getInverse(); 41 } 42 43 public Number add(Number a, Number b) { 44 return ((Permutation) a).add((Permutation) b); 45 } 46 47 public Number sub(Number a, Number b) { 48 return ((Permutation) a).sub((Permutation) b); 49 } 50 51 public boolean equals(Number a, Number b) { 52 return ((Permutation) a).equals((Permutation) b); 53 } 54 55 public Number valueOf(String s) { 56 return Integer.valueOf(s); 57 } 58 59 public Number valueOf(Number [] eles) { 60 61 Integer perm[] = new Integer [eles.length]; 62 for(int i=0;i<eles.length;++i) 63 perm[i]=new Integer (eles[i].intValue()); 64 Permutation res = new Permutation(this,perm); 65 return res; 66 } 67 68 public Number list(Number [] eles) { 69 return this.valueOf(eles); 70 } 71 72 } 73 | Popular Tags |