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

Class for generic one-dimensional functions. More...

#include <1D1DFunction.h>

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

Public Member Functions

Constructor/Destructor methods
 Generic1D1DFunction (double minDomainValue, double maxDomainValue, double(*valueRoutinePtr)(double domainValue, const void *routinesDataPtr), double(*derivRoutinePtr)(double domainValue, const void *routinesDataPtr), const void *routinesDataPtr)
 Default constructor. More...
 
 ~Generic1D1DFunction ()
 Destructor. More...
 
Mathematical methods
double value (double domainValue) const
 Returns the value of the (one-dimensional) function at point domainValue. More...
 
double deriv (double domainValue) const
 Returns the value of the derivative of the function at 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

double(* m_valueRoutinePtr )(double domainValue, const void *routinesDataPtr)
 
double(* m_derivRoutinePtr )(double domainValue, const void *routinesDataPtr)
 
const void * m_routinesDataPtr
 
- Protected Attributes inherited from QUESO::Base1D1DFunction
double m_minDomainValue
 
double m_maxDomainValue
 

Detailed Description

Class for generic one-dimensional functions.

This class implements generic one-dimensional functions.

Definition at line 97 of file 1D1DFunction.h.

Constructor & Destructor Documentation

QUESO::Generic1D1DFunction::Generic1D1DFunction ( double  minDomainValue,
double  maxDomainValue,
double(*)(double domainValue, const void *routinesDataPtr)  valueRoutinePtr,
double(*)(double domainValue, const void *routinesDataPtr)  derivRoutinePtr,
const void *  routinesDataPtr 
)

Default constructor.

Definition at line 82 of file 1D1DFunction.C.

88  :
90  m_valueRoutinePtr (valueRoutinePtr),
91  m_derivRoutinePtr (derivRoutinePtr),
92  m_routinesDataPtr (routinesDataPtr)
93 {
94 }
Base1D1DFunction(double minDomainValue, double maxDomainValue)
Default constructor.
Definition: 1D1DFunction.C:33
double maxDomainValue() const
Returns the maximum value of the domain of the (one-dimensional) function.
Definition: 1D1DFunction.C:57
double(* m_derivRoutinePtr)(double domainValue, const void *routinesDataPtr)
Definition: 1D1DFunction.h:128
double(* m_valueRoutinePtr)(double domainValue, const void *routinesDataPtr)
Definition: 1D1DFunction.h:127
const void * m_routinesDataPtr
Definition: 1D1DFunction.h:129
double minDomainValue() const
Returns the minimum value of the domain of the (one-dimensional) function.
Definition: 1D1DFunction.C:51
QUESO::Generic1D1DFunction::~Generic1D1DFunction ( )

Destructor.

Definition at line 96 of file 1D1DFunction.C.

97 {
98 }

Member Function Documentation

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

Returns the value of the derivative of the function at point domainValue.

This function checks if point domainValue belongs to the domain of this function, and in affirmative case, it returns the value of the derivative at such point.

Implements QUESO::Base1D1DFunction.

Definition at line 121 of file 1D1DFunction.C.

References m_derivRoutinePtr, QUESO::Base1D1DFunction::m_maxDomainValue, QUESO::Base1D1DFunction::m_minDomainValue, m_routinesDataPtr, UQ_FATAL_TEST_MACRO, and QUESO::UQ_UNAVAILABLE_RANK.

122 {
123  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
124  std::cerr << "In Generic1D1DFunction::deriv()"
125  << ": requested x (" << domainValue
126  << ") is out of the interval (" << m_minDomainValue
127  << ", " << m_maxDomainValue
128  << ")"
129  << std::endl;
130  }
131 
132  UQ_FATAL_TEST_MACRO(((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)),
134  "Generic1D1DFunction::deriv()",
135  "x out of range");
136 
137  return (*m_derivRoutinePtr)(domainValue,m_routinesDataPtr);
138 }
const int UQ_UNAVAILABLE_RANK
Definition: Defines.h:74
double(* m_derivRoutinePtr)(double domainValue, const void *routinesDataPtr)
Definition: 1D1DFunction.h:128
const void * m_routinesDataPtr
Definition: 1D1DFunction.h:129
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
double QUESO::Generic1D1DFunction::value ( double  domainValue) const
virtual

Returns the value of the (one-dimensional) function at point domainValue.

This function checks if point domainValue belongs to the domain of this function, and in affirmative case, it evaluates the function at such point.

Implements QUESO::Base1D1DFunction.

Definition at line 101 of file 1D1DFunction.C.

References QUESO::Base1D1DFunction::m_maxDomainValue, QUESO::Base1D1DFunction::m_minDomainValue, m_routinesDataPtr, m_valueRoutinePtr, UQ_FATAL_TEST_MACRO, and QUESO::UQ_UNAVAILABLE_RANK.

102 {
103  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
104  std::cerr << "In Generic1D1DFunction::value()"
105  << ": requested x (" << domainValue
106  << ") is out of the interval (" << m_minDomainValue
107  << ", " << m_maxDomainValue
108  << ")"
109  << std::endl;
110  }
111 
112  UQ_FATAL_TEST_MACRO(((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)),
114  "Generic1D1DFunction::value()",
115  "x out of range");
116 
117  return (*m_valueRoutinePtr)(domainValue,m_routinesDataPtr);
118 }
const int UQ_UNAVAILABLE_RANK
Definition: Defines.h:74
double(* m_valueRoutinePtr)(double domainValue, const void *routinesDataPtr)
Definition: 1D1DFunction.h:127
const void * m_routinesDataPtr
Definition: 1D1DFunction.h:129
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223

Member Data Documentation

double(* QUESO::Generic1D1DFunction::m_derivRoutinePtr)(double domainValue, const void *routinesDataPtr)
protected

Definition at line 128 of file 1D1DFunction.h.

Referenced by deriv().

const void* QUESO::Generic1D1DFunction::m_routinesDataPtr
protected

Definition at line 129 of file 1D1DFunction.h.

Referenced by deriv(), and value().

double(* QUESO::Generic1D1DFunction::m_valueRoutinePtr)(double domainValue, const void *routinesDataPtr)
protected

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