12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include <iostream>
- #include "monoid.hpp"
- void init_full_N(monoid &m)
- {
- epi8 block ={1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8};
- for(auto i=0; i<NBLOCKS; i++){
- m.blocks[i] = block;
- block = block + 8;
- }
- m.genus = 0;
- m.conductor = 1;
- m.min = 1;
- m.left=1;
- m.left_primitive=0;
- m.e=1;
- m.wilf=0;
- }
- void init_ordinary(monoid &O,int m){
- O.decs[0]=1;
- for(auto i=1;i<2*m;++i){
- O.decs[i]=i/m;
- }
- for(auto i=0;i<SIZE-2*m;++i){
- O.decs[2*m+i]=2+i/2;
- }
-
- O.genus = m-1;
- O.conductor = m;
- O.min = m;
- O.left=1;
- O.left_primitive=0;
- O.e=m;
- O.wilf=0;
- }
- void print_monoid(const monoid &m)
- {
- unsigned int i;
- std::cout<<"min = "<<m.min<<", cond = "<<m.conductor<<", genus = "<<m.genus<<", decs = ";
- for (i=0; i<SIZE; i++) std::cout<<((int) m.decs[i])<<' ';
- std::cout<<std::endl;
- }
- void print_monoid_gen(const monoid &m)
- {
- unsigned int i;
- std::cout<<"min = "<<m.min<<", cond = "<<m.conductor<<", genus = "<<m.genus<<", gen = ";
- std::cout<<"< ";
- for (i=1; i<SIZE; i++){
- if(m.decs[i]==1){
- std::cout<<i<<' ';
- }
- }
- std::cout<<'>'<<std::endl;
- }
- #include <cmath>
- void output(const monoid& m,fstream& f){
- int q=ceil(float(m.conductor)/float(m.min));
- int rho=q*m.min-m.conductor;
- f<<"w = "<<m.wilf<<", c = "<<m.conductor<<", r = "<<rho<<" : ["<<m.min;
- for (auto i=m.min+1; i<SIZE; i++){
- if(m.decs[i]==1){
- f<<','<<i;
- }
- }
- f<<']'<<endl;
- }
- void print_epi8(epi8 bl)
- {
- unsigned int i;
- for (i=0; i<16; i++) std::cout<<((uint8_t*)&bl)[i]<<' ';
- std::cout<<std::endl;
- }
|