queso-0.57.1
|
Class for Lagrange polynomial basis. More...
#include <1D1DFunction.h>
Public Member Functions | |
Constructor/Destructor methods | |
LagrangeBasis1D1DFunction (const std::vector< double > &positionValues, unsigned int basisIndex) | |
Default constructor. More... | |
~LagrangeBasis1D1DFunction () | |
Destructor. More... | |
Mathematical methods | |
double | value (double domainValue) const |
Returns the value of the Lagrange basis at point domainValue . More... | |
double | deriv (double domainValue) const |
TODO: Returns the value of the derivative of the Lagrange basis at point domainValue . More... | |
Public Member Functions inherited from QUESO::Base1D1DFunction | |
Base1D1DFunction (double minDomainValue, double maxDomainValue) | |
Default constructor. More... | |
virtual | ~Base1D1DFunction () |
Destructor. More... | |
double | minDomainValue () const |
Returns the minimum value of the domain of the (one-dimensional) function. More... | |
double | maxDomainValue () const |
Returns the maximum value of the domain of the (one-dimensional) function. More... | |
virtual double | multiplyAndIntegrate (const Base1D1DFunction &func, unsigned int quadratureOrder, double *resultWithMultiplicationByTAsWell) const |
TODO: Multiplies this function with function , and integrates it numerically. See template specialization. More... | |
Protected Attributes | |
std::vector< double > | m_positionValues |
unsigned int | m_basisIndex |
Protected Attributes inherited from QUESO::Base1D1DFunction | |
double | m_minDomainValue |
double | m_maxDomainValue |
Class for Lagrange polynomial basis.
Given a set of \( k+1 \) data points \((x_0, y_0),\ldots,(x_j, y_j),\ldots,(x_k, y_k)\) where no two \( x_j \) are the same, the interpolation polynomial in the Lagrange form is a linear combination
\[ L(x) = \sum_{j=0}^{k} y_j \ell_j(x) \]
of Lagrange basis polynomials
\[ \ell_j(x) = \prod_{0\le m\le k;\, m\neq j} \frac{x-x_m}{x_j-x_m} = \frac{(x-x_0)}{(x_j-x_0)} \cdots \frac{(x-x_{j-1})}{(x_j-x_{j-1})} \frac{(x-x_{j+1})}{(x_j-x_{j+1})} \cdots \frac{(x-x_k)}{(x_j-x_k)},\]
where \( 0\le j\le k \).
This class implements the one-dimensional function (Lagrange basis) \( \ell_j(x) \). In this class, the array std::vector<double>& positionValues
stores the points \( x_1, x_2, ... x_n \) and the index \( j \) is stored in basisIndex
.
Definition at line 609 of file 1D1DFunction.h.
QUESO::LagrangeBasis1D1DFunction::LagrangeBasis1D1DFunction | ( | const std::vector< double > & | positionValues, |
unsigned int | basisIndex | ||
) |
Default constructor.
Definition at line 820 of file 1D1DFunction.C.
References m_basisIndex, and m_positionValues.
QUESO::LagrangeBasis1D1DFunction::~LagrangeBasis1D1DFunction | ( | ) |
|
virtual |
TODO: Returns the value of the derivative of the Lagrange basis at point domainValue
.
domainValue
belongs to the domain of this
function, and in affirmative case, it returns the value of the derivative at such point. Implements QUESO::Base1D1DFunction.
Definition at line 853 of file 1D1DFunction.C.
References QUESO::Base1D1DFunction::m_maxDomainValue, QUESO::Base1D1DFunction::m_minDomainValue, and value().
|
virtual |
Returns the value of the Lagrange basis at point domainValue
.
Implements QUESO::Base1D1DFunction.
Definition at line 836 of file 1D1DFunction.C.
References m_basisIndex, and m_positionValues.
Referenced by deriv().
|
protected |
Definition at line 636 of file 1D1DFunction.h.
Referenced by LagrangeBasis1D1DFunction(), and value().
|
protected |
Definition at line 635 of file 1D1DFunction.h.
Referenced by LagrangeBasis1D1DFunction(), and value().