Code Search for Developers
 
 
  

Margin.C from Magnus at Krugle


Show Margin.C syntax highlighted

#include "Margin.h"
#include "OneRelatorGroup.h"
#include "SubgroupOfOneRelatorGroup.h"
#include "HNNExtOfORGroup.h"

Margin globalMargin;

int rightMargin = 5 * 2;

void Margin::set( Margin& t )
{ 
  if( ptr ) {
    warn(" margin set duplicated");
    return;
  }

  *(Chars *)this = (Chars)t;
  (Chars &)t = (Chars &)t + "  ";
  ptr = &t;
}

void debugPrint( ostream& ostr, const OneRelatorGroup& G ) 
{
  ostr << "< ";
  bool comma = false;
  for( int i = 1; i <= G.numberOfGenerators(); ++i ) {
    if( comma ) 
      ostr << ", ";
    else
      comma = true;
    ostr << i;
  }
  ostr <<"; " << G.relator() << " >";
}

void debugPrint( ostream& ostr, const OneRelatorGroupRep& G ) 
{
  ostr << "< ";
  bool comma = false;
  for( int i = 1; i <= G.theNumberOfGenerators; ++i ) {
    if( comma ) 
      ostr << ", ";
    else
      comma = true;
    ostr << i;
  }
  ostr <<"; " << G.theRelator << " >";
}

void debugPrint( ostream& ostr, const HNNExtOfORGroupGeneric& H ) 
{
  ostr << "< ";
  debugPrint( ostr, H.basisGroup() );
  ostr << ", " << H.basisGroup().numberOfGenerators()+1 << " ; "
       << " A = " << H.subgroup(HNNExtOfORGroupGeneric::A).generators() << " ; " 
       << " B = " << H.subgroup(HNNExtOfORGroupGeneric::B).generators() << " >";
}

void debugPrint( ostream& ostr, const ORGSubgroup& S )
{
  ostr << "gp(" << S.generators() << " ; ";
  debugPrint( ostr, S.parentGroup() );
  ostr << ')';  
}

void debugPrint( ostream& ostr, const SubgroupOfOneRelatorGroup& S )
{
  ostr << "gp(" << S.generators() << " ; ";
  debugPrint( ostr, S.parentGroup() );
  ostr << ')';  
}





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

  AP-fixups.C
  APofFreeGroupsRep.C
  APwithOneRelatorRep.C
  AmalgamatedProductParser.C
  CONDITION.C
  HNNExtOfFreeGroup.C
  HNNExtOfORGroup.C
  HNNExtension.C
  HNNParser.C
  MagnusBreakdown.C
  Margin.C
  ORProblems.C
  OneRelatorGroup.C
  OneRelatorGroupWithTorsion.C
  Range.C
  ShortenByRelators2.C
  SubgroupOfOneRelatorGroup.C
  SuperGen.C
  Whitehead.C
  maximalRoot.C