Created
April 1, 2018 19:55
-
-
Save oppahero/4b6171909ecb926cef681b76019192ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Para buscar los subgrupos cíclicos | |
public void generadorCiclico (Permutacion perm){ | |
int i=0; | |
boolean bandera = true; | |
if(perm != null){ | |
ArrayList<Permutacion> aux = new ArrayList<Permutacion>(); | |
Permutacion auxPerm =perm; | |
do{ | |
auxPerm = powT(perm,i); //Usamos la potencia. i: Cantidad de veces a componer | |
if (i++==0){ //El elemento neutro | |
aux.add(auxPerm); | |
continue; | |
} | |
if(aux.get(0).getNombre() == auxPerm.getNombre()){ | |
bandera=false; | |
continue; | |
} | |
aux.add(auxPerm); | |
}while(bandera); //Hasta que el ultimo resultado sea igual que el primero guardado. | |
if(!seEncuentra(aux,subGrupos)) //Si no se ha guardado ya | |
subGrupos.add(aux); //lo agregamos | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment