Geophysical Inversion and Modelling Library  v1.5.2-5-g042d7f36
GIMLI::PolynomialFunction< ValueType > Class Template Reference

## Public Member Functions

PolynomialFunction (uint size=0)

PolynomialFunction (const Vector< ValueType > &ax)

PolynomialFunction (const Vector< ValueType > &ax, const Vector< ValueType > &ay)

PolynomialFunction (const Vector< ValueType > &ax, const Vector< ValueType > &ay, const Vector< ValueType > &az)

RMatrixoperator[] (Index k)

const RMatrixoperator[] (Index k) const

RMatrixmatR (Index k)

ValueType operator() (const Pos &xyz) const

Vector< ValueType > operator() (const std::vector< Pos > &xyz) const

Index size () const

PolynomialFunction< ValueType > derive (uint dim) const

void fillElementList ()

const std::vector< PolynomialElement< ValueType > > & elements () const

void clear ()

PolynomialFunction< ValueType > & fill (const Vector< ValueType > &c)

RVector coeff () const

## Protected Member Functions

void init_ (const Vector< ValueType > &ax, const Vector< ValueType > &ay, const Vector< ValueType > &az)

## Protected Attributes

std::vector< Matrix< ValueType > > mat_

std::vector< PolynomialElement< ValueType > > elementList_

## Detailed Description

### template<class ValueType> class GIMLI::PolynomialFunction< ValueType >

Three dimensional polynomial function. For symbolic calculation and derivation. I.e. f(x,y,z) = 1 + x + y + z + xy + xz + zz ...

## ◆ PolynomialFunction() [1/4]

template<class ValueType >
 GIMLI::PolynomialFunction< ValueType >::PolynomialFunction ( uint size = 0 )
inline

Create empty polynomial

## ◆ PolynomialFunction() [2/4]

template<class ValueType >
 GIMLI::PolynomialFunction< ValueType >::PolynomialFunction ( const Vector< ValueType > & ax )
inline

Create a polynomial from one dimensional polynomial coefficient array ax:

## ◆ PolynomialFunction() [3/4]

template<class ValueType >
 GIMLI::PolynomialFunction< ValueType >::PolynomialFunction ( const Vector< ValueType > & ax, const Vector< ValueType > & ay )
inline

Create a polynomial function from one dimensional polynomial coefficient array ax and ay: . If u need a composed polynomial use f(x,y,z)*g(x,y,z).

## ◆ PolynomialFunction() [4/4]

template<class ValueType >
 GIMLI::PolynomialFunction< ValueType >::PolynomialFunction ( const Vector< ValueType > & ax, const Vector< ValueType > & ay, const Vector< ValueType > & az )
inline

Create a polynomial function from one dimensional polynomial coefficient array ax, ay, az: If u need a composed polynomial use f(x,y,z)*g(x,y,z)*h(x,y,z).

## ◆ coeff()

template<class ValueType >
 RVector GIMLI::PolynomialFunction< ValueType >::coeff ( ) const
inline

Return all coefficients.

## ◆ derive()

template<class ValueType >
 PolynomialFunction< ValueType > GIMLI::PolynomialFunction< ValueType >::derive ( uint dim ) const
inline

Create new polynomial function for

Parameters
 dim = 0 dim = 1 dim = 2

## ◆ fill()

template<class ValueType >
 PolynomialFunction< ValueType >& GIMLI::PolynomialFunction< ValueType >::fill ( const Vector< ValueType > & c )
inline

Fill the parameter coefficients from array. If c.size() == this.size()^3. mat_[k][i][j] = c[k*(size() * size())+ j * size() + i] and return the PolynomialFunction itself. If c.size() is size of elementList_, assume that only the values from elementList_ will be exchanged. Please note, all values of c will be snapped to tolerance.

## ◆ matR()

template<class ValueType >
 RMatrix& GIMLI::PolynomialFunction< ValueType >::matR ( Index k )
inline

Return reference to f(x, y, z[k]) polynomial matrix. For python only

## ◆ operator()() [1/2]

template<class ValueType >
 ValueType GIMLI::PolynomialFunction< ValueType >::operator() ( const Pos & xyz ) const
inline

Evaluate f(x,y,z)

## ◆ operator()() [2/2]

template<class ValueType >
 Vector< ValueType > GIMLI::PolynomialFunction< ValueType >::operator() ( const std::vector< Pos > & xyz ) const
inline

Evaluate f(x_i,y_i,z_i) for i = [0 .. xyz.size()).

## ◆ operator[]() [1/2]

template<class ValueType >
 RMatrix& GIMLI::PolynomialFunction< ValueType >::operator[] ( Index k )
inline

Return f(x, y, z[k]) polynomial matrix

## ◆ operator[]() [2/2]

template<class ValueType >
 const RMatrix& GIMLI::PolynomialFunction< ValueType >::operator[] ( Index k ) const
inline

Return f(x, y, z[k]) polynomial matrix

## ◆ size()

template<class ValueType >
 Index GIMLI::PolynomialFunction< ValueType >::size ( ) const
inline

Return the size of this polynomial.

Referenced by GIMLI::operator*(), and GIMLI::PolynomialModelling::startModel().