Charles V. Schaefer, Jr. School of Engineering and Science
 
 
ACC Top Page » Algebra and Cryptology Center » Software

Software

The CRAG Software Library FAQ

// Copyright (C) 2005 Alexander Ushakov
// Contents: Example for Monte Carlo method for solving 
// the Diophantine problem for Quadratic Equations over Free Groups
//
// Principal Authors: Alexander Ushakov
//
// Revision History:
//


#include "Equation.h"
#include "QuadEquatTransformationGraph.h"


//---------------------------------------------------------------------------//
//----------------------------------- main ----------------------------------//
//---------------------------------------------------------------------------//


int main( )
{
 
// How do I generate a random quadratic equation?
  int nGen = 2;
  int nVar = 3;
  int len = 8;
  Equation eq = Equation::randomQuadraticEquation( nGen , nVar , len );
  cout << "Eq = " << eq << endl;
  
  
 
// How do I solve a quadratic equation using Monte-Carlo method?
  QuadEquationTranformationGraph MC( eq );
  int max_iter = 10000;
  for( int iter=0 ; iter