queso-0.57.1
|
Class for one-dimensional sampled functions. More...
#include <1D1DFunction.h>
Public Member Functions | |
Constructor/Destructor methods | |
Sampled1D1DFunction () | |
Default constructor. It should not be called by the user. More... | |
Sampled1D1DFunction (const std::vector< double > &domainValues, const std::vector< double > &imageValues) | |
Constructor. More... | |
virtual | ~Sampled1D1DFunction () |
Destructor. More... | |
Mathematical methods | |
virtual double | value (double domainValue) const |
Returns the value of the sampled function at point domainValue . More... | |
double | deriv (double domainValue) const |
Bogus: Derivative of the function. More... | |
const std::vector< double > & | domainValues () const |
Array of the domain values (values of the independent variable). More... | |
const std::vector< double > & | imageValues () const |
Array of the image values (values of the dependent variable). More... | |
bool | domainValueMatchesExactly (double domainValue) const |
Checks whether the domain value domainValue matches exactly one of the values in the function domain domainValues() . More... | |
void | set (const std::vector< double > &domainValues, const std::vector< double > &imageValues) |
Sets the values of the independent (domainValues ) and dependent (imageValues ) variables of this sampled function. More... | |
I/O methods | |
virtual void | printForMatlab (const BaseEnvironment &env, std::ofstream &ofsvar, const std::string &prefixName) const |
Prints the values of the function in Matlab/Octave format. 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 | |
std::vector< double > | m_domainValues |
Array of the values in the domain of the function (values of the independent variable). More... | |
std::vector< double > | m_imageValues |
Array of the values in the image of the function (values of the dependent variable). More... | |
Protected Attributes inherited from QUESO::Base1D1DFunction | |
double | m_minDomainValue |
double | m_maxDomainValue |
Class for one-dimensional sampled functions.
This class implements sampled one-dimensional functions. A sample function is one whose values are known only at discrete values of the independent variable; i.e., its values are only known at grid points. There are several QUESO classes which handle grids, all derived from BaseOneDGrid. Sampled functions are usually defined by arrays.
Definition at line 347 of file 1D1DFunction.h.
QUESO::Sampled1D1DFunction::Sampled1D1DFunction | ( | ) |
Default constructor. It should not be called by the user.
Definition at line 427 of file 1D1DFunction.C.
QUESO::Sampled1D1DFunction::Sampled1D1DFunction | ( | const std::vector< double > & | domainValues, |
const std::vector< double > & | imageValues | ||
) |
Constructor.
When calling this constructor, the user provides the values of the independent variable (domainValues
) and their respective values in the image set (independent variable, imageValue
)
Definition at line 437 of file 1D1DFunction.C.
References m_domainValues, and m_imageValues.
|
virtual |
|
virtual |
Bogus: Derivative of the function.
Derivatives are not defined over sampled functions! Thus, this function simply checks if point domainValue
belongs to the domain of this
function, and in affirmative case, it returns 0.
Implements QUESO::Base1D1DFunction.
Definition at line 505 of file 1D1DFunction.C.
References QUESO::Base1D1DFunction::m_maxDomainValue, and QUESO::Base1D1DFunction::m_minDomainValue.
bool QUESO::Sampled1D1DFunction::domainValueMatchesExactly | ( | double | domainValue | ) | const |
Checks whether the domain value domainValue
matches exactly one of the values in the function domain domainValues()
.
Definition at line 535 of file 1D1DFunction.C.
References m_domainValues.
const std::vector< double > & QUESO::Sampled1D1DFunction::domainValues | ( | ) | const |
Array of the domain values (values of the independent variable).
Definition at line 523 of file 1D1DFunction.C.
References m_domainValues.
const std::vector< double > & QUESO::Sampled1D1DFunction::imageValues | ( | ) | const |
Array of the image values (values of the dependent variable).
Definition at line 529 of file 1D1DFunction.C.
References m_imageValues.
|
virtual |
Prints the values of the function in Matlab/Octave format.
Definition at line 573 of file 1D1DFunction.C.
References m_domainValues, m_imageValues, and QUESO::BaseEnvironment::subIdString().
void QUESO::Sampled1D1DFunction::set | ( | const std::vector< double > & | domainValues, |
const std::vector< double > & | imageValues | ||
) |
Sets the values of the independent (domainValues
) and dependent (imageValues
) variables of this sampled function.
Definition at line 551 of file 1D1DFunction.C.
References m_domainValues, m_imageValues, QUESO::Base1D1DFunction::m_maxDomainValue, and QUESO::Base1D1DFunction::m_minDomainValue.
|
virtual |
Returns the value of the sampled function at point domainValue
.
This function checks if point domainValue
belongs to the domain of this
function, and in affirmative case, it looks for the image value associated to the domain value passed to the function. If there isn't any, it calculates a linear approximation for the image value of domainValue
, considering its neighbors points in the domain.
Implements QUESO::Base1D1DFunction.
Definition at line 457 of file 1D1DFunction.C.
References m_domainValues, m_imageValues, QUESO::Base1D1DFunction::m_maxDomainValue, QUESO::Base1D1DFunction::m_minDomainValue, and QUESO::queso_require_not_equal_to_msg.
|
protected |
Array of the values in the domain of the function (values of the independent variable).
Definition at line 404 of file 1D1DFunction.h.
Referenced by domainValueMatchesExactly(), domainValues(), printForMatlab(), Sampled1D1DFunction(), set(), and value().
|
protected |
Array of the values in the image of the function (values of the dependent variable).
Definition at line 407 of file 1D1DFunction.h.
Referenced by imageValues(), printForMatlab(), Sampled1D1DFunction(), set(), and value().