queso-0.53.0
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 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
const Base1D1DFunction & m_func1
Definition: 1D1DFunction.h:531
Base1D1DFunction(double minDomainValue, double maxDomainValue)
Default constructor.
Definition: 1D1DFunction.C:33
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, queso_not_implemented, queso_require_msg, 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 
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
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
#define queso_not_implemented()
Definition: asserts.h:56
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 }
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_func2
Definition: 1D1DFunction.h:532
virtual double value(double domainValue) const =0
Returns the value of the (one-dimensional) function. See template specialization. ...
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 Thu Jun 11 2015 13:52:35 for queso-0.53.0 by  doxygen 1.8.5