computes doubleDet.
#include <iostream>
#include <givaro/zring.h>
#include <linbox/util/matrix-stream.h>
#include <linbox/algorithms/double-det.h>
int main (int argc, char **argv)
{
Givaro::ZRing<Integer> ZZ;
ifstream input (argv[1]);
if (!input)
{ cerr << "Error opening matrix file " << argv[1] << endl;
return -1;
}
cout <<
"Matrix is " << A.
rowdim() <<
" by " << A.
coldim() << endl;
cerr<<"Wrong dimensions: A must be (n+1) x n"<<endl;
exit (-1);
}
Timer tim; tim.clear();
tim.start();
bool proof=false;
if (argc > 2)
proof = true;
doubleDet (det1, det2, A, proof);
tim.stop();
for (size_t i=0; i<n-1; ++i)
for (size_t j=0; j<n; ++j)
for (size_t j=0; j<n; ++j)
for (size_t j=0; j<n; ++j)
Timer tim2;
tim2.clear();
tim2.start();
tim2.stop();
if ((det1 != db) || (det2 != dc))
std::cerr<<"Check FAIL"<<endl;
cout<< "Det 1 = " << det1 << endl;
cout<< "Det 2 = " << det2 << endl;
cerr << "Double Det: " << tim.usertime() << "s" << endl;
cerr << "Each single Det: "<<tim2.usertime() << "s" << endl;
return 0 ;
}