"#6600aa", "X" => "#0000ff", "Y" => "#00aa00", "Z" => "#ff0000", "U" => "#FF6600", "V" => "#AAAA00", "A" => "#000000");
$colr = array("W" => "purple", "X" => "blue", "Y" => "green", "Z" => "red", "U" => "orange", "V" => "yellow");
preg_match_all("/([A-Z])([0-9]*)(e([0-9]))?/", $problem_name,$nom);
echo('Enumerative Problem ');
for($i=0; $i('.$nom{1}{$i}.''.$nom{2}{$i}.')'.$nom{4}{$i}.'';
}
else{
echo '('.$nom{1}{$i}.''.$nom{2}{$i}.')'.$nom{4}{$i}.'';
}
}
echo(' = '.$numsolutions.' on Fl('.$flagvariety.' ; '.$dimension.')');
////////////////////////////////////////////////////////////////////////////////////////////
?>
Problem View
';
?>
";
$arr[$matches[1][$q]][$matches[2][$q]] = $matches[3][$q];
if ( $matches[2][$q] > $maxcross ) {
$maxcross = $matches[2][$q];
}
}
}
echo("
");
if( $vertical_table ) {
echo("Make table horizontal");
}
else {
echo("Make table vertical");
}
echo(" . . . . . ");
if( $show_totals ) {
echo("Hide totals");
}
else {
echo("Show totals");
}
echo("
");
// show better looking table
// TRANSPOS'D!!! by Zach
// And added row+column totals!!!
$atable = new html_table(array('border' => 1,'width' => '0%','cellpadding' => 2));
$atable->alternate_color(0,'#DCFFFD');
$atable->celldefault['width'] = 35;
$atable->celldefault['align'] = 'right';
// Display the table vertically or horizontally, depending on the $vertical_table option.
if( $vertical_table) {
echo "Overlap Number \\ Number of Solutions";
// First row: put a backslash in the corner, then all possible numbers of solutions.
// We know the maximum possible number of solutions: $numsolutions
// Possible numbers of solutions are always congruent to $numsolutions, mod 2
// Also, make the width nice.
$atable->new_row();
$atable->new_cell('\\',array('align'=>'middle'));
for ( $jj = $numsolutions % 2; $jj <= $numsolutions; $jj += 2) {
$atable->new_cell($jj);
if( $show_totals ) { $columntotal[$jj]=0; } // initialize column totals
}
if( $show_totals ) {
$atable->new_cell('Total');
$totalbyrows=$totalbycolumns=0;
}
# Now put one row for each possible crossing number.
for ( $ii = -1; $ii <= $maxcross; $ii++) {
$atable->new_row();
$atable->new_cell($ii);
if( $show_totals ) { $rowtotal=0; } // initialize row total
# Fill each row.
for( $jj = $numsolutions % 2; $jj <= $numsolutions; $jj += 2) {
$atable->new_cell(''.$arr[$jj][$ii].' '); // This is the transposing step.
if( $show_totals ) {
$rowtotal += $arr[$jj][$ii];
$columntotal[$jj] += $arr[$jj][$ii];
}
}
if( $show_totals ) {
$atable->new_cell($rowtotal);
$totalbyrows+=$rowtotal;
}
}
# Total row.
if( $show_totals ) {
$atable->new_row();
$atable->new_cell('Total');
for( $jj = $numsolutions % 2; $jj <= $numsolutions; $jj += 2) {
$atable->new_cell($columntotal[$jj]);
$totalbycolumns+=$columntotal[$jj];
}
### If $totalbycolumns==$totalbyrows, OK. Otherwise, freak out.
if( $totalbycolumns==$totalbyrows ) {
$atable->new_cell($totalbycolumns);
}
else {
$atable->new_cell('Error, totals disagree') ;
}
}
} # End of if($vertical_table)
else {
# Show table horizontally.
echo "Number of Solutions \\ Overlap Number";
$atable->new_row();
$atable->new_cell('\\',array('align'=>'middle'));
# First row
for( $jj = -1 ; $jj <= $maxcross ; $jj++ ) {
$atable->new_cell($jj) ;
if( $show_totals ) { $columntotal[$jj]=0; } // initialize column totals
}
if( $show_totals ) {
$atable->new_cell('Total');
$totalbyrows=$totalbycolumns=0;
}
# One row for each possible number of solutions
for( $ii = $numsolutions % 2; $ii <= $numsolutions; $ii += 2) {
$atable->new_row();
$atable->new_cell(''.$ii.' ');
if( $show_totals ) { $rowtotal=0; } // initialize row total
# Fill each row.
for( $jj = -1 ; $jj <= $maxcross; $jj++) {
$atable->new_cell(''.$arr[$ii][$jj].' '); // DON'T transpose.
if( $show_totals ) {
$rowtotal += $arr[$ii][$jj];
$columntotal[$jj] += $arr[$ii][$jj];
}
}
if( $show_totals ) {
$atable->new_cell($rowtotal);
$totalbyrows+=$rowtotal;
}
}
# Total row.
if( $show_totals ) {
$atable->new_row();
$atable->new_cell('Total');
for( $jj = -1; $jj <= $maxcross; $jj++) {
$atable->new_cell($columntotal[$jj]);
$totalbycolumns+=$columntotal[$jj];
}
### If $totalbycolumns==$totalbyrows, OK. Otherwise, freak out.
if( $totalbycolumns==$totalbyrows ) {
$atable->new_cell("$totalbycolumns ") ;
}
else {
$atable->new_cell('Error, totals disagree') ;
}
}
} # End of else (horizontal table)
$atable->show_table();
?>