SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::base::ScalarFunction Class Referenceabstract

Abstract base class for scalar-valued functions \(f\colon [0, 1]^d \to \mathbb{R}\) (e.g., objective functions in optimization). More...

#include <ScalarFunction.hpp>

Inheritance diagram for sgpp::base::ScalarFunction:
sgpp::base::ComponentScalarFunction sgpp::base::InterpolantScalarFunction sgpp::base::ScaledScalarFunction sgpp::base::WrapperScalarFunction sgpp::datadriven::KDEMaximumLikelihoodCrossValidation sgpp::optimization::ASInterpolantScalarFunction sgpp::optimization::test_problems::TestScalarFunction sgpp::optimization::test_problems::AbsoluteValueObjective sgpp::optimization::test_problems::AckleyObjective sgpp::optimization::test_problems::Alpine02Objective sgpp::optimization::test_problems::BealeObjective sgpp::optimization::test_problems::Branin01Objective sgpp::optimization::test_problems::Branin02Objective sgpp::optimization::test_problems::BubbleWrapObjective sgpp::optimization::test_problems::EasomYangObjective sgpp::optimization::test_problems::EggholderObjective sgpp::optimization::test_problems::FloudasObjective sgpp::optimization::test_problems::G03Objective sgpp::optimization::test_problems::G04Objective sgpp::optimization::test_problems::G04SquaredObjective sgpp::optimization::test_problems::G05Objective sgpp::optimization::test_problems::G06Objective sgpp::optimization::test_problems::G08Objective sgpp::optimization::test_problems::G09Objective sgpp::optimization::test_problems::G10Objective sgpp::optimization::test_problems::G11Objective sgpp::optimization::test_problems::G12Objective sgpp::optimization::test_problems::G13Objective sgpp::optimization::test_problems::GoldsteinPriceObjective sgpp::optimization::test_problems::GriewankObjective sgpp::optimization::test_problems::Hartman3Objective sgpp::optimization::test_problems::Hartman6Objective sgpp::optimization::test_problems::HimmelblauObjective sgpp::optimization::test_problems::HoelderTableObjective sgpp::optimization::test_problems::IncreasingPowerObjective sgpp::optimization::test_problems::MichalewiczObjective sgpp::optimization::test_problems::MladineoObjective sgpp::optimization::test_problems::PermObjective sgpp::optimization::test_problems::RastriginObjective sgpp::optimization::test_problems::RosenbrockObjective sgpp::optimization::test_problems::SHCBObjective sgpp::optimization::test_problems::Schwefel06Objective sgpp::optimization::test_problems::Schwefel22Objective sgpp::optimization::test_problems::Schwefel26Objective sgpp::optimization::test_problems::SimionescuObjective sgpp::optimization::test_problems::SolandObjective sgpp::optimization::test_problems::SphereObjective sgpp::optimization::test_problems::TremblingParabolaObjective

Public Member Functions

virtual void clone (std::unique_ptr< ScalarFunction > &clone) const =0
 Pure virtual method for cloning the function.
 
virtual void eval (const DataMatrix &x, DataVector &value)
 Convenience method for calculating \(f(\vec{x})\) for multiple \(\vec{x}\).
 
virtual double eval (const DataVector &x)=0
 Pure virtual method for calculating \(f(\vec{x})\).
 
size_t getNumberOfParameters () const
 
 ScalarFunction (size_t d)
 Constructor.
 
virtual ~ScalarFunction ()
 Destructor.
 

Protected Attributes

size_t d
 dimension of the domain
 

Detailed Description

Abstract base class for scalar-valued functions \(f\colon [0, 1]^d \to \mathbb{R}\) (e.g., objective functions in optimization).

Constructor & Destructor Documentation

◆ ScalarFunction()

sgpp::base::ScalarFunction::ScalarFunction ( size_t  d)
inlineexplicit

Constructor.

Parameters
ddimension of the domain

◆ ~ScalarFunction()

virtual sgpp::base::ScalarFunction::~ScalarFunction ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ clone()

virtual void sgpp::base::ScalarFunction::clone ( std::unique_ptr< ScalarFunction > &  clone) const
pure virtual

Pure virtual method for cloning the function.

It should generate a pointer to the cloned object and it's used for parallel computations (the eval() method might not be thread-safe).

Parameters
[out]clonepointer to cloned object

Implemented in sgpp::optimization::ASInterpolantScalarFunction, sgpp::optimization::test_problems::FloudasObjective, sgpp::optimization::test_problems::G03Objective, sgpp::optimization::test_problems::G04Objective, sgpp::optimization::test_problems::G04SquaredObjective, sgpp::optimization::test_problems::G05Objective, sgpp::optimization::test_problems::G06Objective, sgpp::optimization::test_problems::G08Objective, sgpp::optimization::test_problems::G09Objective, sgpp::optimization::test_problems::G10Objective, sgpp::optimization::test_problems::G11Objective, sgpp::optimization::test_problems::G12Objective, sgpp::optimization::test_problems::G13Objective, sgpp::optimization::test_problems::SimionescuObjective, sgpp::optimization::test_problems::SolandObjective, sgpp::optimization::test_problems::AbsoluteValueObjective, sgpp::optimization::test_problems::AckleyObjective, sgpp::optimization::test_problems::Alpine02Objective, sgpp::optimization::test_problems::BealeObjective, sgpp::optimization::test_problems::Branin01Objective, sgpp::optimization::test_problems::Branin02Objective, sgpp::optimization::test_problems::BubbleWrapObjective, sgpp::optimization::test_problems::EasomYangObjective, sgpp::optimization::test_problems::EggholderObjective, sgpp::optimization::test_problems::GoldsteinPriceObjective, sgpp::optimization::test_problems::GriewankObjective, sgpp::optimization::test_problems::Hartman3Objective, sgpp::optimization::test_problems::Hartman6Objective, sgpp::optimization::test_problems::HimmelblauObjective, sgpp::optimization::test_problems::HoelderTableObjective, sgpp::optimization::test_problems::IncreasingPowerObjective, sgpp::optimization::test_problems::MichalewiczObjective, sgpp::optimization::test_problems::MladineoObjective, sgpp::optimization::test_problems::PermObjective, sgpp::optimization::test_problems::RastriginObjective, sgpp::optimization::test_problems::RosenbrockObjective, sgpp::optimization::test_problems::Schwefel06Objective, sgpp::optimization::test_problems::Schwefel22Objective, sgpp::optimization::test_problems::Schwefel26Objective, sgpp::optimization::test_problems::SHCBObjective, sgpp::optimization::test_problems::SphereObjective, sgpp::optimization::test_problems::TremblingParabolaObjective, sgpp::base::ComponentScalarFunction, sgpp::base::InterpolantScalarFunction, sgpp::base::ScaledScalarFunction, sgpp::base::WrapperScalarFunction, and sgpp::datadriven::KDEMaximumLikelihoodCrossValidation.

Referenced by sgpp::optimization::IterativeGridGenerator::evalFunction(), and sgpp::optimization::optimizer::DifferentialEvolution::optimize().

◆ eval() [1/2]

virtual void sgpp::base::ScalarFunction::eval ( const DataMatrix x,
DataVector value 
)
inlinevirtual

Convenience method for calculating \(f(\vec{x})\) for multiple \(\vec{x}\).

Parameters
xmatrix \(\vec{x} \in [0, 1]^{N \times d}\) of evaluation points (row-wise)
[out]value\((f(\vec{x}_k))_k\) where \(\vec{x}_k\) is the \(k\)-th row of \(x\)

References d, eval(), sgpp::base::DataMatrix::getNrows(), and sgpp::base::DataMatrix::getRow().

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

◆ eval() [2/2]

◆ getNumberOfParameters()

Member Data Documentation

◆ d


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