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

Class for multiplication of a one-dimensional function by another. More...

#include <1D1DFunction.h>

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

Public Member Functions

Constructor/Destructor methods
 FuncTimesFunc1D1DFunction (const Base1D1DFunction &func1, const Base1D1DFunction &func2)
 Default constructor. More...
 
 ~FuncTimesFunc1D1DFunction ()
 Destructor. More...
 
Mathematical methods
double value (double domainValue) const
 Returns the value of the multiplication of a function func1 by another function func2 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 function func1 by another function func2 at the point domainValue. 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 multiplication of a one-dimensional function by another.

This class implements the multiplication of a generic one-dimensional function by another (both functions may be of any type of functions derived from Base1D1DFunction).

Definition at line 462 of file 1D1DFunction.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 719 of file 1D1DFunction.C.

722  :
723  Base1D1DFunction(std::max(func1.minDomainValue(),func2.minDomainValue()),std::min(func1.maxDomainValue(),func2.maxDomainValue())),
724  m_func1(func1),
725  m_func2(func2)
726 {
727 }
Base1D1DFunction(double minDomainValue, double maxDomainValue)
Default constructor.
Definition: 1D1DFunction.C:33
const Base1D1DFunction & m_func2
Definition: 1D1DFunction.h:492
const Base1D1DFunction & m_func1
Definition: 1D1DFunction.h:491
QUESO::FuncTimesFunc1D1DFunction::~FuncTimesFunc1D1DFunction ( )

Destructor.

Definition at line 729 of file 1D1DFunction.C.

730 {
731 }

Member Function Documentation

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

TODO: Returns the value of the derivative of the function func1 by another function func2 at the point domainValue.

Todo:
Please, implement me!
This method objective requires clarification: are we calculating either (func1*func2)' or func1'*func2'?

Implements QUESO::Base1D1DFunction.

Definition at line 744 of file 1D1DFunction.C.

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

745 {
746  double value = 0.;
747 
748  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
749  std::cerr << "In FuncTimes1D1DFunction::deriv()"
750  << ": requested x (" << domainValue
751  << ") is out of the interval (" << m_minDomainValue
752  << ", " << m_maxDomainValue
753  << ")"
754  << std::endl;
755  }
756 
757  UQ_FATAL_TEST_MACRO(((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)),
759  "FuncTimes1D1DFunction::deriv()",
760  "x out of range");
761 
762  UQ_FATAL_TEST_MACRO(true,
764  "FuncTimesFunc1D1DFunction::deriv()",
765  "not implemented yet");
766 
767  return value;
768 }
double value(double domainValue) const
Returns the value of the multiplication of a function func1 by another function func2 at the point do...
Definition: 1D1DFunction.C:734
const int UQ_UNAVAILABLE_RANK
Definition: Defines.h:74
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
double QUESO::FuncTimesFunc1D1DFunction::value ( double  domainValue) const
virtual

Returns the value of the multiplication of a function func1 by another function func2 at the point domainValue, i.e. returnValue = func1(domainValue)*func2(domainValue) .

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

Implements QUESO::Base1D1DFunction.

Definition at line 734 of file 1D1DFunction.C.

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

Referenced by deriv().

735 {
736  double value = 0.;
737 
738  value += m_func1.value(domainValue)*m_func2.value(domainValue);
739 
740  return value;
741 }
double value(double domainValue) const
Returns the value of the multiplication of a function func1 by another function func2 at the point do...
Definition: 1D1DFunction.C:734
virtual double value(double domainValue) const =0
Returns the value of the (one-dimensional) function. See template specialization. ...
const Base1D1DFunction & m_func2
Definition: 1D1DFunction.h:492
const Base1D1DFunction & m_func1
Definition: 1D1DFunction.h:491

Member Data Documentation

const Base1D1DFunction& QUESO::FuncTimesFunc1D1DFunction::m_func1
protected

Definition at line 491 of file 1D1DFunction.h.

Referenced by value().

const Base1D1DFunction& QUESO::FuncTimesFunc1D1DFunction::m_func2
protected

Definition at line 492 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