Skip to content

Commit

Permalink
Fix qnorm calculation
Browse files Browse the repository at this point in the history
absolute value should be taken of each element before calculating
the q power of the element
  • Loading branch information
vigsterkr committed Apr 9, 2012
1 parent 58ebbf0 commit 67aca90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shogun/mathematics/Math.h
Expand Up @@ -261,7 +261,7 @@ class CMath : public CSGObject
{
float64_t result=0;
for (int32_t i=0; i<len; i++)
result+=CMath::pow(x[i], q);
result+=CMath::pow(fabs(x[i]), q);

return result;
}
Expand Down

0 comments on commit 67aca90

Please sign in to comment.