![]() |
1.6.0
Geostatistics & Machine Learning toolbox | https://gstlearn.org
|
![]() |
This class describes an elementary covariance. More...
#include <CorAniso.hpp>
This class describes an elementary covariance.
This covariance is described through the following list of parameters:
Public Member Functions | |
CorAniso (const ECov &type, const CovContext &ctxt) | |
CorAniso (const String &symbol, const CovContext &ctxt) | |
CorAniso (const ECov &type, double range, double param, const CovContext &ctxt, bool flagRange=true) | |
CorAniso (const CorAniso &r) | |
CorAniso & | operator= (const CorAniso &r) |
virtual | ~CorAniso () |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable Interface. | |
virtual bool | isConsistent (const ASpace *space) const override |
ASpaceObject Interface. | |
virtual int | getNVariables () const override |
ACov Interface. | |
virtual double | eval (const SpacePoint &p1, const SpacePoint &p2, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const override |
ACov Interface. | |
double | evalCor (const SpacePoint &p1, const SpacePoint &p2, const CovCalcMode *mode=nullptr, int ivar=0, int jvar=0) const |
virtual double | evalCovOnSphere (double alpha, int degree=50, bool flagScaleDistance=true, const CovCalcMode *mode=nullptr) const override |
virtual VectorDouble | evalSpectrumOnSphere (int n, bool flagNormDistance=false, bool flagCumul=false) const override |
virtual double | evalSpectrum (const VectorDouble &freq, int ivar=0, int jvar=0) const override |
virtual double | getIntegralRange (int ndisc, double hmax) const |
virtual String | getFormula () const |
virtual double | getBallRadius () const |
void | optimizationPreProcess (const std::vector< SpacePoint > &p, std::vector< SpacePoint > &p1As) const override |
void | optimizationSetTargetByIndex (int iech, const std::vector< SpacePoint > &p1As, SpacePoint &p2A) const |
void | optimizationPostProcess () const override |
bool | isNoStat () const |
bool | isValidForTurningBand () const |
double | simulateTurningBand (double t0, TurningBandOperate &operTB) const |
bool | isValidForSpectral () const |
MatrixRectangular | simulateSpectralOmega (int nb) const |
void | setContext (const CovContext &ctxt) |
void | setParam (double param) |
void | setNoStatFactor (double noStatFactor) |
void | setRangeIsotropic (double range) |
Practical range. | |
void | setRange (int idim, double range) |
void | setRanges (const VectorDouble &ranges) |
void | setScale (double scale) |
void | setScale (int idim, double scale) |
Make the covariance isotropic. | |
void | setScales (const VectorDouble &scales) |
void | setAnisoRotation (const Rotation &rot) |
void | setAnisoRotation (const VectorDouble &rot) |
void | setAnisoAngles (const VectorDouble &angles) |
void | setAnisoAngle (int idim, double angle) |
void | setRotationAnglesAndRadius (const VectorDouble &angles=VectorDouble(), const VectorDouble &ranges=VectorDouble(), const VectorDouble &scales=VectorDouble()) |
VectorDouble | getRanges () const |
const Rotation & | getAnisoRotation () const |
const VectorDouble & | getScales () const |
void | setType (const ECov &type) |
double | getRange () const |
double | getScale () const |
bool | getFlagAniso () const |
bool | getFlagRotation () const |
double | getRange (int idim) const |
double | getScale (int idim) const |
VectorDouble | getAnisoAngles () const |
const MatrixSquareGeneral & | getAnisoRotMat () const |
const MatrixSquareGeneral & | getAnisoInvMat () const |
VectorDouble | getAnisoCoeffs () const |
double | getAnisoAngles (int idim) const |
double | getAnisoRotMat (int idim, int jdim) const |
double | getAnisoCoeffs (int idim) const |
const ECov & | getType () const |
double | getParam () const |
double | getScadef () const |
double | getParMax () const |
int | getMaxNDim () const |
int | getMinOrder () const |
bool | hasInt1D () const |
bool | hasInt2D () const |
int | hasRange () const |
int | hasParam () const |
String | getCovName () const |
bool | isIsotropic () const |
bool | isAsymptotic () const |
bool | hasRotation () const |
const Tensor & | getAniso () const |
void | setAniso (const Tensor &aniso) |
const ACovFunc * | getCova () const |
int | getGradParamNumber () const |
bool | hasCovDerivative () const |
bool | hasCovOnSphere () const |
bool | hasSpectrumOnSphere () const |
bool | hasMarkovCoeffs () const |
bool | hasSpectrumOnRn () const |
double | normalizeOnSphere (int n=50) const |
void | makeRangeNoStatDb (const String &namecol, int idim=0, const Db *db=nullptr) |
void | makeScaleNoStatDb (const String &namecol, int idim=0, const Db *db=nullptr) |
void | makeAngleNoStatDb (const String &namecol, int idim=0, const Db *db=nullptr) |
void | makeTensorNoStatDb (const String &namecol, int idim=0, int jdim=0, const Db *db=nullptr) |
void | makeParamNoStatDb (const String &namecol, const Db *db=nullptr) |
void | makeRangeNoStatFunctional (const AFunctional *func, int idim=0) |
void | makeScaleNoStatFunctional (const AFunctional *func, int idim=0) |
void | makeAngleNoStatFunctional (const AFunctional *func, int idim=0) |
void | makeTensorNoStatFunctional (const AFunctional *func, int idim=0, int jdim=0) |
void | makeParamNoStatFunctional (const AFunctional *func) |
void | makeRangeStationary (int idim=0) |
void | makeScaleStationary (int idim=0) |
void | makeAngleStationary (int idim=0) |
void | makeTensorStationary (int idim, int jdim) |
void | makeParamStationary () |
int | getNAngles () const |
int | getNRanges () const |
int | getNScales () const |
bool | isNoStatForParam () const |
bool | isNoStatForTensor () const |
bool | isNoStatForAnisotropy () const |
bool | isNoStatForVariance () const |
bool | isNoStatForRotation () const |
VectorDouble | evalCovOnSphereVec (const VectorDouble &alpha, int degree=50, bool flagScaleDistance=false, const CovCalcMode *mode=nullptr) const |
Array | evalCovFFT (const VectorDouble &hmax, int N=128, int ivar=0, int jvar=0) const |
VectorDouble | getMarkovCoeffs () const |
void | setMarkovCoeffs (const VectorDouble &coeffs) |
void | setMarkovCoeffsBySquaredPolynomials (VectorDouble coeffs1, VectorDouble coeffs2, double eps=0) |
void | computeMarkovCoeffs () |
double | getCorrec () const |
double | getFullCorrec () const |
void | nostatUpdate (CovInternal *covint) |
void | informMeshByMeshForAnisotropy (const AMesh *amesh) const |
void | informMeshByApexForAnisotropy (const AMesh *amesh) const |
void | informDbInForAnisotropy (const Db *dbin) const |
void | informDbOutForAnisotropy (const Db *dbout) const |
void | updateCovByPoints (int icas1, int iech1, int icas2, int iech2) override |
Tell if the use of Optimization is enabled or not. | |
void | updateCovByMesh (int imesh, bool aniso=true) override |
double | getValue (const EConsElem &econs, int iv1, int iv2) const override |
void | setOptimEnabled (bool flag) const |
void | computeCorrec () |
double | evalCorFromH (double h, const CovCalcMode *mode) const |
double | getDetTensor () const |
void | updateFromContext () override |
void | initFromContext () override |
void | optimizationSetTarget (const SpacePoint &pt, SpacePoint &p2A) const |
void | optimizationTransformSP (const SpacePoint &ptin, SpacePoint &ptout) const |
String | toStringParams (const AStringFormat *strfmt=nullptr) const |
String | toStringNoStat (const AStringFormat *strfmt=nullptr, int i=0) const |
![]() | |
ACor (const CovContext &ctxt) | |
ACor (const ACor &r) | |
ACor & | operator= (const ACor &r) |
virtual | ~ACor () |
void | setContext (const CovContext &ctxt) |
virtual double | eval0 (int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const |
Calculate the covariance between two variables for 0-distance (stationary case) | |
virtual void | copyCovContext (const CovContext &ctxt) |
virtual int | makeElemNoStat (const EConsElem &econs, int iv1, int iv2, const AFunctional *func=nullptr, const Db *db=nullptr, const String &namecol=String()) |
const CovContext & | getContext () const |
CovContext | getContextCopy () const |
bool | _checkDims (int idim, int jdim) const |
void | attachNoStatDb (const Db *db) |
bool | checkAndManageNoStatDb (const Db *&db, const String &namecol) |
virtual void | makeStationary () |
void | createNoStatTab () |
void | informMeshByMesh (const AMesh *amesh) const |
void | informMeshByApex (const AMesh *amesh) const |
VectorDouble | informCoords (const VectorVectorDouble &coords, const EConsElem &econs, int iv1=0, int iv2=0) const |
void | informDbIn (const Db *dbin) const |
void | informDbOut (const Db *dbout) const |
void | manage (const Db *db1, const Db *db2) const |
int | getDimensionNumber () const |
![]() | |
ASpaceObject (const ASpace *space=nullptr) | |
ASpaceObject (const ASpace &space) | |
ASpaceObject (const ASpaceObject &r) | |
ASpaceObject & | operator= (const ASpaceObject &r) |
virtual | ~ASpaceObject () |
const ASpace * | getSpace () const |
Accessor to the current object space context. | |
bool | isConsistent () const |
Indicate if I am consistent with my current space context. | |
VectorDouble | getUnitaryVector () const |
Return unitary vector for the current space context. | |
unsigned int | getNDim (int ispace=-1) const |
Shortcuts to ASpace methods. | |
const VectorDouble & | getOrigin (int ispace=-1) const |
Return the current space context origin coordinates. | |
double | getDistance (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const |
Return the distance between two space points for the current space context. | |
VectorDouble | getDistances (const SpacePoint &p1, const SpacePoint &p2) const |
Return all the distances (space composits) between two space points for the current space context. | |
VectorDouble | getIncrement (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const |
Return the increment vector between two space points for the current space context. | |
![]() | |
AStringable () | |
AStringable (const AStringable &r) | |
AStringable & | operator= (const AStringable &r) |
virtual | ~AStringable () |
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
virtual void | display (int level) const final |
![]() | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
Static Public Member Functions | |
static bool | isOptimizationInitialized (const std::vector< SpacePoint > &p1As, const Db *db=nullptr) |
static CorAniso * | createIsotropic (const CovContext &ctxt, const ECov &type, double range, double param=1., bool flagRange=true) |
static CorAniso * | createAnisotropic (const CovContext &ctxt, const ECov &type, const VectorDouble &ranges, double param=1., const VectorDouble &angles=VectorDouble(), bool flagRange=true) |
static CorAniso * | createIsotropicMulti (const CovContext &ctxt, const ECov &type, double range, double param=1., bool flagRange=true) |
static CorAniso * | createAnisotropicMulti (const CovContext &ctxt, const ECov &type, const VectorDouble &ranges, double param=1., const VectorDouble &angles=VectorDouble(), bool flagRange=true) |
CorAniso::CorAniso | ( | const ECov & | type, |
const CovContext & | ctxt | ||
) |
CorAniso::CorAniso | ( | const String & | symbol, |
const CovContext & | ctxt | ||
) |
CorAniso::CorAniso | ( | const ECov & | type, |
double | range, | ||
double | param, | ||
const CovContext & | ctxt, | ||
bool | flagRange = true |
||
) |
CorAniso::CorAniso | ( | const CorAniso & | r | ) |
|
virtual |
void CorAniso::computeCorrec | ( | ) |
void CorAniso::computeMarkovCoeffs | ( | ) |
|
static |
|
static |
|
static |
|
static |
|
overridevirtual |
double CorAniso::evalCor | ( | const SpacePoint & | p1, |
const SpacePoint & | p2, | ||
const CovCalcMode * | mode = nullptr , |
||
int | ivar = 0 , |
||
int | jvar = 0 |
||
) | const |
double CorAniso::evalCorFromH | ( | double | h, |
const CovCalcMode * | mode | ||
) | const |
Calculate the value of the covariance from the distance between bi-points This distance has been calculated beforehand (possibly using anisotropy)
h | Input distance |
mode | Pointer to CovCalcMode structure (optional) |
Array CorAniso::evalCovFFT | ( | const VectorDouble & | hmax, |
int | N = 128 , |
||
int | ivar = 0 , |
||
int | jvar = 0 |
||
) | const |
|
overridevirtual |
Reimplemented from ACor.
VectorDouble CorAniso::evalCovOnSphereVec | ( | const VectorDouble & | alpha, |
int | degree = 50 , |
||
bool | flagScaleDistance = false , |
||
const CovCalcMode * | mode = nullptr |
||
) | const |
|
overridevirtual |
Reimplemented from ACor.
|
overridevirtual |
Reimplemented from ACor.
|
inline |
|
inline |
|
inline |
VectorDouble CorAniso::getAnisoCoeffs | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
double CorAniso::getCorrec | ( | ) | const |
|
inline |
|
inline |
double CorAniso::getDetTensor | ( | ) | const |
|
inline |
|
inline |
|
inlinevirtual |
double CorAniso::getFullCorrec | ( | ) | const |
int CorAniso::getGradParamNumber | ( | ) | const |
|
virtual |
Calculate the Integral Range in various Space Dimension (1, 2 or 3)
VectorDouble CorAniso::getMarkovCoeffs | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverridevirtual |
double CorAniso::getParam | ( | ) | const |
For compatibility, this function returns 0 if the Covariance has no Third Parameter
|
inline |
double CorAniso::getRange | ( | ) | const |
This function returns the range in the isotropic case In the anisotropic case, it returns the largest range over all directions
|
inline |
VectorDouble CorAniso::getRanges | ( | ) | const |
|
inline |
double CorAniso::getScale | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Reimplemented from ACor.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void CorAniso::informDbInForAnisotropy | ( | const Db * | dbin | ) | const |
void CorAniso::informDbOutForAnisotropy | ( | const Db * | dbout | ) | const |
void CorAniso::informMeshByApexForAnisotropy | ( | const AMesh * | amesh | ) | const |
void CorAniso::informMeshByMeshForAnisotropy | ( | const AMesh * | amesh | ) | const |
|
overridevirtual |
Reimplemented from ACor.
|
inline |
|
overridevirtual |
ASpaceObject Interface.
Implements ASpaceObject.
|
inline |
bool CorAniso::isNoStat | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Checks that the Optimization has already been initiated, by:
bool CorAniso::isValidForSpectral | ( | ) | const |
bool CorAniso::isValidForTurningBand | ( | ) | const |
void CorAniso::makeAngleNoStatFunctional | ( | const AFunctional * | func, |
int | idim = 0 |
||
) |
void CorAniso::makeAngleStationary | ( | int | idim = 0 | ) |
void CorAniso::makeParamNoStatFunctional | ( | const AFunctional * | func | ) |
void CorAniso::makeParamStationary | ( | ) |
void CorAniso::makeRangeNoStatFunctional | ( | const AFunctional * | func, |
int | idim = 0 |
||
) |
void CorAniso::makeRangeStationary | ( | int | idim = 0 | ) |
void CorAniso::makeScaleNoStatFunctional | ( | const AFunctional * | func, |
int | idim = 0 |
||
) |
void CorAniso::makeScaleStationary | ( | int | idim = 0 | ) |
void CorAniso::makeTensorNoStatDb | ( | const String & | namecol, |
int | idim = 0 , |
||
int | jdim = 0 , |
||
const Db * | db = nullptr |
||
) |
void CorAniso::makeTensorNoStatFunctional | ( | const AFunctional * | func, |
int | idim = 0 , |
||
int | jdim = 0 |
||
) |
void CorAniso::makeTensorStationary | ( | int | idim, |
int | jdim | ||
) |
double CorAniso::normalizeOnSphere | ( | int | n = 50 | ) | const |
void CorAniso::nostatUpdate | ( | CovInternal * | covint | ) |
Update the Model in the case of Non-stationary parameters This requires the knowledge of the two end-points
[in] | covint | Internal structure for non-stationarity or NULL (for stationary case) |
|
overridevirtual |
Reimplemented from ACor.
|
overridevirtual |
Transform a set of Space Points using the anisotropy tensor The set of resulting Space Points are stored as private member of this. Note that ALL samples are processed, independently from the presence of a selection or checking for heterotopy.
p | Vector of SpacePoints |
p1As | Vector of SpacePoints after projection |
Reimplemented from ACor.
void CorAniso::optimizationSetTarget | ( | const SpacePoint & | pt, |
SpacePoint & | p2A | ||
) | const |
Define the second Space Point by transforming the input Space Point 'pt' on the basis of the current covariance
pt | Target sample provided as a Space Point |
p2A | Space Point after projection |
void CorAniso::optimizationSetTargetByIndex | ( | int | iech, |
const std::vector< SpacePoint > & | p1As, | ||
SpacePoint & | p2A | ||
) | const |
Define the Second Space Point as coinciding with the Input Space Point 'iech'. Note that, as the Input Space Points are already transformed in the basis of the current structure, it is just an assignment.
iech | Rank of the sample among the recorded Space Points |
p1As | Vector of Space Points after projection (Data points) |
p2A | Space Point for Target |
void CorAniso::optimizationTransformSP | ( | const SpacePoint & | ptin, |
SpacePoint & | ptout | ||
) | const |
Transform a space point using the anisotropy tensor
ptin | Input Space Point |
ptout | Output Space Point |
|
inline |
void CorAniso::setAnisoAngle | ( | int | idim, |
double | angle | ||
) |
void CorAniso::setAnisoAngles | ( | const VectorDouble & | angles | ) |
void CorAniso::setAnisoRotation | ( | const Rotation & | rot | ) |
void CorAniso::setAnisoRotation | ( | const VectorDouble & | rot | ) |
void CorAniso::setContext | ( | const CovContext & | ctxt | ) |
void CorAniso::setMarkovCoeffs | ( | const VectorDouble & | coeffs | ) |
void CorAniso::setMarkovCoeffsBySquaredPolynomials | ( | VectorDouble | coeffs1, |
VectorDouble | coeffs2, | ||
double | eps = 0 |
||
) |
|
inline |
|
inline |
void CorAniso::setParam | ( | double | param | ) |
void CorAniso::setRange | ( | int | idim, |
double | range | ||
) |
void CorAniso::setRangeIsotropic | ( | double | range | ) |
Practical range.
void CorAniso::setRanges | ( | const VectorDouble & | ranges | ) |
void CorAniso::setRotationAnglesAndRadius | ( | const VectorDouble & | angles = VectorDouble() , |
const VectorDouble & | ranges = VectorDouble() , |
||
const VectorDouble & | scales = VectorDouble() |
||
) |
void CorAniso::setScale | ( | double | scale | ) |
void CorAniso::setScale | ( | int | idim, |
double | scale | ||
) |
Make the covariance isotropic.
void CorAniso::setScales | ( | const VectorDouble & | scales | ) |
void CorAniso::setType | ( | const ECov & | type | ) |
MatrixRectangular CorAniso::simulateSpectralOmega | ( | int | nb | ) | const |
double CorAniso::simulateTurningBand | ( | double | t0, |
TurningBandOperate & | operTB | ||
) | const |
|
overridevirtual |
String CorAniso::toStringNoStat | ( | const AStringFormat * | strfmt = nullptr , |
int | i = 0 |
||
) | const |
String CorAniso::toStringParams | ( | const AStringFormat * | strfmt = nullptr | ) | const |
|
overridevirtual |
Reimplemented from ACor.
|
overridevirtual |
Tell if the use of Optimization is enabled or not.
Update the Model according to the Non-stationary parameters
icas1 | Type of first Db: 1 for Input; 2 for Output |
iech1 | Rank of the target within Db1 (or -1) |
icas2 | Type of first Db: 1 for Input; 2 for Output |
iech2 | Rank of the target within Dbout (or -2) |
Reimplemented from ACor.
|
overridevirtual |
Reimplemented from ACor.