Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
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
mantidproject
mantid
Commits
4021ffab
Commit
4021ffab
authored
8 years ago
by
Martyn Gigg
Browse files
Options
Downloads
Patches
Plain Diff
Remove lambda and pass free function directly.
Refs #17913
parent
913619d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/HistogramData/src/Interpolate.cpp
+3
-4
3 additions, 4 deletions
Framework/HistogramData/src/Interpolate.cpp
with
3 additions
and
4 deletions
Framework/HistogramData/src/Interpolate.cpp
+
3
−
4
View file @
4021ffab
...
@@ -124,15 +124,14 @@ void interpolateYCSplineInplace(const Histogram &input, const size_t stepSize,
...
@@ -124,15 +124,14 @@ void interpolateYCSplineInplace(const Histogram &input, const size_t stepSize,
// Manage gsl memory with unique_ptrs
// Manage gsl memory with unique_ptrs
using
gsl_spline_uptr
=
std
::
unique_ptr
<
gsl_spline
,
void
(
*
)(
gsl_spline
*
)
>
;
using
gsl_spline_uptr
=
std
::
unique_ptr
<
gsl_spline
,
void
(
*
)(
gsl_spline
*
)
>
;
auto
spline
=
gsl_spline_uptr
(
gsl_spline_alloc
(
gsl_interp_cspline
,
ncalc
),
auto
spline
=
gsl_spline_uptr
(
gsl_spline_alloc
(
gsl_interp_cspline
,
ncalc
),
[](
gsl_spline
*
sp
)
{
gsl_spline_free
(
sp
);
}
);
gsl_spline_free
);
// Compute spline
// Compute spline
gsl_spline_init
(
spline
.
get
(),
xc
.
data
(),
yc
.
data
(),
ncalc
);
gsl_spline_init
(
spline
.
get
(),
xc
.
data
(),
yc
.
data
(),
ncalc
);
// Evaluate each point for the full range
// Evaluate each point for the full range
using
gsl_interp_accel_uptr
=
using
gsl_interp_accel_uptr
=
std
::
unique_ptr
<
gsl_interp_accel
,
void
(
*
)(
gsl_interp_accel
*
)
>
;
std
::
unique_ptr
<
gsl_interp_accel
,
void
(
*
)(
gsl_interp_accel
*
)
>
;
auto
lookupTable
=
gsl_interp_accel_uptr
(
auto
lookupTable
=
gsl_interp_accel_alloc
(),
gsl_interp_accel_uptr
(
gsl_interp_accel_alloc
(),
gsl_interp_accel_free
);
[](
gsl_interp_accel
*
acc
)
{
gsl_interp_accel_free
(
acc
);
});
for
(
size_t
i
=
0
;
i
<
nypts
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
nypts
;
++
i
)
{
ynew
[
i
]
=
gsl_spline_eval
(
spline
.
get
(),
xold
[
i
],
lookupTable
.
get
());
ynew
[
i
]
=
gsl_spline_eval
(
spline
.
get
(),
xold
[
i
],
lookupTable
.
get
());
}
}
...
...
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