queso-0.51.1
Protected Attributes | List of all members
QUESO::FuncPlusFunc1D1DFunction Class Reference

Class for addition of a one-dimensional function with another. More...

#include <1D1DFunction.h>

Inheritance diagram for QUESO::FuncPlusFunc1D1DFunction:
Inheritance graph
[legend]
Collaboration diagram for QUESO::FuncPlusFunc1D1DFunction:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 FuncPlusFunc1D1DFunction (const Base1D1DFunction &func1, const Base1D1DFunction &func2)
 Default constructor. More...
 
 ~FuncPlusFunc1D1DFunction ()
 Destructor. More...
 
Mathematical methods
double value (double domainValue) const
 Returns the value of the addition of function func1 and func2 evaluated at the point domainValue, i.e. returnValue = func1(domainValue)+func2(domainValue) . More...
 
double deriv (double domainValue) const
 TODO: Returns the value of the derivative of the addition of two functions. 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

const Base1D1DFunctionm_func1
 
const Base1D1DFunctionm_func2
 
- Protected Attributes inherited from QUESO::Base1D1DFunction
double m_minDomainValue
 
double m_maxDomainValue
 

Detailed Description

Class for addition of a one-dimensional function with another.

This class implements the addition of two generic one-dimensional functions (both functions may be of any type of functions derived from Base1D1DFunction).

Definition at line 504 of file 1D1DFunction.h.

Constructor & Destructor Documentation

QUESO::FuncPlusFunc1D1DFunction::FuncPlusFunc1D1DFunction ( const Base1D1DFunction func1,
const Base1D1DFunction func2 
)

Default constructor.

Definition at line 773 of file 1D1DFunction.C.

776  :
777  Base1D1DFunction(std::max(func1.minDomainValue(),func2.minDomainValue()),std::min(func1.maxDomainValue(),func2.maxDomainValue())),
778  m_func1(func1),
779  m_func2(func2)
780 {
781 }
Base1D1DFunction(double minDomainValue, double maxDomainValue)
Default constructor.
Definition: 1D1DFunction.C:33
const Base1D1DFunction & m_func1
Definition: 1D1DFunction.h:531
const Base1D1DFunction & m_func2
Definition: 1D1DFunction.h:532
QUESO::FuncPlusFunc1D1DFunction::~FuncPlusFunc1D1DFunction ( )

Destructor.

Definition at line 783 of file 1D1DFunction.C.

784 {
785 }

Member Function Documentation

double QUESO::FuncPlusFunc1D1DFunction::deriv ( double  domainValue) const
virtual

TODO: Returns the value of the derivative of the addition of two functions.

Todo:
Please, implement me!

Implements QUESO::Base1D1DFunction.

Definition at line 798 of file 1D1DFunction.C.

References QUESO::Base1D1DFunction::m_maxDomainValue, QUESO::Base1D1DFunction::m_minDomainValue, UQ_FATAL_TEST_MACRO, QUESO::UQ_UNAVAILABLE_RANK, and value().

799 {
800  double value = 0.;
801 
802  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
803  std::cerr << "In FuncPlus1D1DFunction::deriv()"
804  << ": requested x (" << domainValue
805  << ") is out of the interval (" << m_minDomainValue
806  << ", " << m_maxDomainValue
807  << ")"
808  << std::endl;
809  }
810 
811  UQ_FATAL_TEST_MACRO(((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)),
813  "FuncPlus1D1DFunction::deriv()",
814  "x out of range");
815 
816  UQ_FATAL_TEST_MACRO(true,
818  "FuncPlusFunc1D1DFunction::deriv()",
819  "not implemented yet");
820 
821  return value;
822 }
const int UQ_UNAVAILABLE_RANK
Definition: Defines.h:74
double value(double domainValue) const
Returns the value of the addition of function func1 and func2 evaluated at the point domainValue...
Definition: 1D1DFunction.C:788
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
double QUESO::FuncPlusFunc1D1DFunction::value ( double  domainValue) const
virtual

Returns the value of the addition of function func1 and func2 evaluated at the point domainValue, i.e. returnValue = func1(domainValue)+func2(domainValue) .

This function calls the value() method of the both functions and adds their return value with one another.

Implements QUESO::Base1D1DFunction.

Definition at line 788 of file 1D1DFunction.C.

References m_func1, m_func2, and QUESO::Base1D1DFunction::value().

Referenced by deriv().

789 {
790  double value = 0.;
791 
792  value += m_func1.value(domainValue) + m_func2.value(domainValue);
793 
794  return value;
795 }
virtual double value(double domainValue) const =0
Returns the value of the (one-dimensional) function. See template specialization. ...
double value(double domainValue) const
Returns the value of the addition of function func1 and func2 evaluated at the point domainValue...
Definition: 1D1DFunction.C:788
const Base1D1DFunction & m_func1
Definition: 1D1DFunction.h:531
const Base1D1DFunction & m_func2
Definition: 1D1DFunction.h:532

Member Data Documentation

const Base1D1DFunction& QUESO::FuncPlusFunc1D1DFunction::m_func1
protected

Definition at line 531 of file 1D1DFunction.h.

Referenced by value().

const Base1D1DFunction& QUESO::FuncPlusFunc1D1DFunction::m_func2
protected

Definition at line 532 of file 1D1DFunction.h.

Referenced by value().


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

Generated on Thu Apr 23 2015 19:26:17 for queso-0.51.1 by  doxygen 1.8.5