Exemple #1
0
 /// Create all partitions according to job options
 STATUS makePartitions()  {
   std::string typ, nam;
   PartitionDefs::iterator j;
   clearPartitions().ignore();
   for(j=m_partitionDefs.begin(); j != m_partitionDefs.end(); ++j)  {
     Tokenizer tok(true);
     Tokenizer::Items::iterator i;
     tok.analyse(*j, " ", "", "", "=", "'", "'");
     for(i = tok.items().begin(); i != tok.items().end(); i++ )   {
       CSTR& t = (*i).tag();
       CSTR& v = (*i).value();
       switch( ::toupper(t[0]) )    {
       case 'N':
         nam = v;
         break;
       case 'T':
         typ = v;
         break;
       }
     }
     STATUS sc = create(nam, typ);
     if ( !sc.isSuccess() )  {
       return sc;
     }
     else if ( !m_defaultPartition.length() )  {
       m_defaultPartition = nam;
     }
   }
   return STATUS::SUCCESS;
 }
Exemple #2
0
 /// Service initialisation
 virtual STATUS finalize()   {
   setDataLoader(0).ignore();
   clearStore().ignore();
   clearPartitions().ignore();
   m_current = Partition();
   detachServices();
   return Service::finalize();
 }
Exemple #3
0
Nauty::Nauty(int vertices)
{

  n_ = vertices;
  m_ = (n_ + WORDSIZE - 1)/WORDSIZE;

  //printf ("size of long = %d (%d)\nwordsize = %d\nn,m = %d,%d\n", 
  //          SIZEOF_LONG, sizeof (long), WORDSIZE, n_, m_);

  nauty_check (WORDSIZE, m_, n_, NAUTYVERSIONID);

  /// Apparently sizes are skewed on 64bit machines

#define MULTIPLIER 2

  G_ = (graph *) malloc(MULTIPLIER * m_ * n_ * sizeof(int));
  lab_ = (int *) malloc(MULTIPLIER * n_ * sizeof(int));  
  ptn_ = (int *) malloc(MULTIPLIER * n_ * sizeof(int));
  active_ = NULL;
  orbits_ = (int *) malloc(MULTIPLIER * n_ * sizeof(int));
  options_ = (optionblk *) malloc(MULTIPLIER * sizeof(optionblk));
  stats_ = (statsblk *) malloc(MULTIPLIER * sizeof(statsblk));
  worksize_ = 100*m_;
  workspace_ = (setword *) malloc(MULTIPLIER * worksize_*sizeof(setword));
  canonG_ = NULL;
  if (G_ == 0 || lab_ == 0 || ptn_ == 0 || 
      orbits_ == 0 || options_ == 0 || stats_ == 0 ||
      workspace_ == 0) assert(0);

  // Zero allocated memory
  memset(G_, 0, m_*n_*sizeof(int));
  memset(lab_, 0, n_*sizeof(int));
  memset(ptn_, 0, n_*sizeof(int));
  memset(orbits_, 0, n_*sizeof(int));
  memset(workspace_, 0, worksize_*sizeof(setword));

  // Set the options you want
  options_->getcanon = FALSE;
  options_->digraph = FALSE;
  options_->writeautoms = FALSE;
  options_->writemarkers = FALSE;
  options_->defaultptn = TRUE;
  options_->cartesian = FALSE;
  options_->linelength = 78;
  options_->outfile = NULL;
  options_->userrefproc = NULL;
  options_->userautomproc = NULL;
  options_->userlevelproc = NULL;
  options_->usernodeproc = NULL;
  //  options_->usertcellproc = NULL;
  options_->invarproc = NULL;
  options_->tc_level = 100;
  options_->mininvarlevel = 0;
  options_->maxinvarlevel = 1;
  options_->invararg = 0;
  options_->dispatch = &dispatch_graph;
   // Make an empty graph
  for (int j = 0; j < n_; j++) {
    set *gv = GRAPHROW(G_, j, m_);
    EMPTYSET(gv, m_);
  }

  vstat_ = new int[n_];
   clearPartitions();
   afp_ = NULL;
 }
Exemple #4
0
 /// Standard Destructor
 virtual ~MultiStoreSvc()  {
   setDataLoader(0).ignore();
   resetPreLoad().ignore();
   clearStore().ignore();
   clearPartitions().ignore();
 }