Commit bec09f1b authored by COULAUD Olivier's avatar COULAUD Olivier

Use template function abs rather than fabs

parent 99e0bd53
......@@ -46,8 +46,8 @@ struct FChebRoots : FNoCopyable
static FReal T(const unsigned int n, FReal x)
{
//std::cout << x << std::endl;
assert(std::fabs(x)-1.<10.*std::numeric_limits<FReal>::epsilon());
if (std::fabs(x)>1.) {
assert(std::abs(x)-1.<10.*std::numeric_limits<FReal>::epsilon());
if (std::abs(x)>1.) {
x = (x > FReal( 1.) ? FReal( 1.) : x);
x = (x < FReal(-1.) ? FReal(-1.) : x);
}
......@@ -68,8 +68,8 @@ struct FChebRoots : FNoCopyable
*/
static FReal U(const unsigned int n, FReal x)
{
assert(std::fabs(x)-1.<10.*std::numeric_limits<FReal>::epsilon());
if (std::fabs(x)>1.) {
assert(std::abs(x)-1.<10.*std::numeric_limits<FReal>::epsilon());
if (std::abs(x)>1.) {
x = (x > FReal( 1.) ? FReal( 1.) : x);
x = (x < FReal(-1.) ? FReal(-1.) : x);
}
......
......@@ -48,8 +48,8 @@ struct FUnifRoots : FNoCopyable
*/
static FReal L(const unsigned int n, FReal x)
{
assert(std::fabs(x)-1.<10.*std::numeric_limits<FReal>::epsilon());
if (std::fabs(x)>1.) {
assert(std::abs(x)-1.<10.*std::numeric_limits<FReal>::epsilon());
if (std::abs(x)>1.) {
//std::cout << "x=" << x << " out of bounds!" << std::endl;
x = (x > FReal( 1.) ? FReal( 1.) : x);
x = (x < FReal(-1.) ? FReal(-1.) : x);
......@@ -93,8 +93,8 @@ struct FUnifRoots : FNoCopyable
*/
static FReal dL(const unsigned int n, FReal x)
{
assert(std::fabs(x)-1.<10.*std::numeric_limits<FReal>::epsilon());
if (std::fabs(x)>1.) {
assert(std::abs(x)-1.<10.*std::numeric_limits<FReal>::epsilon());
if (std::abs(x)>1.) {
x = (x > FReal( 1.) ? FReal( 1.) : x);
x = (x < FReal(-1.) ? FReal(-1.) : x);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment