SpECTRE  v2026.06.09.01
Loading...
Searching...
No Matches
intrp::LinearSpanInterpolator Class Reference

Performs a linear interpolation; this class can be chosen via the options factory mechanism as a possible SpanInterpolator. More...

#include <LinearSpanInterpolator.hpp>

Public Types

using options = tmpl::list<>
Public Types inherited from intrp::SpanInterpolator
using creatable_classes

Public Member Functions

 LinearSpanInterpolator (const LinearSpanInterpolator &)=default
LinearSpanInterpolator & operator= (const LinearSpanInterpolator &)=default
 LinearSpanInterpolator (LinearSpanInterpolator &&)=default
LinearSpanInterpolator & operator= (LinearSpanInterpolator &&)=default
 WRAPPED_PUPable_decl_template (LinearSpanInterpolator)
 LinearSpanInterpolator (CkMigrateMessage *)
void pup (PUP::er &) override
std::unique_ptr< SpanInterpolatorget_clone () const override
 Produce a std::unique_ptr that points to a copy of `*this``.
double interpolate (const gsl::span< const double > &source_points, const gsl::span< const double > &values, double target_point) const override
 Perform the interpolation of function represented by values at source_points to the requested target_point, returning the interpolation result.
std::complex< double > interpolate (const gsl::span< const double > &source_points, const gsl::span< const std::complex< double > > &values, double target_point) const
double derivative (const gsl::span< const double > &source_points, const gsl::span< const double > &values, double target_point) const override
 Evaluate the derivative of the interpolant of the function represented by values at source_points, evaluated at the requested target_point.
std::complex< double > derivative (const gsl::span< const double > &source_points, const gsl::span< const std::complex< double > > &values, double target_point) const override
 Evaluate the derivative of the interpolant of the function represented by complex values at source_points, evaluated at the requested target_point. This generic implementation calls the real version on the real and imaginary parts separately; derived classes should override it when a specialized complex implementation that avoids the split is more efficient.
size_t required_number_of_points_before_and_after () const override
 The number of domain points that should be both before and after the requested target point for best interpolation. For instance, for a linear interpolator, this function would return 1 to request that the target is between the two domain points passed to source_points.
Public Member Functions inherited from intrp::SpanInterpolator
 WRAPPED_PUPable_abstract (SpanInterpolator)
std::complex< double > interpolate (const gsl::span< const double > &source_points, const gsl::span< const std::complex< double > > &values, double target_point) const
 Perform the interpolation of function represented by complex values at source_points to the requested target_point, returning the (complex) interpolation result.

Static Public Attributes

static constexpr Options::String help = {"Linear interpolator."}

Detailed Description

Performs a linear interpolation; this class can be chosen via the options factory mechanism as a possible SpanInterpolator.

Member Function Documentation

◆ derivative() [1/2]

double intrp::LinearSpanInterpolator::derivative ( const gsl::span< const double > & source_points,
const gsl::span< const double > & values,
double target_point ) const
overridevirtual

Evaluate the derivative of the interpolant of the function represented by values at source_points, evaluated at the requested target_point.

Implements intrp::SpanInterpolator.

◆ derivative() [2/2]

std::complex< double > intrp::LinearSpanInterpolator::derivative ( const gsl::span< const double > & source_points,
const gsl::span< const std::complex< double > > & values,
double target_point ) const
overridevirtual

Evaluate the derivative of the interpolant of the function represented by complex values at source_points, evaluated at the requested target_point. This generic implementation calls the real version on the real and imaginary parts separately; derived classes should override it when a specialized complex implementation that avoids the split is more efficient.

Reimplemented from intrp::SpanInterpolator.

◆ get_clone()

std::unique_ptr< SpanInterpolator > intrp::LinearSpanInterpolator::get_clone ( ) const
inlineoverridevirtual

Produce a std::unique_ptr that points to a copy of `*this``.

Implements intrp::SpanInterpolator.

◆ interpolate()

double intrp::LinearSpanInterpolator::interpolate ( const gsl::span< const double > & source_points,
const gsl::span< const double > & values,
double target_point ) const
overridevirtual

Perform the interpolation of function represented by values at source_points to the requested target_point, returning the interpolation result.

Implements intrp::SpanInterpolator.

◆ required_number_of_points_before_and_after()

size_t intrp::LinearSpanInterpolator::required_number_of_points_before_and_after ( ) const
inlineoverridevirtual

The number of domain points that should be both before and after the requested target point for best interpolation. For instance, for a linear interpolator, this function would return 1 to request that the target is between the two domain points passed to source_points.

Implements intrp::SpanInterpolator.


The documentation for this class was generated from the following file:
  • src/NumericalAlgorithms/Interpolation/LinearSpanInterpolator.hpp