33#ifndef KLDECOMPUNI_H_SEEN
34#define KLDECOMPUNI_H_SEEN
79 void SetWeights(
const double *weights,
const int npts) ;
99 int decompose(
const double *corr,
const int &nKL);
117 void eigenvalues(
const int nEIG,
double *eigs)
const;
123 void KLmodes(
const int npts,
const int nKL,
double *klModes )
const;
1D Array class for any type T
2D Array class for any type T
Stores data of any type T in a 1D array.
Definition Array1D.h:61
Stores data of any type T in a 2D array.
Definition Array2D.h:60
Computes the Karhunen-Loeve decomposition of a univariate stochastic process.
Definition kle.h:50
bool decomposed_
Flag to determine whether KL decomposition has taken place (and consequently that the interal data st...
Definition kle.h:149
int iu_
Upper index of range of eigenvalues requested.
Definition kle.h:173
void Init()
Definition kle.cpp:73
void SetWeights(const Array1D< double > &weights)
Set weights for computing the integral needed for Nystrom's method for solving the Fredholm integral ...
Definition kle.cpp:89
KLDecompUni(const KLDecompUni &)
Dummy default constructor, which should not be used as it is not well defined.
Definition kle.h:145
KLDecompUni()
Definition kle.cpp:65
char eigRange_
Option to set the type of range for eigenvalues.
Definition kle.h:163
Array1D< double > wh_
Array to hold square roots of weights.
Definition kle.h:158
int decompose(const Array2D< double > &corr, const int &nKL)
Perform KL decomposition into nKL modes and return actual number of modes that were obtained.
Definition kle.cpp:121
Array2D< double > whcwh_
Matrix to hold the upper triangular part of the matrix to get eigenvalues of.
Definition kle.h:152
Array1D< int > ifail_
Array to store indices of eigenvectors that failed to converge.
Definition kle.h:185
double vu_
Upper bound for range of eigenvalues.
Definition kle.h:169
double vl_
Lower bound for range of eigenvalues.
Definition kle.h:167
const Array2D< double > & KLmodes() const
Get associated KL modes.
Definition kle.cpp:264
~KLDecompUni()
Destructor.
Definition kle.h:69
char jobz_
Option to determine what to compute (eigenvalues and eigenvectors)
Definition kle.h:161
void truncRealiz(const Array1D< double > &meanrea, const Array2D< double > &xi, const int &nKL, Array2D< double > &trunc_realiz)
Returns the truncated KL sum.
Definition kle.cpp:321
void meanRealiz(const Array2D< double > &realiz, Array1D< double > &mean_realiz)
Calculate (in meanRealiz) the mean realizations.
Definition kle.cpp:300
void KLproject(const Array2D< double > &realiz, Array2D< double > &xi)
Project realizations to the KL modes and store them in xi ( )
Definition kle.cpp:204
double absTol_
Absolute tolerance for convergence.
Definition kle.h:175
const Array1D< double > & eigenvalues() const
Get eigenvalues in descending order.
Definition kle.cpp:232
int eig_info_
info on success of the eigenvector solutions
Definition kle.h:183
char uplo_
Option to indicate how matrix is stored.
Definition kle.h:165
Array1D< double > w_
Array to hold weights for Nystrom's method for Fredholm integral equation solution.
Definition kle.h:155
int il_
Lower index of range of eigenvalues requested.
Definition kle.h:171
Array1D< double > eig_values_
Array to store eigenvalues.
Definition kle.h:178
Array2D< double > KL_modes_
Matrix to store KL modes.
Definition kle.h:180