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 class LinkedBraidStructure and DehornoyForm
//
// Principal Authors: Alexander Ushakov
//
// Revision History:
//

#include "Word.h"

#include "iostream"
using namespace std;


//---------------------------------------------------------------------------//
//------------------------- Examples: Word ----------------------------------//
//---------------------------------------------------------------------------//

int main( )
{
  // Fix the number of strands and the length of a braid word
  int N = 5;
  int L = 20;
  
  
 
// How do I generate a random freely reduced braid word from B_N of length L?
  Word w1 = Word::randomWord( N-1 , L );
  Word w2 = Word::randomWord( N-1 , L );
  
  
 
// How do I invert a braid word?
  Word u1 = -w1;
  

 
// How do I multiply braid words?
  Word p = w1 * w2 * u1 * -w2;    // here p = [w1,w2]; the result of the product is reduced whenever each factor is
  
  
  return 0;
}