Skip to content

Commit

Permalink
Fix regular character
Browse files Browse the repository at this point in the history
  • Loading branch information
aidevnn committed Jun 4, 2024
1 parent a454d70 commit 15edd21
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions FastGoat/UserGroup/Characters/CharacterTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ public void SolveSumSquare()
}
}

private bool RegularCharacter()
private Character<T> RegularCharacter()
{
if (AllCharacters.Count(chi => !chi.HasAllValues) != 1)
return false;
return ChiE;

SolveSumSquare();
var e = Gr.Neutral();
var doneChis = DoneChis;
var idx = AllCharacters.ToList().FindIndex(chi => !chi.HasAllValues);
Expand All @@ -179,8 +180,7 @@ private bool RegularCharacter()
foreach (var (k, v) in map.ToArray())
map[k] = v / c0;

AllCharacters[idx] = new(Classes, map);
return true;
return new Character<T>(Classes, map);
}

public void InductionFromSubGroup(ConcreteGroup<T> subGr)
Expand All @@ -198,7 +198,7 @@ public void InductionFromSubGroup(ConcreteGroup<T> subGr)
{
var ind = FG.Induction(chi, Classes);
var indState = AddCharacter(ind);
if (indState == AddCharacterState.TableFull || RegularCharacter())
if (indState == AddCharacterState.TableFull)
return;
}
}
Expand All @@ -217,7 +217,7 @@ public void InductionFromSubGroup(CharacterTable<T> ctSubGr)
{
var ind = FG.Induction(chi, Classes);
var indState = AddCharacter(ind);
if (indState == AddCharacterState.TableFull || RegularCharacter())
if (indState == AddCharacterState.TableFull)
return;
}
}
Expand All @@ -243,7 +243,7 @@ public void RestrictionFromSuperGroup(ConcreteGroup<T> superGr)
{
var res = FG.Restriction(chi, Classes);
var resState = AddCharacter(res);
if (resState == AddCharacterState.TableFull || RegularCharacter())
if (resState == AddCharacterState.TableFull)
return;
}
}
Expand All @@ -268,7 +268,7 @@ public void RestrictionFromSuperGroup(CharacterTable<T> ctSuperGr)
{
var res = FG.Restriction(chi, Classes);
var resState = AddCharacter(res);
if (resState == AddCharacterState.TableFull || RegularCharacter())
if (resState == AddCharacterState.TableFull)
return;
}
}
Expand All @@ -286,11 +286,17 @@ public AddCharacterState AddCharacter(Character<T> chi1)
{
var chi3 = chi2 * chiLinear;
var (chiLinState, _) = AddCharacterInternal(chi3);
// Console.WriteLine(new { chiLinState, chiLinear, chi2, chi3 });
if (chiLinState == AddCharacterState.TableFull)
return AddCharacterState.TableFull;
}
}

var reg = RegularCharacter();
if (!reg.IsIdentity)
{
AddCharacterInternal(reg);
return AddCharacterState.TableFull;
}
}

return chiState;
Expand Down

0 comments on commit 15edd21

Please sign in to comment.