Class: Algebra::PermutationGroup
- Defined in:
- lib/algebra/permutation-group.rb
Instance Attribute Summary collapse
-
#degree ⇒ Object
readonly
Returns the value of attribute degree.
Attributes inherited from Group
Attributes inherited from Set
Class Method Summary collapse
- .alternate(n) ⇒ Object
- .perm(a) ⇒ Object
- .symmetric(n) ⇒ Object
- .unit_group(d) ⇒ Object
- .unity(n) ⇒ Object
Instance Method Summary collapse
-
#initialize(u, *a) ⇒ PermutationGroup
constructor
A new instance of PermutationGroup.
Methods inherited from Group
#D, #K, #Z, #ascending_central_series, #center, #center?, #centralizer, #closed?, #commutator, #commutator_series, #complete, #complete!, #conjugacy_class, #conjugacy_classes, #descending_central_series, generate_strong, #nilpotency_class, #nilpotent?, #normal?, #normal_subgroups, #normalizer, #quotient_group, #semi_complete, #semi_complete!, #separate, #simple?, #solvable?, #subgroups, #to_a, #unit_group
Methods inherited from Set
#<, #>, [], #append, #append!, #bijections, #cast, #concat, #decreasing_series, #difference, #dup, #each, #each_member, #each_non_trivial_subset, #each_pair, #each_product, #each_subset, #empty?, #empty_set, empty_set, #eql?, #equiv_class, #hash, #identity_map, #include?, #increasing_series, #injections, #injections0, #inspect, #intersection, #map_s, new_a, new_h, null, phi, #pick, #power, #power_set, #product, #rehash, #separate, #shift, #singleton, singleton, #singleton?, #size, #sort, #subset?, #superset?, #surjections, #to_a, #to_ary, #to_s, #union
Methods included from OperatorDomain
#left_act, #left_orbit!, #left_quotient, #left_representatives, #right_act, #right_orbit!, #right_quotient, #right_representatives
Methods included from Enumerable
Constructor Details
#initialize(u, *a) ⇒ PermutationGroup
Returns a new instance of PermutationGroup.
37 38 39 40 |
# File 'lib/algebra/permutation-group.rb', line 37 def initialize(u, *a) @degree = u.degree super(u, *a) end |
Instance Attribute Details
#degree ⇒ Object (readonly)
Returns the value of attribute degree.
42 43 44 |
# File 'lib/algebra/permutation-group.rb', line 42 def degree @degree end |
Class Method Details
.alternate(n) ⇒ Object
33 34 35 |
# File 'lib/algebra/permutation-group.rb', line 33 def self.alternate(n) symmetric(n).separate { |x| x.sign > 0 } # slow two times end |
.perm(a) ⇒ Object
21 22 23 |
# File 'lib/algebra/permutation-group.rb', line 21 def self.perm(a) Permutation.new(a) end |
.symmetric(n) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/algebra/permutation-group.rb', line 25 def self.symmetric(n) s = new(unity(n)) Combinatorial.perm(n) do |x| s << perm(x) # unity is not duplicated naturally end s end |
.unit_group(d) ⇒ Object
13 14 15 |
# File 'lib/algebra/permutation-group.rb', line 13 def self.unit_group(d) self[unity(d)] end |
.unity(n) ⇒ Object
17 18 19 |
# File 'lib/algebra/permutation-group.rb', line 17 def self.unity(n) Permutation.unity(n) end |