Lagrange interpolation

To compute a Lagrange interpolation you have to instantiate a Lagrange type variable:

SemiLagrangian.LagrangeType
struct Lagrange{T, edge, order} <: AbstractInterpolation{T, edge, order}

Type containing Lagrange Polynomials coefficients for Lagrange interpolation

Type parameters

  • T : the type of data that is interpolate
  • edge::EdgeType : type of edge traitment
  • order::Int: order of lagrange interpolation

Implementation :

  • tabfct::Vector{Polynomial{T}} : vector of all lagrange polynomial, per example the k-th Lagrange polynomial for the designed order is tabfct[k+1]

Arguments :

  • order::Int : the order of interpolation
  • [T::DataType=Float64] : The type values to interpolate

Keywords arguments :

  • edge::EdgeType=CircEdge : type of edge traitment
source
SemiLagrangian._getpolylagrangeMethod
_getpolylagrange(k, order, origin)

Function that return the k-th Lagrange Polynomial of a certain order. If coefficients are rational then the return is exact. The polynomial is equal to :

$\prod_{i=0,\ i \neq k}^{order} \frac{x - i - origin}{k - i}$

Arguments

  • k::Int64 : number of the Polynomial, k must be between 0 and order (0<= k <= order).
  • order::Int64 : order of the polynomial.
  • origin::Int64 : origin of the first indice.

Returns

  • Polynomial{Rational{BigInt}} : the k-th Lagrange polynomial of order order

Throws

  • DommaineError : when 0 <= k <= order is false
source