SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::base::ComponentScalarFunctionGradient Class Reference

One component of a vector-valued function gradient. More...

#include <ComponentScalarFunctionGradient.hpp>

Inheritance diagram for sgpp::base::ComponentScalarFunctionGradient:
sgpp::base::ScalarFunctionGradient

Public Member Functions

void clone (std::unique_ptr< ScalarFunctionGradient > &clone) const override
 
 ComponentScalarFunctionGradient (ScalarFunctionGradient &fGradient, std::vector< double > defaultValues=std::vector< double >())
 Constructor.
 
 ComponentScalarFunctionGradient (VectorFunctionGradient &fGradient, size_t k, std::vector< double > defaultValues=std::vector< double >())
 Constructor.
 
double eval (const DataVector &x, DataVector &gradient) override
 
 ~ComponentScalarFunctionGradient () override
 Destructor.
 
- Public Member Functions inherited from sgpp::base::ScalarFunctionGradient
virtual void eval (const DataMatrix &x, DataVector &value, DataMatrix &gradient)
 Convenience method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\) for multiple \(\vec{x}\).
 
size_t getNumberOfParameters () const
 
 ScalarFunctionGradient (size_t d)
 Constructor.
 
virtual ~ScalarFunctionGradient ()
 Destructor.
 

Protected Member Functions

void initialize ()
 

Protected Attributes

std::vector< double > defaultValues
 vector of default values, indicating free variables with NAN
 
size_t dF
 dimension of underlying function
 
ScalarFunctionGradientfGradientScalar
 scalar-valued function gradient
 
VectorFunctionGradientfGradientVector
 vector-valued function gradient
 
size_t k
 index of component
 
DataMatrix tmpMat
 temporary matrix
 
DataVector tmpVec1
 temporary vector 1
 
DataVector tmpVec2
 temporary vector 2
 
- Protected Attributes inherited from sgpp::base::ScalarFunctionGradient
size_t d
 dimension of the domain
 

Detailed Description

One component of a vector-valued function gradient.

See also
ComponentScalarFunction

Constructor & Destructor Documentation

◆ ComponentScalarFunctionGradient() [1/2]

sgpp::base::ComponentScalarFunctionGradient::ComponentScalarFunctionGradient ( ScalarFunctionGradient fGradient,
std::vector< double >  defaultValues = std::vector<double>() 
)
inline

Constructor.

Use it like this: ComponentScalarFunctionGradient gGradient(fGradient, {NAN, NAN, 0.42}); where fGradient is a scalar-valued function gradient with 3 parameters. This selects the first two parameters of fGradient, while constantly using 0.42 for the third parameter.

Parameters
fGradientscalar-valued function gradient
defaultValuesVector of constant default values. It can be either empty (the default) or a vector of exactly m doubles, each of which can be finite or NAN. If the vector is empty, it will be initialized as m NANs (i.e., no restriction of the parameter domain). Each NAN represents a free parameter \(x_t\), while the finite entries denote the constant values for the corresponding parameter.

References initialize().

◆ ComponentScalarFunctionGradient() [2/2]

sgpp::base::ComponentScalarFunctionGradient::ComponentScalarFunctionGradient ( VectorFunctionGradient fGradient,
size_t  k,
std::vector< double >  defaultValues = std::vector<double>() 
)
inline

Constructor.

Use it like this: ComponentScalarFunctionGradient gGradient(fGradient, 3, {NAN, NAN, 0.42}); where fGradient is a vector-valued function gradient with 5 components and 3 parameters. This selects the first two parameters and the fourth component of fGradient, while constantly using 0.42 for the third parameter.

Parameters
fGradientvector-valued function gradient (m components)
kindex of component \(f_k\) to select (between 0 and m - 1)
defaultValuessee other constructor

References initialize().

◆ ~ComponentScalarFunctionGradient()

sgpp::base::ComponentScalarFunctionGradient::~ComponentScalarFunctionGradient ( )
inlineoverride

Destructor.

Member Function Documentation

◆ clone()

void sgpp::base::ComponentScalarFunctionGradient::clone ( std::unique_ptr< ScalarFunctionGradient > &  clone) const
inlineoverridevirtual
Parameters
[out]clonepointer to cloned object

Implements sgpp::base::ScalarFunctionGradient.

References clone().

Referenced by clone().

◆ eval()

double sgpp::base::ComponentScalarFunctionGradient::eval ( const DataVector x,
DataVector gradient 
)
inlineoverridevirtual
Parameters
[in]xevaluation point \(\vec{x} \in [0, 1]^n\)
[out]gradient\(\nabla_{\vec{x}} g(\vec{x})\)
Returns
\(g(\vec{x}) := f_k(y_1, \dotsc, y_d)\) where \((x_1, \dotsc, x_n) = (y_{i_1}, \dotsc, y_{i_n})\)

Implements sgpp::base::ScalarFunctionGradient.

References defaultValues, dF, sgpp::base::ScalarFunctionGradient::eval(), sgpp::base::VectorFunctionGradient::eval(), fGradientScalar, fGradientVector, k, tmpMat, tmpVec1, and tmpVec2.

Referenced by python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity().

◆ initialize()

void sgpp::base::ComponentScalarFunctionGradient::initialize ( )
inlineprotected

Member Data Documentation

◆ defaultValues

std::vector<double> sgpp::base::ComponentScalarFunctionGradient::defaultValues
protected

vector of default values, indicating free variables with NAN

Referenced by eval(), and initialize().

◆ dF

size_t sgpp::base::ComponentScalarFunctionGradient::dF
protected

dimension of underlying function

Referenced by eval(), and initialize().

◆ fGradientScalar

ScalarFunctionGradient* sgpp::base::ComponentScalarFunctionGradient::fGradientScalar
protected

scalar-valued function gradient

Referenced by eval().

◆ fGradientVector

VectorFunctionGradient* sgpp::base::ComponentScalarFunctionGradient::fGradientVector
protected

vector-valued function gradient

Referenced by eval().

◆ k

◆ tmpMat

DataMatrix sgpp::base::ComponentScalarFunctionGradient::tmpMat
protected

temporary matrix

Referenced by eval().

◆ tmpVec1

DataVector sgpp::base::ComponentScalarFunctionGradient::tmpVec1
protected

temporary vector 1

Referenced by eval(), and initialize().

◆ tmpVec2

DataVector sgpp::base::ComponentScalarFunctionGradient::tmpVec2
protected

temporary vector 2

Referenced by eval().


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