#include <iostream>
#include <givaro/modular.h>
#include <givaro/montgomery.h>
#include <givaro/gfq.h>
#include <givaro/gfqext.h>
template<class Field>
std::cerr << "Within " ;
std::cerr << " : " << std::flush;
F.
write( std::cout,
a) <<
" + " << std::flush;
F.
write( std::cout,
b) <<
" = " << std::flush;
F.
write( std::cerr,
c) << std::endl;
F.
write( std::cerr <<
"Within " ) <<
" : " << std::flush;
std::cout,
c) <<
" + ",
a) <<
" * ",
b) <<
" = ", d) << std::endl;
{
F.
write( std::cerr <<
"Within " ) <<
" : " << std::flush;
std::cout, d) <<
" - ",
a) <<
" * ",
b) <<
" = ", e) << std::endl;
}
{
F.
write( std::cerr <<
"Within " ) <<
" : " << std::flush;
std::cout, d) <<
" - ",
a) <<
" * ",
b) <<
" = ", e) << std::endl;
}
{
F.
write( std::cerr <<
"Within " ) <<
" : " << std::flush;
std::cout,
a) <<
" * ",
b) <<
" - ", d) <<
" = ", e) << std::endl;
}
{
F.
write( std::cerr <<
"Within " ) <<
" : " << std::flush;
std::cout, d) <<
" - ",
a) <<
" * ",
b) <<
" = ", e) << std::endl;
}
F.
write( F.
write( std::cout <<
"1/",
a) <<
" is ",
b) << std::endl;
F.
write( std::cout <<
"1 is ",
c) << std::endl;
F.
write( std::cout <<
"1/",
a) <<
" is ";
F.
write( std::cout,
a) << std::endl;
F.
write( std::cout <<
"1 is ",
a) << std::endl;
F.
write( F.
write( std::cout <<
"1/",
a) <<
" is ",
b) << std::endl;
F.
write( std::cout <<
"1 is ",
c) << std::endl;
F.
write( std::cout <<
"1/",
a) <<
" is ";
F.
write( std::cout,
a) << std::endl;
F.
write( std::cout <<
"1 is ",
a) << std::endl;
}
extern "C" {
# include <sys/time.h>
# include <sys/resource.h>
}
int main(
int argc,
char ** argv) {
#ifdef __USE_Givaro_SIXTYFOUR__
Modular<int64_t> LL13(13U);
TestField( LL13 );
#endif
Montgomery<int32_t> M13(13);
TestField( M13 );
Montgomery<int32_t> M3(39989);
TestField( M3 );
Modular<Integer> IntZ13(13);
TestField( IntZ13 );
Modular<RecInt::rint<7>> rIntZ13(13);
TestField( rIntZ13 );
Modular<RecInt::ruint<7>> ruIntZ13(13);
TestField( ruIntZ13 );
GFqDom<int> GF625( 5, 4 );
TestField( GF625 );
std::vector< GFqDom<int64_t>::Residu_t > Irred(9);
Irred[0] = 1; Irred[1] = 1; Irred[2] = 0; Irred[3] = 1;
Irred[4] = 1; Irred[5] = 0; Irred[6] = 0; Irred[7] = 0;
Irred[8] = 1;
GFqDom<int64_t> F256(2,8, Irred);
TestField( F256 );
GFqExt<int32_t> GF81( 3, 4 );
TestField( GF81 );
struct rusage tmp1 ;
getrusage (RUSAGE_SELF, &tmp1) ;
double tim = (double) tmp1.ru_utime.tv_sec + ((double) tmp1.ru_utime.tv_usec)/ ( 1000000.0 ) ;
;
getrusage (RUSAGE_SELF, &tmp1) ;
tim = (double) tmp1.ru_utime.tv_sec + ((double) tmp1.ru_utime.tv_usec)/ (1000000.0) - tim;
std::cerr << "Initialization took " << tim << " cpu seconds and : " << std::endl;
std::cerr
<< tmp1.ru_maxrss << " maximum resident set size"<< std::endl
<< tmp1.ru_ixrss << " integral shared memory size"<< std::endl
<< tmp1.ru_idrss << " integral unshared data size"<< std::endl
<< tmp1.ru_isrss << " integral unshared stack size"<< std::endl
<< tmp1.ru_minflt << " page reclaims"<< std::endl
<< tmp1.ru_majflt << " page faults"<< std::endl
<< tmp1.ru_nswap << " swaps"<< std::endl
<< tmp1.ru_inblock << " block input operations"<< std::endl
<< tmp1.ru_oublock << " block output operations"<< std::endl;
return 0;
}
void TestField()
Definition: all_field.C:42
int main(int argc, char **argv)
Definition: benchmark-recint_exp.C:20
Rep & add(Rep &r, const Rep a, const Rep b) const
Definition: gfq.inl:332
Rep & maxpyin(Rep &r, const Rep a, const Rep b) const
Definition: gfq.inl:387
Rep Element
Definition: gfq.h:79
Rep & mulin(Rep &r, const Rep a) const
Definition: gfq.inl:314
Rep & maxpy(Rep &r, const Rep a, const Rep b, const Rep c) const
Definition: gfq.inl:419
Rep & init(Rep &r) const
Definition: gfq.h:202
Rep & subin(Rep &r, const Rep a) const
Definition: gfq.inl:347
Rep & axpy(Rep &r, const Rep a, const Rep b, const Rep c) const
Definition: gfq.inl:372
Rep & assign(Rep &, const Integer) const
Definition: gfq.inl:855
Rep & divin(Rep &r, const Rep a) const
Definition: gfq.inl:327
Rep & invin(Rep &r) const
Definition: gfq.inl:367
std::ostream & write(std::ostream &s) const
Definition: gfq.inl:606
Rep & addin(Rep &r, const Rep a) const
Definition: gfq.inl:337
Rep & axmy(Rep &r, const Rep a, const Rep b, const Rep c) const
Definition: gfq.inl:410
Rep & mul(Rep &r, const Rep a, const Rep b) const
Definition: gfq.inl:309
Rep & inv(Rep &r, const Rep a) const
Definition: gfq.inl:362
Namespace in which the whole Givaro library resides.
Definition: all_field.C:23
MG & a
Definition: rmadd.h:143
MG const rmint< K, MG > const T & c
Definition: rmadd.h:143
MG const rmint< K, MG > & b
Definition: rmadd.h:143