Skip to content

Commit

Permalink
fix L1Solver bench (evaluation order differs between gcc and clang, i…
Browse files Browse the repository at this point in the history
…t changes random args)
  • Loading branch information
jmmuller committed Jan 22, 2024
1 parent b1013ec commit 5d14039
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions MMVII/src/Matrix/cL1BarrodaleSover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,15 @@ template <class Type> void cCraig_Barrodale_Roberts_l1<Type>::Bench()
{
int aNbEq = 3 + aDim * 3;
cCraig_Barrodale_Roberts_l1 aSys(aDim);
for (int aKEq = 0 ; aKEq<aNbEq ; aKEq++)
{
aSys.PublicAddObservation(RandInInterval(0.1,1.0),cDenseVect<Type>::RanGenerate(aDim),RandInInterval(-10.0,10.0));
}
cDenseVect<Type> aVec = aSys.Solve();
aSys.Bench1Sol(aVec);
for (int aKEq = 0 ; aKEq<aNbEq ; aKEq++)
{
auto v1 = RandInInterval(0.1,1.0);
auto v2 = cDenseVect<Type>::RanGenerate(aDim);
auto v3 = RandInInterval(-10.0,10.0);
aSys.PublicAddObservation(v1,v2,v3); // use variable to force evaluation order
}
cDenseVect<Type> aVec = aSys.Solve();
aSys.Bench1Sol(aVec);
}
}
}
Expand Down

0 comments on commit 5d14039

Please sign in to comment.