Differences

This shows you the differences between two versions of the page.

finite_algebras [2010/08/18 10:36]
jipsen
finite_algebras [2010/08/18 11:30] (current)
jipsen
Line 1: Line 1:
=====Small nonisomorphic semigroups===== =====Small nonisomorphic semigroups=====
<html> <html>
 +<style>
 +td {padding-left:3px;padding-right:3px;}
 +th {background-color:#f0f0f0;font-weight:normal;padding-left:3px;padding-right:3px;}
 +table {border-collapse:collapse;line-height:80%;}
 +</style>
Format as <select id="format" onchange="update()"> Format as <select id="format" onchange="update()">
<option value="table" selected>Table</option> <option value="table" selected>Table</option>
Line 16: Line 21:
<script> <script>
 +function algebraToString(a,k) {
 + if (format=="html"){
 +  var st="<div style=\"display:inline-block;border: 1px darkgray solid;\"><sup>"+num+"</sup>"+"<b>S</b><sub>"+a.length+","+k+"</sub><br>";
 +  for (var i=0; i<a.length; i++) {
 +    for (var j=0; j<a.length; j++) st = st+a[i][j]+(j==a.length-1?"":" &nbsp; ");
 +    st = st+"<br>";
 +  }
 +  st = st+"</div> &nbsp;"; num++;
 + }else if (format=="table"){
 +  var st="<table style=\"display:inline-block;border: 1px darkgray solid;\"><tr><td colspan=\""+(a.length+1)+"\"><sup>"+num+"</sup>"+"<b>S</b><sub>"+a.length+","+k+"</sub></td></tr><tr><th>&middot</th>";
 +  for (var i=0; i<a.length; i++) st += "<th>"+i+"</th>";
 +  st += "</tr>";
 +  for (var i=0; i<a.length; i++) {
 +    st += "<tr><th>"+i+"</th>";
 +    for (var j=0; j<a.length; j++)
 +        st = st+"<td>"+a[i][j]+"</td>";
 +    st = st+"</tr>";
 +  }
 +  st = st+"</table> &nbsp;"; num++;
 + }else if (format=="text"){
 +  var st="{name:\""+classname+"_{"+a.length+","+k+"}\", ";
 +  st=st+"num:"+num+", op:{\"cdot\":[\n";
 +  for (var i=0; i<a.length; i++) {
 +    st = st+"[";
 +    for (var j=0; j<a.length; j++)
 +        st = st+a[i][j]+(j==a.length-1?"":",");
 +    st = st+"]"+(i==a.length-1?"]}},":",")+"\n";
 +  }
 +  st = st+"\n"; num++;
 + }
 + return st;
 +}
function checkRelation(A,rel) {//rel is a partial binary relation function checkRelation(A,rel) {//rel is a partial binary relation
    //Check that rel is transitive and compatible with the operations of A     //Check that rel is transitive and compatible with the operations of A
Line 158: Line 195:
counts=[]; counts=[];
filtcounts=[]; filtcounts=[];
-function algebraToString(a,k) { 
- if (format=="html"){ 
-  var st="<div style=\"display:inline-block;border: 1px darkgray solid;\"><sup>"+num+"</sup>"+"<b>S</b><sub>"+a.length+","+k+"</sub><br>"; 
-  for (var i=0; i<a.length; i++) { 
-    for (var j=0; j<a.length; j++) st = st+a[i][j]+(j==a.length-1?"":" &nbsp; "); 
-    st = st+"<br>"; 
-  } 
-  st = st+"</div> &nbsp;"; num++; 
- }else if (format=="table"){ 
-  var st="<table style=\"display:inline-block;border: 1px darkgray solid;\"><tr><td colspan=\"0\"><sup>"+num+"</sup>"+"<b>S</b><sub>"+a.length+","+k+"</sub></td></tr><th>"; 
-  for (var i=0; i<a.length; i++) st = st+"<td>"+i+"</td>"; 
-  st+="</th>"; 
-  for (var i=0; i<a.length; i++) { 
-    st = st+"<tr>"; 
-    for (var j=0; j<a.length; j++) 
-        st = st+"<td>"+a[i][j]+"</td>"; 
-    st = st+"</tr>"; 
-  } 
-  st = st+"</table> &nbsp;"; num++; 
- }else if (format=="text"){  
-  var st="{name:\""+classname+"_{"+a.length+","+k+"}\", "; 
-  st=st+"num:"+num+", op:{\"cdot\":[\n"; 
-  for (var i=0; i<a.length; i++) { 
-    st = st+"["; 
-    for (var j=0; j<a.length; j++) 
-        st = st+a[i][j]+(j==a.length-1?"":","); 
-    st = st+"]"+(i==a.length-1?"]}},":",")+"\n"; 
-  } 
-  st = st+"\n"; num++; 
- } 
- return st; 
-} 
function initializeAlgebra(n) { // finite groupoid with n elements, {0,1,...,n-1} function initializeAlgebra(n) { // finite groupoid with n elements, {0,1,...,n-1}
    var alg = new Array(n);     var alg = new Array(n);