ug4
ug::Lagrange1D Class Reference

#include <lagrange1d.h>

+ Inheritance diagram for ug::Lagrange1D:

Public Member Functions

 Lagrange1D (const size_t i, const std::vector< number > &vPos)
 
number position (const size_t i) const
 returns the position of the i'th interpolation point More...
 
- Public Member Functions inherited from ug::Polynomial1D
size_t degree () const
 
Polynomial1D derivative () const
 returns the derivative of this polynomial as a polynomial More...
 
Polynomial1Doperator*= (const Polynomial1D &v)
 multiply by a polynomial More...
 
Polynomial1Doperator*= (number scale)
 multiply by a scalar More...
 
 Polynomial1D (const std::vector< number > &a)
 Constructor passing coefficients for the polynomial. More...
 
 Polynomial1D (size_t degree=0)
 Constructor producing zero polynomial of degree 'degree'. More...
 
number value (const number x) const
 evaluate the value of the polynom at x More...
 

Protected Member Functions

void compute_coeffs (const size_t i, const std::vector< number > &vPos)
 computes the coefficients for passed interpolation points More...
 
- Protected Member Functions inherited from ug::Polynomial1D
void set_coefficients (const std::vector< number > &a)
 

Private Attributes

std::vector< numberm_vPos
 

Detailed Description

Lagrange Polynomial for arbitrary points

Constructor & Destructor Documentation

◆ Lagrange1D()

ug::Lagrange1D::Lagrange1D ( const size_t  i,
const std::vector< number > &  vPos 
)
inline

constructor for lagrange polynomial i using interpolation points pos This constructor creates a lagrange polynomial with interpolation points given in pos for the i-th point, i.e. value(pos_i) == 1, value(pos_j) == 0 for j != i. Therefore, it must hold that 0 <= i < pos.size()

References compute_coeffs(), and m_vPos.

Member Function Documentation

◆ compute_coeffs()

void ug::Lagrange1D::compute_coeffs ( const size_t  i,
const std::vector< number > &  vPos 
)
inlineprotected

computes the coefficients for passed interpolation points

References ug::Polynomial1D::set_coefficients().

Referenced by Lagrange1D().

◆ position()

number ug::Lagrange1D::position ( const size_t  i) const
inline

returns the position of the i'th interpolation point

References m_vPos, and UG_ASSERT.

Member Data Documentation

◆ m_vPos

std::vector<number> ug::Lagrange1D::m_vPos
private

Referenced by Lagrange1D(), and position().


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