Audio Processing Framework (APF) version 0.5.0
Public Types | Public Member Functions | List of all members
apf::math::linear_interpolator< T, U > Class Template Reference

Function object for linear interpolation. More...

#include <apf/math.h>

Public Types

using argument_type = U
 
using result_type = T
 

Public Member Functions

 linear_interpolator ()
 Default constructor. More...
 
 linear_interpolator (result_type first, result_type last, argument_type length=argument_type(1))
 Constructor with range and optional length. More...
 
void set (result_type first, result_type last, argument_type length=argument_type(1))
 Set range and optional length. More...
 
result_type operator() (argument_type x)
 Function call operator. More...
 

Detailed Description

template<typename T, typename U = T>
class apf::math::linear_interpolator< T, U >

Function object for linear interpolation.

Template Parameters
Tresult type
Uinput type
Warning
If U is an integral type and T is floating point, don't forget that the cast operation takes some processing time. It may be more efficient to use the same floating point type for both T and U.

Definition at line 277 of file math.h.

Member Typedef Documentation

◆ argument_type

template<typename T , typename U = T>
using apf::math::linear_interpolator< T, U >::argument_type = U

Definition at line 280 of file math.h.

◆ result_type

template<typename T , typename U = T>
using apf::math::linear_interpolator< T, U >::result_type = T

Definition at line 281 of file math.h.

Constructor & Destructor Documentation

◆ linear_interpolator() [1/2]

template<typename T , typename U = T>
apf::math::linear_interpolator< T, U >::linear_interpolator ( )
inline

Default constructor.

Definition at line 284 of file math.h.

◆ linear_interpolator() [2/2]

template<typename T , typename U = T>
apf::math::linear_interpolator< T, U >::linear_interpolator ( result_type  first,
result_type  last,
argument_type  length = argument_type(1) 
)
inline

Constructor with range and optional length.

See also
set()

Definition at line 288 of file math.h.

References apf::math::linear_interpolator< T, U >::set().

Member Function Documentation

◆ set()

template<typename T , typename U = T>
void apf::math::linear_interpolator< T, U >::set ( result_type  first,
result_type  last,
argument_type  length = argument_type(1) 
)
inline

Set range and optional length.

Parameters
firstoutput value if input is zero
lastoutput value if input is length
lengthlength of interval on which to interpolate

Definition at line 298 of file math.h.

Referenced by apf::math::linear_interpolator< T, U >::linear_interpolator().

◆ operator()()

template<typename T , typename U = T>
result_type apf::math::linear_interpolator< T, U >::operator() ( argument_type  x)
inline

Function call operator.

Definition at line 306 of file math.h.


The documentation for this class was generated from the following file: