Commit 9403bac1 authored by Robert Maynard's avatar Robert Maynard

VTK-m device side math functions need to use the vtkm:: wrappers

parent cb477147
......@@ -72,7 +72,7 @@ void AxisAnnotation::CalculateTicks(const vtkm::Range& range,
pow10 = pow10 - 1.;
}
vtkm::Float64 fxt = pow(10., ffix(pow10));
vtkm::Float64 fxt = vtkm::Pow(10., ffix(pow10));
// Find the number of integral points in the interval.
int numTicks = int(ffix(length / fxt) + 1);
......@@ -169,8 +169,8 @@ void AxisAnnotation::CalculateTicksLogarithmic(const vtkm::Range& range,
return;
}
vtkm::Float64 first_log = ceil(sortedRange.Min);
vtkm::Float64 last_log = floor(sortedRange.Max);
vtkm::Float64 first_log = vtkm::Ceil(sortedRange.Min);
vtkm::Float64 last_log = vtkm::Floor(sortedRange.Max);
if (last_log <= first_log)
{
......@@ -188,7 +188,7 @@ void AxisAnnotation::CalculateTicksLogarithmic(const vtkm::Range& range,
for (vtkm::Int32 i = vtkm::Int32(first_log); i <= last_log; i += step)
{
vtkm::Float64 logpos = i;
vtkm::Float64 pos = pow(10, logpos);
vtkm::Float64 pos = vtkm::Pow(10, logpos);
if (minor)
{
// If we're showing major tickmarks for every power of 10,
......@@ -202,7 +202,7 @@ void AxisAnnotation::CalculateTicksLogarithmic(const vtkm::Range& range,
for (vtkm::Int32 j = 1; j < 10; ++j)
{
vtkm::Float64 minor_pos = vtkm::Float64(j) * vtkm::Float64(pos);
vtkm::Float64 minor_logpos = log10(minor_pos);
vtkm::Float64 minor_logpos = vtkm::Log10(minor_pos);
if (minor_logpos < sortedRange.Min || minor_logpos > sortedRange.Max)
{
continue;
......@@ -217,7 +217,7 @@ void AxisAnnotation::CalculateTicksLogarithmic(const vtkm::Range& range,
for (vtkm::Int32 j = 1; j < step; ++j)
{
vtkm::Float64 minor_logpos = logpos + j;
vtkm::Float64 minor_pos = pow(10., minor_logpos);
vtkm::Float64 minor_pos = vtkm::Pow(10., minor_logpos);
if (minor_logpos < sortedRange.Min || minor_logpos > sortedRange.Max)
{
continue;
......
......@@ -117,7 +117,8 @@ public:
vtkm::Vec<Precision, 3> reflect = 2.f * vtkm::dot(lightDir, normal) * normal - lightDir;
vtkm::Normalize(reflect);
Precision cosPhi = vtkm::dot(reflect, viewDir);
Precision specularConstant = Precision(pow(vtkm::Max(cosPhi, zero), SpecularExponent));
Precision specularConstant =
vtkm::Pow(vtkm::Max(cosPhi, zero), static_cast<Precision>(SpecularExponent));
vtkm::Int32 colorMapSize = static_cast<vtkm::Int32>(colorMap.GetNumberOfValues());
vtkm::Int32 colorIdx = vtkm::Int32(scalar * Precision(colorMapSize - 1));
......
......@@ -51,7 +51,7 @@ struct Gaussian : public KernelBase<Gaussian<Dimensions>>
maxRadius_ = 5.0 * smoothingLength;
maxRadius2_ = maxRadius_ * maxRadius_;
//
norm_ = 1.0 / pow(M_PI, static_cast<double>(Dimensions) / 2.0);
norm_ = 1.0 / vtkm::Pow(M_PI, static_cast<double>(Dimensions) / 2.0);
scale_W_ = norm_ * PowerExpansion<Dimensions>(Hinverse_);
scale_GradW_ = -2.0 * PowerExpansion<Dimensions + 1>(Hinverse_) / norm_;
}
......@@ -71,7 +71,7 @@ struct Gaussian : public KernelBase<Gaussian<Dimensions>>
// compute r/h
double normedDist = distance * Hinverse_;
// compute w(h)
return scale_W_ * exp(-normedDist * normedDist);
return scale_W_ * vtkm::Exp(-normedDist * normedDist);
}
return 0.0;
}
......@@ -86,7 +86,7 @@ struct Gaussian : public KernelBase<Gaussian<Dimensions>>
// compute (r/h)^2
double normedDist = distance2 * Hinverse2_;
// compute w(h)
return scale_W_ * exp(-normedDist);
return scale_W_ * vtkm::Exp(-normedDist);
}
return 0.0;
}
......@@ -102,7 +102,7 @@ struct Gaussian : public KernelBase<Gaussian<Dimensions>>
double scale_W = norm_ * PowerExpansion<Dimensions>(Hinverse);
double Q = distance * Hinverse;
return scale_W * exp(-Q * Q);
return scale_W * vtkm::Exp(-Q * Q);
}
return 0;
}
......@@ -118,7 +118,7 @@ struct Gaussian : public KernelBase<Gaussian<Dimensions>>
double scale_W = norm_ * PowerExpansion<Dimensions>(Hinverse);
double Q = distance2 * Hinverse * Hinverse;
return scale_W * exp(-Q);
return scale_W * vtkm::Exp(-Q);
}
return 0;
}
......@@ -132,7 +132,7 @@ struct Gaussian : public KernelBase<Gaussian<Dimensions>>
double Q = distance * Hinverse_;
if (Q != 0.0)
{
return scale_GradW_ * exp(-Q * Q) * pos;
return scale_GradW_ * vtkm::Exp(-Q * Q) * pos;
}
else
{
......@@ -148,13 +148,13 @@ struct Gaussian : public KernelBase<Gaussian<Dimensions>>
{
double Hinverse = 1.0 / h;
double scale_GradW = -2.0 * PowerExpansion<Dimensions + 1>(Hinverse) /
pow(M_PI, static_cast<double>(Dimensions) / 2.0);
vtkm::Pow(M_PI, static_cast<double>(Dimensions) / 2.0);
double Q = distance * Hinverse;
//!!! check this due to the fitting offset
if (distance != 0.0)
{
return scale_GradW * exp(-Q * Q) * pos;
return scale_GradW * vtkm::Exp(-Q * Q) * pos;
}
else
{
......
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