queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::FuncPlusFunc1D1DFunction Class Reference

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

#include <1D1DFunction.h>

Inheritance diagram for QUESO::FuncPlusFunc1D1DFunction:
QUESO::Base1D1DFunction

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 695 of file 1D1DFunction.C.

698  :
699  Base1D1DFunction(std::max(func1.minDomainValue(),func2.minDomainValue()),std::min(func1.maxDomainValue(),func2.maxDomainValue())),
700  m_func1(func1),
701  m_func2(func2)
702 {
703 }
const Base1D1DFunction & m_func2
Definition: 1D1DFunction.h:532
Base1D1DFunction(double minDomainValue, double maxDomainValue)
Default constructor.
Definition: 1D1DFunction.C:33
const Base1D1DFunction & m_func1
Definition: 1D1DFunction.h:531
QUESO::FuncPlusFunc1D1DFunction::~FuncPlusFunc1D1DFunction ( )

Destructor.

Definition at line 705 of file 1D1DFunction.C.

706 {
707 }

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 720 of file 1D1DFunction.C.

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

721 {
722  double value = 0.;
723 
724  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
725  std::cerr << "In FuncPlus1D1DFunction::deriv()"
726  << ": requested x (" << domainValue
727  << ") is out of the interval (" << m_minDomainValue
728  << ", " << m_maxDomainValue
729  << ")"
730  << std::endl;
731  }
732 
733  queso_require_msg(!((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)), "x out of range");
734 
735  queso_not_implemented();
736 
737  return value;
738 }
double value(double domainValue) const
Returns the value of the addition of function func1 and func2 evaluated at the point domainValue...
Definition: 1D1DFunction.C:710
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 710 of file 1D1DFunction.C.

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

Referenced by deriv().

711 {
712  double value = 0.;
713 
714  value += m_func1.value(domainValue) + m_func2.value(domainValue);
715 
716  return value;
717 }
const Base1D1DFunction & m_func2
Definition: 1D1DFunction.h:532
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:710
const Base1D1DFunction & m_func1
Definition: 1D1DFunction.h:531

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 Tue Jun 5 2018 19:49:17 for queso-0.57.1 by  doxygen 1.8.5