Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitri Naumov
ogs
Commits
536d2a30
Commit
536d2a30
authored
4 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[GL] fabs -> std::abs; std::fabs -> std::abs.
parent
1ae5c4bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
+4
-2
4 additions, 2 deletions
GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
GeoLib/Raster.cpp
+4
-3
4 additions, 3 deletions
GeoLib/Raster.cpp
with
8 additions
and
5 deletions
GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp
+
4
−
2
View file @
536d2a30
...
@@ -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
(
f
abs
(
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
);
...
...
This diff is collapsed.
Click to expand it.
GeoLib/Raster.cpp
+
4
−
3
View file @
536d2a30
...
@@ -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
::
f
abs
((
xPos
-
xIdx
)
-
0.5
);
double
const
xShift
=
std
::
abs
((
xPos
-
xIdx
)
-
0.5
);
double
const
yShift
=
std
::
f
abs
((
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
++
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment