Hi,
Is there any good reason why, at the top of comm\rec_syst_conv_code.cpp, the function:
double com_logmap(double x, double y) {
if (x>y) { return ( x + log( 1.0 + exp( -fabs(y-x) ) ) ); } else { return ( y + log( 1.0 + exp( -fabs(y-x) ) ) ); }
if (x>y) { return ( x + log( 1.0 + exp( -std::fabs(y-x) ) ) ); } else { return ( y + log( 1.0 + exp( -std::fabs(y-x) ) ) ); }
}
cannot be substituted by:
double com_logmap(double x, double y) { if (x>y) { return ( x + log( 1.0 + exp( y-x ) ) ); } else { return ( y + log( 1.0 + exp( x-y ) ) ); } }
I think the abs() is unnecessary, since we already know which one, x or y, is bigger, and that makes the #ifdef unnecessary too.
Am I right?
Xavi
Log in to post a comment.
Hi,
Is there any good reason why, at the top of comm\rec_syst_conv_code.cpp, the function:
double com_logmap(double x, double y)
{
ifdef _MSC_VER
else
endif
}
cannot be substituted by:
double com_logmap(double x, double y)
{
if (x>y) {
return ( x + log( 1.0 + exp( y-x ) ) );
} else {
return ( y + log( 1.0 + exp( x-y ) ) );
}
}
I think the abs() is unnecessary, since we already know which one, x or y, is bigger, and that makes the #ifdef unnecessary too.
Am I right?
Xavi