libfbm
0.3
Simulation of multi-dimensional stationary Gaussian processes and fractional Brownian motion.
|
Abstract stationary Gaussian process context. More...
#include <libfbm.hpp>
Public Member Functions | |
SGPContext (const zvec &fieldDim, const zvec &userDim, const std::string &cacheName) | |
Constructor. | |
virtual | ~SGPContext () |
virtual double | cov (const zvec &p)=0 |
Covariance function. | |
const zvec & | getDim () const |
Get the usable dimension of the generated field. | |
const zvec & | getFieldDim () const |
Get the physical dimension of the generated field. | |
void | setCacheDir (const std::string &cacheDir) |
Set the cache directory. | |
size_t | badEigenCount () const |
Return the number of bad eigenvalues encountered. | |
bool | initCache (bool forceRecalc=false) |
Initialize the cache. |
Protected Member Functions | |
virtual void | postProcess (Field &field, GaussianGenerator &rng) |
Postprocessor called after field generation. | |
void | setScaleResult (double f) |
Scale the output values by factor f. |
Friends | |
class | Field |
Abstract stationary Gaussian process context.
Used by the Field. This class provides random number generation and filesystem based caching. To define your own covariance function, you must create a class that extends this. Word of warning: if you have enabled caching, but change cov(), the results from the old version are loaded. To overcome this you must manually delete the old cache. To overcome this you should incorporate paramters affecting cov() into the constructor's cacheName argument.
Definition at line 630 of file libfbm.hpp.
libfbm::SGPContext::SGPContext | ( | const zvec & | fieldDim, |
const zvec & | userDim, | ||
const std::string & | cacheName | ||
) |
Constructor.
The cacheName is the cache identifier used to distinct between cache files on the HD. So if your extension of this class has some paramters affecting cov(), they should be incorporated into cacheName. It is used in the file system path so must be sane in that regard.
|
virtual |
|
inline |
Return the number of bad eigenvalues encountered.
Definition at line 653 of file libfbm.hpp.
|
pure virtual |
Covariance function.
Implemented in libfbm::PowerLawContext, libfbm::FBMSteinContext, and libfbm::FGNContext.
|
inline |
Get the usable dimension of the generated field.
Definition at line 645 of file libfbm.hpp.
|
inline |
Get the physical dimension of the generated field.
It may be greater than the usable dimension returned by getDim().
Definition at line 647 of file libfbm.hpp.
bool libfbm::SGPContext::initCache | ( | bool | forceRecalc = false | ) |
Initialize the cache.
Either loads from cache (quick) or generates (slow). This is called automatically by Field::generate().
forceRecalc | Force recalculation and rewriting of the cache. |
|
protectedvirtual |
Postprocessor called after field generation.
This is called automatically by Field::generate().
Reimplemented in libfbm::FBMSteinContext, and libfbm::FWSContext.
void libfbm::SGPContext::setCacheDir | ( | const std::string & | cacheDir | ) |
Set the cache directory.
Must be called before construction of Field-s.
|
inlineprotected |
Scale the output values by factor f.
This is assembled into the cached FFT matrix so must be called before initCache or Field::generate(). If you change the value, you must either erase the cache or incorporate it into cacheName.
Definition at line 673 of file libfbm.hpp.
|
friend |
Definition at line 684 of file libfbm.hpp.