'; // declare variables (with initial value) $k=0; $n=0; $output="-revlex"; $negate=0; $uniform=0; $simple=0; $renumerate=0; $reorient=0; $acyclic=0; $onlynumber=0; $group=""; $aut=""; $mat=""; $known=""; $circs=""; $reset=0; foreach($_POST as $key => $value) { if($DEBUG) echo "$key = $value\n"; if($key=="k") $k=$value; if($key=="n") $n=$value; if($key=="output") $output=$value; if($key=="negate") $negate=1; if($key=="uniform") $uniform=1; if($key=="simple") $simple=1; if($key=="renumerate") $renumerate=1; if($key=="reorient") $reorient=1; if($key=="acyclic") $acyclic=1; if($key=="onlynumber") $onlynumber=1; if($key=="group") $group=$value; if($key=="aut") $aut=$value; if($key=="mat") $mat=$value; if($key=="known") $known=$value; if($key=="circs") $circs=$value; if($key=="reset") $reset=1; } // default values if($reset || $k==0) { $k=4; $n=6; $output="-revlex"; $negate=1; $renumerate=1; $reorient=0; $uniform=1; $simple=1; $acyclic=0; $onlynumber=0; $group=""; $aut=""; $mat=""; $known=""; $circs=""; $reset=0; } // build up command line: $command="./origen5 -ordgen $k $n $output"; if($negate) $command.=" -canneg"; if($uniform) $command.=" -uniform"; if($simple) $command.=" -simple"; if($renumerate) $command.=" -canlab"; if($reorient) $command.=" -canori"; if($acyclic) $command.=" -acyclic"; if($group!="") $command.=" -G \"$group\""; if($aut!="") $command.=" -A \"$aut\""; if($mat!="") $command.=" -M \"$mat\""; if($known!="") $command.=" -K \"$known\""; if($circs!="") $command.=" -circs \"$circs\""; if(!$onlynumber) $command.=" -o"; if($DEBUG) echo "$command"; if($DEBUG) echo ''; ?>

Generation of oriented matroids

Last changed on 29.6.2007.

For further explanations, see:
R. Gugisch: Konstruktion von Isomorphieklassen orientierter Matroide, Bayreuther Mathematische Schriften 72, Bayreuth, 2005


Input for generation process:

We generate oriented matroids of rank k over n points:

k:       n:

Format:
> standard lexicoraphic
> reverse lexicoraphic

Consider isomorphisms:
> negation
> renumeration
> reorientation  

Further options:
> uniform
> simple
> acyclic

    

Operating group G
eg. <(0,1),(0,1,2),(3,4),(3,4,5)> check isomorphism-option renumeration above.:

Prescribed group of automorphisms A
eg. <(0,1,2)(3,4,5)> should be a normal subgroup of G, isomorphism-option reorientation should be off.:

Underlying matroid M
eg. 4..+++.+++++++++ Should be fix under G :

Known values of chirotope
eg. 4............+++ Should be fix under G:

Forbidden circuits
eg. (0,1,2,-3,-4),(0,1,2,-3,-5),(0,1,2,-4,-5) Should be fix under G:


Generated oriented matroids:         

0) {
      return trim(fgets($istream, 1024));
    }
    return FALSE;
  }

  function start_origen() {
    global $process;
    global $pipes;
    global $command;

    $REMOTE_ADDR=getenv('REMOTE_ADDR');
    $HTTP_USER_AGENT=getenv('HTTP_USER_AGENT');
    $fp=fopen("origen.log","a");
    fputs($fp,date("[Y/m/d-H:i:s]")." $REMOTE_ADDR: START:   origen $command  \t($HTTP_USER_AGENT)\n");    
    fclose($fp);

    $descriptorspec = array(
      0 => array("pipe", "r"),  // stdin is a pipe that the child will read from
      1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
      2 => array("file", "origen.log", "a") // stderr is a file to write to
    );
    $process = proc_open("$command 2>&1", $descriptorspec, $pipes);
  }

  function close_origen() {
    global $process;
    global $pipes;

    fclose($pipes[0]);
    fclose($pipes[1]);
    proc_close($process);

    $REMOTE_ADDR=getenv('REMOTE_ADDR');
    $HTTP_USER_AGENT=getenv('HTTP_USER_AGENT');
    $fp=fopen("origen.log","a");
    fputs($fp,date("[Y/m/d-H:i:s]")." $REMOTE_ADDR: DONE(".connection_status()."): $command \t($HTTP_USER_AGENT)\n");    
    fclose($fp);
  }


  // **************************************************
  // main program...

  flush();
  ignore_user_abort(true);
  start_origen();
  if (is_resource($process)) {
    $start=$time=time();
    $i=0;
    $stop=0;
    $handle=$pipes[1];
    while (!feof($pipes[1])) {
      if(!$stop) {
        if(connection_status() || $time-$start>=$TIMEOUT) {
          $stop=1;
          fwrite($pipes[0], "C"); // causes origen to interrupt itself.
        }
      }
      if(!($line = fgets_u($pipes[1]))) continue;
      $i++;
      echo "$line\n";
      $now=time(); if($now!=$time) { 
        echo "";
        flush(); $time=$now; 
      }
    }
    if(connection_status()) {
      // output would not reach browser; User should press Cancel button above! 
    } else if($time-$start>=$TIMEOUT) {   
      echo "";
    } else {                          // origen finished regularly
//      --$i;  // last line of output was only a comment
      echo "";
    }
    close_origen();
  }
?>