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

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

#include <1D1DFunction.h>

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

Public Member Functions

Constructor/Destructor methods
 ScalarTimesFunc1D1DFunction (double scalar, const Base1D1DFunction &func)
 Default constructor. More...
 
 ~ScalarTimesFunc1D1DFunction ()
 Destructor. More...
 
Mathematical methods
double value (double domainValue) const
 Returns the value of the (one-dimensional) function at point domainValue, already multiplied by the scalar (given during construction). More...
 
double deriv (double domainValue) const
 TODO: Returns the value of the derivative of the function multiplied by the given scalar 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_scalar
 
const Base1D1DFunctionm_func
 
- Protected Attributes inherited from QUESO::Base1D1DFunction
double m_minDomainValue
 
double m_maxDomainValue
 

Detailed Description

Class for multiplication of a one-dimensional function by a scalar.

This class implements the multiplication of a generic one-dimensional function (implemented through any class derived from Base1D1DFunction) by a given scalar.

Definition at line 421 of file 1D1DFunction.h.

Constructor & Destructor Documentation

QUESO::ScalarTimesFunc1D1DFunction::ScalarTimesFunc1D1DFunction ( double  scalar,
const Base1D1DFunction func 
)

Default constructor.

Definition at line 665 of file 1D1DFunction.C.

668  :
669  Base1D1DFunction(func.minDomainValue(),func.maxDomainValue()),
670  m_scalar(scalar),
671  m_func (func)
672 {
673 }
Base1D1DFunction(double minDomainValue, double maxDomainValue)
Default constructor.
Definition: 1D1DFunction.C:33
const Base1D1DFunction & m_func
Definition: 1D1DFunction.h:449
QUESO::ScalarTimesFunc1D1DFunction::~ScalarTimesFunc1D1DFunction ( )

Destructor.

Definition at line 675 of file 1D1DFunction.C.

676 {
677 }

Member Function Documentation

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

TODO: Returns the value of the derivative of the function multiplied by the given scalar at point domainValue.

Todo:
Please, implement me!

Implements QUESO::Base1D1DFunction.

Definition at line 690 of file 1D1DFunction.C.

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

691 {
692  double value = 0.;
693 
694  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
695  std::cerr << "In ScalarTimes1D1DFunction::deriv()"
696  << ": requested x (" << domainValue
697  << ") is out of the interval (" << m_minDomainValue
698  << ", " << m_maxDomainValue
699  << ")"
700  << std::endl;
701  }
702 
703  UQ_FATAL_TEST_MACRO(((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)),
705  "ScalarTimes1D1DFunction::deriv()",
706  "x out of range");
707 
708  UQ_FATAL_TEST_MACRO(true,
710  "ScalarTimesFunc1D1DFunction::deriv()",
711  "not implemented yet");
712 
713  return value;
714 }
const int UQ_UNAVAILABLE_RANK
Definition: Defines.h:74
double value(double domainValue) const
Returns the value of the (one-dimensional) function at point domainValue, already multiplied by the s...
Definition: 1D1DFunction.C:680
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
double QUESO::ScalarTimesFunc1D1DFunction::value ( double  domainValue) const
virtual

Returns the value of the (one-dimensional) function at point domainValue, already multiplied by the scalar (given during construction).

This function calls the value() method of the given function and multiplies its return value by the scalar passed to the constructor.

Implements QUESO::Base1D1DFunction.

Definition at line 680 of file 1D1DFunction.C.

References m_func, m_scalar, and QUESO::Base1D1DFunction::value().

Referenced by deriv().

681 {
682  double value = 0.;
683 
684  value += m_scalar*m_func.value(domainValue);
685 
686  return value;
687 }
virtual double value(double domainValue) const =0
Returns the value of the (one-dimensional) function. See template specialization. ...
const Base1D1DFunction & m_func
Definition: 1D1DFunction.h:449
double value(double domainValue) const
Returns the value of the (one-dimensional) function at point domainValue, already multiplied by the s...
Definition: 1D1DFunction.C:680

Member Data Documentation

const Base1D1DFunction& QUESO::ScalarTimesFunc1D1DFunction::m_func
protected

Definition at line 449 of file 1D1DFunction.h.

Referenced by value().

double QUESO::ScalarTimesFunc1D1DFunction::m_scalar
protected

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