Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 835c9b31 authored by hhakim's avatar hhakim
Browse files

Minor change: test lambda value after computing error.

parent 365255d0
Branches
Tags
No related merge requests found
...@@ -191,17 +191,7 @@ int main(int argc, char* argv[]) ...@@ -191,17 +191,7 @@ int main(int argc, char* argv[])
vector<Faust::MatSparse<FPP,Cpu> > facts; vector<Faust::MatSparse<FPP,Cpu> > facts;
hierFact.get_facts(facts); hierFact.get_facts(facts);
FPP lambda = hierFact.get_lambda();
if (argc >= 3)
{
if (Faust::fabs(lambda - expectedLambda) > epsilon)
{
std::cerr<<"invalid lambda, must be equal to "<<std::setprecision(20)<<std::setprecision(20)<<expectedLambda<<" in the precision of "<<epsilon<<std::endl;
std::cerr<<"current value is "<<std::setprecision(20)<<lambda<<std::endl;
exit(EXIT_FAILURE);
}
}
(facts[0]) *= hierFact.get_lambda(); (facts[0]) *= hierFact.get_lambda();
// transform the sparse matrix into generic one // transform the sparse matrix into generic one
std::vector<Faust::MatGeneric<FPP,Cpu> *> list_fact_generic; std::vector<Faust::MatGeneric<FPP,Cpu> *> list_fact_generic;
...@@ -241,7 +231,19 @@ int main(int argc, char* argv[]) ...@@ -241,7 +231,19 @@ int main(int argc, char* argv[])
std::cout<<"**************** RELATIVE ERROR BETWEEN FAUST AND DATA MATRIX **************** "<<std::endl; std::cout<<"**************** RELATIVE ERROR BETWEEN FAUST AND DATA MATRIX **************** "<<std::endl;
std::cout<<" "<<relativeError<<std::endl<<std::endl; std::cout<<" "<<relativeError<<std::endl<<std::endl;
hierFactCore.Display(); FPP lambda = hierFact.get_lambda();
if (argc >= 3)
{
if (Faust::fabs(lambda - expectedLambda) > epsilon)
{
std::cerr<<"invalid lambda, must be equal to "<<std::setprecision(20)<<std::setprecision(20)<<expectedLambda<<" in the precision of "<<epsilon<<std::endl;
std::cerr<<"current value is "<<std::setprecision(20)<<lambda<<std::endl;
exit(EXIT_FAILURE);
}
}
hierFactCore.Display();
//time comparison between matrix vector product and faust-vector product //time comparison between matrix vector product and faust-vector product
int niterTimeComp = 10; int niterTimeComp = 10;
if (niterTimeComp > 0) if (niterTimeComp > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment