queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::ConstantScalarFunction< V, M > Class Template Reference

A class for handling scalar functions which image is a constant (real number). More...

#include <ConstantScalarFunction.h>

Inheritance diagram for QUESO::ConstantScalarFunction< V, M >:
QUESO::BaseScalarFunction< V, M >

Public Member Functions

Constructor/Destructor methods
 ConstantScalarFunction (const char *prefix, const VectorSet< V, M > &domainSet, double constantValue)
 Default constructor. More...
 
virtual ~ConstantScalarFunction ()
 Virtual destructor. More...
 
Mathematical method
double actualValue (const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
 Calculates the actual value of this scalar function. More...
 
double lnValue (const V &domainVector, const V *domainDirection, V *gradVector, M *hessianMatrix, V *hessianEffect) const
 Calculates the logarithm of the value of this scalar function (which is zero). More...
 
- Public Member Functions inherited from QUESO::BaseScalarFunction< V, M >
void setFiniteDifferenceStepSize (double fdStepSize)
 Sets the step size for finite differencing gradients. More...
 
void setFiniteDifferenceStepSize (unsigned int i, double fdStepSize)
 
 BaseScalarFunction (const char *prefix, const VectorSet< V, M > &domainSet)
 Default constructor. More...
 
virtual ~BaseScalarFunction ()
 Destructor. More...
 
const VectorSet< V, M > & domainSet () const
 Access to the protected attribute m_domainSet: domain set of the scalar function. More...
 
virtual double lnValue (const V &domainVector) const
 Returns the logarithm of the function at domainVector. More...
 
virtual double lnValue (const V &domainVector, V &gradVector) const
 Returns the logarithm of the function and its gradient at domainVector. More...
 
virtual double lnValue (const V &domainVector, V &gradVector, const V &domainDirection, V &hessianEffect) const
 

Protected Attributes

double m_constantValue
 Constant value is the image set of this scalar function. More...
 
- Protected Attributes inherited from QUESO::BaseScalarFunction< V, M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< V, M > & m_domainSet
 Domain set of the scalar function. More...
 

Detailed Description

template<class V = GslVector, class M = GslMatrix>
class QUESO::ConstantScalarFunction< V, M >

A class for handling scalar functions which image is a constant (real number).

This class allows the mathematical definition of a scalar function which image set is a constant (real number).

Definition at line 46 of file ConstantScalarFunction.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::ConstantScalarFunction< V, M >::ConstantScalarFunction ( const char *  prefix,
const VectorSet< V, M > &  domainSet,
double  constantValue 
)

Default constructor.

Instantiates an object of the class, i.e. a scalar function, given a prefix, its domain and constant-valued image.

Definition at line 35 of file ConstantScalarFunction.C.

38  : BaseScalarFunction<V,M>(((std::string)(prefix)+"gen").c_str(), domainSet),
39  m_constantValue(constantValue)
40 {
41 }
double m_constantValue
Constant value is the image set of this scalar function.
const VectorSet< V, M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the scalar function. ...
template<class V , class M >
QUESO::ConstantScalarFunction< V, M >::~ConstantScalarFunction ( )
virtual

Virtual destructor.

Definition at line 45 of file ConstantScalarFunction.C.

46 {
47 }

Member Function Documentation

template<class V , class M >
double QUESO::ConstantScalarFunction< V, M >::actualValue ( const V &  domainVector,
const V *  domainDirection,
V *  gradVector,
M *  hessianMatrix,
V *  hessianEffect 
) const
virtual

Calculates the actual value of this scalar function.

Implements QUESO::BaseScalarFunction< V, M >.

Definition at line 51 of file ConstantScalarFunction.C.

56 {
57  return m_constantValue;
58 }
double m_constantValue
Constant value is the image set of this scalar function.
template<class V , class M >
double QUESO::ConstantScalarFunction< V, M >::lnValue ( const V &  domainVector,
const V *  domainDirection,
V *  gradVector,
M *  hessianMatrix,
V *  hessianEffect 
) const
virtual

Calculates the logarithm of the value of this scalar function (which is zero).

Reimplemented from QUESO::BaseScalarFunction< V, M >.

Definition at line 62 of file ConstantScalarFunction.C.

67 {
68  return 0.;
69 }

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
double QUESO::ConstantScalarFunction< V, M >::m_constantValue
protected

Constant value is the image set of this scalar function.

Definition at line 72 of file ConstantScalarFunction.h.


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

Generated on Tue Jun 5 2018 19:48:59 for queso-0.57.1 by  doxygen 1.8.5