25 #include <queso/ExponentialMatrixCovarianceFunction.h>
30 template<
class P_V,
class P_M,
class Q_V,
class Q_M>
43 *
m_env.
subDisplayFile() <<
"Entering ExponentialMatrixCovarianceFunction<P_V,P_M,Q_V,Q_M>::constructor()"
62 *
m_env.
subDisplayFile() <<
"Leaving ExponentialMatrixCovarianceFunction<P_V,P_M,Q_V,Q_M>::constructor()"
68 template<
class P_V,
class P_M,
class Q_V,
class Q_M>
71 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
72 *m_env.subDisplayFile() <<
"Entering ExponentialMatrixCovarianceFunction<P_V,P_M,Q_V,Q_M>::destructor()"
73 <<
": prefix = " << m_prefix
80 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
81 *m_env.subDisplayFile() <<
"Leaving ExponentialMatrixCovarianceFunction<P_V,P_M,Q_V,Q_M>::destructor()"
82 <<
": prefix = " << m_prefix
87 template<
class P_V,
class P_M,
class Q_V,
class Q_M>
91 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
92 *m_env.subDisplayFile() <<
"Entering ExponentialMatrixCovarianceFunction<P_V,P_M,Q_V,Q_M>::covMatrix()"
96 unsigned int matrixOrder = m_imageSet.vectorSpace().dimLocal();
102 double tmpSq = -(domainVector1 - domainVector2).norm2Sq();
104 for (
unsigned int i = 0; i < matrixOrder; ++i) {
105 for (
unsigned int j = 0; j < matrixOrder; ++j) {
106 double tmp = tmpSq/( (*m_sigmas)(i,j) * (*m_sigmas)(i,j) );
107 imageMatrix(i,j) = (*m_as)(i,j) * std::exp(tmp);
111 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
112 *m_env.subDisplayFile() <<
"Leaving ExponentialMatrixCovarianceFunction<P_V,P_M,Q_V,Q_M>::covMatrix()"
unsigned int displayVerbosity() const
const VectorSet< Q_V, Q_M > & m_imageSet
unsigned int dimLocal() const
const BaseEnvironment & m_env
#define queso_require_equal_to_msg(expr1, expr2, msg)
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
virtual ~ExponentialMatrixCovarianceFunction()
Virtual destructor.
void covMatrix(const P_V &domainVector1, const P_V &domainVector2, Q_M &imageMatrix) const
Calculates the covariance matrix, given two parameter domains.
virtual const VectorSpace< V, M > & vectorSpace() const =0
Vector space to which this set belongs to. See template specialization.
ExponentialMatrixCovarianceFunction(const char *prefix, const VectorSet< P_V, P_M > &basicDomainSet, const VectorSet< Q_V, Q_M > &imageSet, const Q_M &sigmas, const Q_M &as)
Default constructor.
A templated (base) class to accommodate covariance matrix of (random) vector functions.