1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
// FILE HOMTEST.CC: Test program for homspace class
//////////////////////////////////////////////////////////////////////////
//
// Copyright 1990-2012 John Cremona
//
// This file is part of the eclib package.
//
// eclib is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// eclib is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License
// along with eclib; if not, write to the Free Software Foundation,
// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
//
//////////////////////////////////////////////////////////////////////////
//
#include <eclib/moddata.h>
#include <eclib/symb.h>
#include <eclib/cusp.h>
#include <eclib/homspace.h>
#include <eclib/timer.h>
#define AUTOLOOP
//#define SHOW_TIMES
int main(void)
{
init_time();
int n=1;
int plus=1;
int verbose=0;
int cuspidal=0;
long *dims = new long[3];
long *cdims = new long[3];
// cout << "Verbose? "; cin >> verbose;
// cout << "Plus space, minus space or full space (+1,-1,0)? "; cin >> plus;
int s,limit;
#ifdef AUTOLOOP
cout<<"Enter first and last levels: ";cin>>n>>limit; n--;
while (n<limit) { n++;
#else
while (n>0) { cout<<"Enter level: "; cin>>n;
#endif
if (n>0)
{
{
cout << "\n>>>Level " << n << "\n";
for (s=0; s<3; s++)
{
plus=(s==0? 1 : (s==1? -1: 0));
if(verbose)
{
cout<<"Computing sign="<<plus<<" space"<<endl;
}
start_time();
homspace hplus(n,plus, cuspidal,verbose);
stop_time();
int dim = hplus.h1dim();
int cdim = hplus.h1cuspdim();
dims[plus+1]=dim;
cdims[plus+1]=cdim;
int d = hplus.h1denom();
int cd = hplus.h1cdenom();
cout << "Sign = "; if (plus!=-1) cout<<" ";
cout << plus << ": ";
cout << "\tDimension = " << dim;
cout << "\tCuspidal dimension = " << cdim;
if(d*cd>1) cout<<" denoms ("<<d<<","<<cd<<")";
#ifdef SHOW_TIMES
show_time();
#endif
cout<<endl;
#ifdef SHOW_TIMES
cout<<"***************************************************"<<endl;
#endif
}
#ifdef SHOW_TIMES
cout<<"***************************************************"<<endl;
#endif
if (dims[1]==dims[0]+dims[2])
continue; //cout<<"\tDimensions add up OK at level "<<n;
else
cout<<"****************Dimensions inconsistent for level "<<n<<" ***************"<<endl;
if ((cdims[1]==cdims[0]+cdims[2])&&(cdims[0]==cdims[2]))
continue; //cout<<"\tCuspidal dimensions add up OK at level "<<n<<endl;
else
cout<<"\t****************Cuspidal dimensions inconsistent for level "<<n<<" ***************"<<endl;
}
cout<<endl;
// stop_time();
// show_time();
} // end of if(n)
} // end of while()
delete[] dims;
delete[] cdims;
} // end of main()
|