Code Search for Developers
 
 
  

debug-RandomPrimitiveElement.C from Magnus at Krugle


Show debug-RandomPrimitiveElement.C syntax highlighted

#include <iostream>
#include "RandomPrimitiveElement.h"
#include "FreeGroup.h"
#include "WhiteheadAutomorphisms.h"

main( )
{
  FreeGroup F;

  cout << "Enter a free group:" << endl << flush;

  Chars errMesg = cin >> F;

  if ( errMesg.length() > 0 ) {
	 cout << errMesg << endl << endl;
	 exit;
  }
  else cout << "\n\nYou typed:\n" << F << endl << endl;

  cout << "Enter a seed (1000-2000):" << endl << flush;
  int seed;
  cin >> seed;
  cout << "Enter an average number of Whitehead automorphisms to apply:" << endl << flush;
  int avgGenNum;
  cin >> avgGenNum;
  cout << "How many tests you want to run:" << endl << flush;
  int numOfTests;
  cin >> numOfTests;
  
  RandomPrimitiveElement rp(F,seed);
  
  for ( int i = 0; i < numOfTests; i++ ) {
    Word elt = rp.getElement( avgGenNum );
    cout << elt << endl;

    WhiteheadAutomorphisms WA( F );
    WA.startComputation( elt );
    while ( !WA.continueComputation() );
    if ( WA.isPrimitive() ) cout << "PRIMITIVE." << endl << flush;
    else cout << "NOT PRIMITIVE!!!!!!!!!!!!!!!?" << endl << flush;

  }

  return 1;
}




See more files for this project here

Magnus

Magnus is a special purpose mathematical package for Infinite Group Theory computations

Project homepage: http://sourceforge.net/projects/magnus
Programming language(s): C,C++
License: other

  debug-AbelianGroup.C
  debug-AbelianInfinitenessProblem.C
  debug-EquationParser.C
  debug-MSCGConjugacyProblem.C
  debug-MSCGroup.C
  debug-MSCGroup.data
  debug-MSCGroup.testout
  debug-RandomAutomorphism.C
  debug-RandomMSCGroup.C
  debug-RandomPrimitiveElement.C
  debug-TietzeTrekker.C
  test-SymmetricRelators.C