Mentions légales du service

Skip to content
Snippets Groups Projects
Commit bb3675f7 authored by Olivier COULAUD's avatar Olivier COULAUD
Browse files

Add getRelativeInfNorm and getRelativeL2Norm in accumulator.

parent 0274a156
No related branches found
No related tags found
No related merge requests found
......@@ -209,11 +209,11 @@ struct FMath{
FReal max;
FReal maxDiff;
public:
FAccurater() : l2Dot(0), l2Diff(0), max(0), maxDiff(0) {
FAccurater() : l2Dot(0.0), l2Diff(0.0), max(0.0), maxDiff(0.0) {
}
/** with inital values */
FAccurater(const FReal inGood[], const FReal inBad[], const int nbValues)
: l2Dot(0), l2Diff(0), max(0), maxDiff(0) {
: l2Dot(0.0), l2Diff(0.0), max(0.0), maxDiff(0.0) {
add(inGood, inBad, nbValues);
}
/** Add value to the current list */
......@@ -232,10 +232,18 @@ struct FMath{
}
/** Get the L2 norm */
FReal getL2Norm() const{
return Sqrt(l2Diff / l2Dot);
return Sqrt(l2Diff );
}
/** Get the inf norm */
FReal getInfNorm() const{
return maxDiff;
}
/** Get the L2 norm */
FReal getRelativeL2Norm() const{
return Sqrt(l2Diff / l2Dot);
}
/** Get the inf norm */
FReal getRelativeInfNorm() const{
return maxDiff / max;
}
/** Print */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment