Skip to content
Snippets Groups Projects
Commit 536d2a30 authored by Tom Fischer's avatar Tom Fischer
Browse files

[GL] fabs -> std::abs; std::fabs -> std::abs.

parent 1ae5c4bd
No related branches found
No related tags found
No related merge requests found
...@@ -208,7 +208,9 @@ void XmlStnInterface::readStratigraphy( const QDomNode &stratRoot, ...@@ -208,7 +208,9 @@ void XmlStnInterface::readStratigraphy( const QDomNode &stratRoot,
/* add other horizon features here */ /* add other horizon features here */
double depth (horizon.attribute("z").toDouble()); double depth (horizon.attribute("z").toDouble());
if (fabs(depth - depth_check) > std::numeric_limits<double>::epsilon()) // skip soil-layer if its thickness is zero if (std::abs(depth - depth_check) >
std::numeric_limits<double>::
epsilon()) // skip soil-layer if its thickness is zero
{ {
borehole->addSoilLayer(horizon.attribute("x").toDouble(), borehole->addSoilLayer(horizon.attribute("x").toDouble(),
horizon.attribute("y").toDouble(), horizon.attribute("y").toDouble(),
...@@ -326,7 +328,7 @@ void XmlStnInterface::writeBoreholeData(QDomDocument &doc, ...@@ -326,7 +328,7 @@ void XmlStnInterface::writeBoreholeData(QDomDocument &doc,
boreholeTag.appendChild(stationDepthTag); boreholeTag.appendChild(stationDepthTag);
QDomText stationDepthText = doc.createTextNode(QString::number(borehole->getDepth(), 'f')); QDomText stationDepthText = doc.createTextNode(QString::number(borehole->getDepth(), 'f'));
stationDepthTag.appendChild(stationDepthText); stationDepthTag.appendChild(stationDepthText);
if (fabs(borehole->getDate()) > 0) if (std::abs(borehole->getDate()) > 0)
{ {
QDomElement stationDateTag = doc.createElement("bdate"); QDomElement stationDateTag = doc.createElement("bdate");
boreholeTag.appendChild(stationDateTag); boreholeTag.appendChild(stationDateTag);
......
...@@ -88,8 +88,8 @@ double Raster::interpolateValueAtPoint(MathLib::Point3d const& pnt) const ...@@ -88,8 +88,8 @@ double Raster::interpolateValueAtPoint(MathLib::Point3d const& pnt) const
double const yIdx (std::floor(yPos)); // so not to over- or underflow. double const yIdx (std::floor(yPos)); // so not to over- or underflow.
// weights for bilinear interpolation // weights for bilinear interpolation
double const xShift = std::fabs((xPos - xIdx) - 0.5); double const xShift = std::abs((xPos - xIdx) - 0.5);
double const yShift = std::fabs((yPos - yIdx) - 0.5); double const yShift = std::abs((yPos - yIdx) - 0.5);
std::array<double,4> weight = {{ (1-xShift)*(1-yShift), xShift*(1-yShift), xShift*yShift, (1-xShift)*yShift }}; std::array<double,4> weight = {{ (1-xShift)*(1-yShift), xShift*(1-yShift), xShift*yShift, (1-xShift)*yShift }};
// neighbors to include in interpolation // neighbors to include in interpolation
...@@ -119,7 +119,8 @@ double Raster::interpolateValueAtPoint(MathLib::Point3d const& pnt) const ...@@ -119,7 +119,8 @@ double Raster::interpolateValueAtPoint(MathLib::Point3d const& pnt) const
} }
// remove no data values // remove no data values
if (std::fabs(pix_val[j] - _header.no_data) < std::numeric_limits<double>::epsilon()) if (std::abs(pix_val[j] - _header.no_data) <
std::numeric_limits<double>::epsilon())
{ {
weight[j] = 0; weight[j] = 0;
no_data_count++; no_data_count++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment