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

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

#include <1D1DFunction.h>

Inheritance diagram for QUESO::ScalarTimesFunc1D1DFunction:
QUESO::Base1D1DFunction

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

602  :
603  Base1D1DFunction(func.minDomainValue(),func.maxDomainValue()),
604  m_scalar(scalar),
605  m_func (func)
606 {
607 }
const Base1D1DFunction & m_func
Definition: 1D1DFunction.h:449
Base1D1DFunction(double minDomainValue, double maxDomainValue)
Default constructor.
Definition: 1D1DFunction.C:33
QUESO::ScalarTimesFunc1D1DFunction::~ScalarTimesFunc1D1DFunction ( )

Destructor.

Definition at line 609 of file 1D1DFunction.C.

610 {
611 }

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

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

625 {
626  double value = 0.;
627 
628  if ((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)) {
629  std::cerr << "In ScalarTimes1D1DFunction::deriv()"
630  << ": requested x (" << domainValue
631  << ") is out of the interval (" << m_minDomainValue
632  << ", " << m_maxDomainValue
633  << ")"
634  << std::endl;
635  }
636 
637  queso_require_msg(!((domainValue < m_minDomainValue) || (domainValue > m_maxDomainValue)), "x out of range");
638 
639  queso_not_implemented();
640 
641  return value;
642 }
double value(double domainValue) const
Returns the value of the (one-dimensional) function at point domainValue, already multiplied by the s...
Definition: 1D1DFunction.C:614
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 614 of file 1D1DFunction.C.

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

Referenced by deriv().

615 {
616  double value = 0.;
617 
618  value += m_scalar*m_func.value(domainValue);
619 
620  return value;
621 }
double value(double domainValue) const
Returns the value of the (one-dimensional) function at point domainValue, already multiplied by the s...
Definition: 1D1DFunction.C:614
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

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