1.8.0
CCC
 
Loading...
Searching...
No Matches
gstlrn Namespace Reference

Shift Operator for performing the basic tasks of SPDE. More...

Namespaces

namespace  SerializeNeutralFile
 

Classes

class  AAnam
 
class  AArray
 
class  ABiTargetCheck
 
class  ACalcDbToDb
 
class  ACalcDbVarCreator
 
class  ACalcInterpolator
 
class  ACalcSimulation
 
class  ACalculator
 
class  ACholesky
 
class  ACov
 Class containing the Covariance part of the Model. More...
 
class  ACovFunc
 
class  ACovFuncWithAutoDiff
 
class  ACovGradient
 
class  ADrift
 This class describes one basic Drift Function. More...
 
class  AEnum
 
class  AException
 
class  AFunction
 
class  AFunctional
 
class  AGibbs
 
class  ALikelihood
 
class  ALinearOp
 
class  ALinearOpEigenCG
 
class  ALinearOpMulti
 
class  AMatrix
 TODO : Transform into template for storing something else than double. More...
 
class  AMesh
 
class  AModelFitSills
 Class which, starting from experimental quantities, enables fitting the sills of all Covariance parts of a Model. More...
 
class  AModelOptim
 
class  AModelOptimFactory
 
class  AnamContinuous
 
class  AnamContinuousFit
 
class  AnamDiscrete
 
class  AnamDiscreteDD
 
class  AnamDiscreteIR
 
class  AnamEmpirical
 
class  AnamHermite
 
class  AnamUser
 
class  ANeigh
 Class to define the a subset of an input Data Base ('Db') called a Neighborhood. This Neighborhood feature is invoked when the geostatistical processing cannot handle the whole data set (usually due to core limitations) and requires a fine selection of the most suitable part of the data set. More...
 
class  ANoStat
 
class  AOF
 
class  APolynomial
 
class  argClass
 
class  Array
 
class  ASerializable
 
class  AShape
 
class  AShiftOp
 
class  ASimulable
 
class  ASimulableEigenCG
 This class extends ASimulable to make it working with Eigen conjugate gradient algorithm. More...
 
class  ASpace
 Base classe for space definitions. More...
 
class  ASpaceObject
 
class  ASpaceShape
 
class  ASPDEOp
 
class  AStringable
 
class  AStringFormat
 
class  AVario
 
class  Ball
 
class  BImage
 
class  BImageStringFormat
 
struct  binaryFileHeader
 
class  BiTargetCheckBench
 
class  BiTargetCheckCell
 
class  BiTargetCheckCode
 
class  BiTargetCheckDate
 
class  BiTargetCheckDistance
 
class  BiTargetCheckFaults
 
class  BiTargetCheckGeometry
 
class  BooleanObject
 
class  CalcAnamTransform
 
class  CalcGlobal
 
class  CalcGridToGrid
 
class  CalcImage
 
class  CalcKriging
 
class  CalcKrigingFactors
 
class  CalcKrigingSimpleCase
 
class  CalcMigrate
 
class  CalcSimpleInterpolation
 
class  CalcSimuEden
 
class  CalcSimuFFT
 
class  CalcSimuPartition
 
class  CalcSimuPost
 
class  CalcSimuPostDemo
 
class  CalcSimuPostPropByLayer
 
class  CalcSimuRefine
 
class  CalcSimuSubstitution
 
class  CalcSimuTurningBands
 
class  CalcStatistics
 
class  CGParam
 
class  Cheb_Elem
 
class  Chebychev
 
class  CholeskyDense
 
class  CholeskySparse
 
class  ClassicalPolynomial
 
class  Cone
 
class  ConsItem
 
class  Constraints
 
class  Convolution
 
class  CorAniso
 This class describes an elementary covariance. More...
 
class  CorGneiting
 This class describes the Gneiting correlation function. More...
 
class  CorMatern
 This class describes the Gneiting correlation function. More...
 
class  CovAniso
 This class describes an elementary covariance. More...
 
class  CovAnisoList
 This class describes the Covariance as a list of elementary covariances (see CovAniso.hpp for more details) where the calculation rule is simple: the returned value is the sum of each elementary (active) covariance function. More...
 
class  CovBase
 
class  CovBesselJ
 
class  CovCalcMode
 
class  CovCauchy
 
class  CovContext
 
class  CovCosExp
 
class  CovCosinus
 
class  CovCubic
 
class  CovDiffusionAdvection
 
class  CovExponential
 
class  CovFactory
 
class  CovGamma
 
class  CovGaussian
 
class  CovGC1
 
class  CovGC3
 
class  CovGC5
 
class  CovGCspline
 
class  CovGCspline2
 
class  CovGeometric
 
class  CovGradientFunctional
 
class  CovGradientGeneric
 This class describes the Covariance to be used when processing Data and its gradient components. This covariance is based on the initial covariance of the Data and derives the simple and cross covariances of its gradient components. It uses Numerical Derivation and therefore is suitable whatever the type of covariance used for the Data variable. More...
 
class  CovGradientNumerical
 
class  CovHelper
 
class  CovInternal
 
class  CovLinear
 
class  CovLinearSph
 
class  CovList
 This class describes the Covariance as a list of elementary covariances (see CovBase.hpp for more details) where the calculation rule is simple: the returned value is the sum of each elementary (active) covariance function. More...
 
class  CovLMCAnamorphosis
 
class  CovLMCConvolution
 
class  CovLMCTapering
 
class  CovLMGradient
 
class  CovMarkov
 
class  CovMatern
 
class  CovNugget
 
class  CovParamId
 
class  CovPenta
 
class  CovPoisson
 
class  CovPower
 
class  CovProportional
 
class  CovReg1D
 
class  CovSincard
 
class  CovSpherical
 
class  CovStable
 
class  CovStorkey
 
class  CovTriangle
 
class  CovWendland0
 
class  CovWendland1
 
class  CovWendland2
 
class  CSVformat
 
struct  CTables
 
class  Cylinder
 
class  Db
 Class containing the Data Information. More...
 
class  DbGraphO
 Class containing the Data Information organized as a Oriented Graph. More...
 
class  DbGrid
 Class containing the Data Information organized as a Regular Grid. More...
 
class  DbH
 
class  DbHelper
 
class  DbLine
 Class containing the Data Information organized as a set of Lines. More...
 
class  DbMeshStandard
 Class containing the Data Information organized as a General Meshing. More...
 
class  DbMeshTurbo
 Class containing the Data Information organized as a Turbo Meshing. More...
 
class  DbStringFormat
 
class  dec_separator
 
struct  Def_Convolution
 
struct  Def_Locator
 
struct  Def_Tapering
 
struct  DerivCache
 
struct  DimLoop
 
class  DirParam
 Class containing the definition of a Direction used for the calculation of the experimental Spatial Characteristics as calculated experimentally from the data (contained in a Db). This class corresponds to one item of the list of criteria stored in VarioParam and use for the calculation of Vario. More...
 
struct  Disc_Structure
 
class  DriftF
 
class  DriftFactory
 
class  DriftList
 This class provides the information on Drift part of the Model. The drift plays the role of the average of the target Random Function which may be constant or vary as a function with low frequency variations (by opposition to the complementary part of the Spatial Characteristics which is described by its Covariance) More...
 
class  DriftM
 
class  ElemNostat
 
class  Faults
 
class  FileLAS
 
class  FileVTK
 
class  FracDesc
 
class  FracEnviron
 
class  FracFamily
 
class  FracFault
 
class  FracList
 
class  FunctionalSpirale
 
class  GaussianProcess
 
class  GeometryHelper
 
class  GH
 
class  GibbsFactory
 
class  GibbsMMulti
 
class  GibbsMulti
 
class  GibbsMultiMono
 
class  GibbsUMulti
 
class  GibbsUMultiMono
 
class  GibbsUPropMono
 
class  Global_Result
 
class  GlobalEnvironment
 
class  Grid
 
class  GridArcGis
 
class  GridBmp
 
class  GridEclipse
 
class  GridF2G
 
class  GridIfpEn
 
class  GridIrap
 
class  GridXYZ
 
class  GridZycor
 
class  HessianOp
 
class  ICloneable
 
class  Indirection
 
class  Interval
 
class  InvNuggetOp
 
class  IOptimCost
 
class  IProj
 
class  ISkinFunctions
 
struct  Keypair
 
class  KNN
 
class  Koption
 
class  KrigingAlgebra
 Perform the Algebra for Kriging and CoKriging. More...
 
class  KrigingAlgebraSimpleCase
 
class  KrigingSystem
 
class  KrigingSystemSimpleCase
 
class  KrigOpt
 
class  Krigtest_Res
 
class  Likelihood
 
class  Limits
 
class  ListParams
 
struct  LMlayers
 
struct  Local_Relem
 
struct  Local_Split
 
class  LocalSkin
 
class  LogStats
 
class  LowerTriangularRange
 
class  MatchPattern
 
class  MatrixDense
 
class  MatrixFactory
 
class  MatrixInt
 
class  MatrixSparse
 
class  MatrixSquare
 
class  MatrixSymmetric
 
class  MatrixSymmetricSim
 
class  MatrixT
 
class  MeshEStandard
 
class  MeshETurbo
 
class  MeshSpherical
 
class  MeshSphericalExt
 
class  Model
 Class containing the Model Information describing the formal Spatial (or Temporal) Characteristics of the (set of) random variable(s) under study. More...
 
class  ModelBoolean
 
class  ModelCovList
 Class containing the ModelCovList Information describing the formal Spatial (or Temporal) Characteristics of the (set of) random variable(s) under study. More...
 
class  ModelFitSillsVario
 Class which, starting from an experimental variogram, enables fitting the sills of all Covariance parts of a Model. More...
 
class  ModelFitSillsVMap
 Class which, starting from an experimental variogram, enables fitting the sills of all Covariance parts of a Model. More...
 
class  ModelGeneric
 Class containing the Model Information describing the formal Spatial (or Temporal) Characteristics of the (set of) random variable(s) under study. More...
 
class  ModelOptimParam
 
class  ModelOptimVario
 Class which, starting from an experimental variogram, enables fitting the various parameters of a Covariance part of a Model. More...
 
class  ModelOptimVMap
 Class which, starting from an experimental variogram, enables fitting the various parameters of a Covariance part of a Model. More...
 
struct  Modif_Categorical
 
class  NamingConvention
 
class  NeighBench
 Neighborhood definition by Bench. More...
 
class  NeighCell
 Neighborhood definition by Cell. More...
 
class  NeighImage
 Image Neighborhood definition. More...
 
class  NeighMoving
 Moving Neighborhood definition. More...
 
class  NeighUnique
 Unique Neighborhood definition. More...
 
class  NF_Triplet
 
class  Node
 
class  NoStatArray
 
class  NoStatFunctional
 
class  OptCst
 
class  OptCustom
 
class  OptDbg
 
class  Optim
 
class  OptimCostBinary
 
class  OptimCostColored
 
class  Option_AutoFit
 
class  Option_VarioFit
 
class  ParamId
 
struct  ParamIdEqual
 
struct  ParamIdHash
 
class  ParamInfo
 Definition of the generic parameter. More...
 
class  PCA
 
class  PCAStringFormat
 
class  Pencil
 
class  Plane
 
class  PolyElem
 
class  Polygons
 
class  PolyLine2D
 
struct  PolyPoint2D
 
class  PPMT
 
class  PrecisionOp
 
class  PrecisionOpMatrix
 
class  PrecisionOpMulti
 
class  PrecisionOpMultiConditional
 
class  PrecisionOpMultiMatrix
 
class  ProjComposition
 
class  ProjConvolution
 
class  Projection
 
class  ProjMatrix
 
class  ProjMulti
 
class  ProjMultiMatrix
 
class  ProjZero
 
class  PropDef
 
struct  Props
 
class  PtrGeos
 
struct  QSimu
 
class  RankHandler
 Class returning the list of sample IDs for a quick search within a Db. More...
 
struct  RefPt
 
struct  RefStats
 
struct  Reg_Coor
 
class  Regression
 
class  Rotation
 TODO : public ASpaceObject. More...
 
class  Rule
 
class  RuleProp
 
class  RuleShadow
 
class  RuleShift
 
class  RuleStringFormat
 
class  ScaleOp
 
struct  SegYArg
 
class  Selectivity
 
class  ShapeEllipsoid
 
class  ShapeHalfEllipsoid
 
class  ShapeHalfParaboloid
 
class  ShapeHalfSinusoid
 
class  ShapeParaboloid
 
class  ShapeParallelepiped
 
class  ShapeParameter
 
class  ShiftOpMatrix
 
class  ShiftOpStencil
 This is an implementation of ShiftOp dedicated to case where: More...
 
class  SimuBoolean
 Class for performing Boolean simulation. More...
 
class  SimuBooleanParam
 
class  SimuFFTParam
 
class  SimuPartitionParam
 
class  SimuRefineParam
 
class  SimuSpectral
 
class  SimuSpherical
 
class  SimuSphericalParam
 
class  SimuSubstitutionParam
 
class  Skin
 
class  SpaceComposite
 
class  SpacePoint
 
class  SpaceRN
 
class  SpaceSN
 
class  SpaceTarget
 
class  SpatialIndices
 
class  SPDE
 
struct  SPDE_Matelem
 
struct  SPDE_Option
 
struct  SPDE_SS_Option
 
class  SPDEOp
 
class  SPDEOpMatrix
 
class  SPDEParam
 Definition of the parameters used within SPDE. More...
 
class  SphTriangle
 
class  Spill_Res
 
struct  SPIMG
 
struct  spSim
 
struct  ST_Seismic_Neigh
 
struct  Stack
 
struct  StatResults
 
class  StdoutRedirect
 
struct  StrMod
 
class  Style
 The Style class contains all the recommended styles considerations. It has no special functionalities.
This is only a template class that developers can mimic. More...
 
struct  SubPlan
 
struct  SubPlanes
 
struct  t_btree
 
struct  t_nheap
 
struct  t_nodedata
 
class  Table
 
class  TabNoStat
 
class  TabNoStatCovAniso
 
class  TabNoStatSills
 
class  Tapering
 
class  Tensor
 TODO : public ASpaceObject. More...
 
class  TestInheritance
 
class  Timer
 
struct  traceHead
 
struct  TripletND
 
class  TurboOptimizer
 Turbo Optimizer for a specific 2-D environment,. More...
 
class  TurningBandDirection
 
class  TurningBandOperate
 
class  Vario
 Class containing the Spatial Characteristics as calculated experimentally from the data (contained in a Db). More...
 
struct  Vario_Order
 
class  VarioParam
 Class containing the definition of the criteria for calculating the Spatial (and Temporal) Characteristics from samples contained in a Db. More...
 
class  VCloud
 Class containing the Variogram Cloud which uses an DbGrid provided by the user This function simply calculate and add the results as new field in this DbGrid. More...
 
class  Vecchia
 
class  VectorHelper
 
class  VectorNumT
 
class  VectorT
 
class  VH
 
class  VMap
 Class containing the Variogram Map which uses an DbGrid provided by the user This function simply calculate and add the results as new field in this DbGrid. More...
 

Typedefs

using DataFrame = std::map< std::string, std::vector< double > >
 
typedef std::chrono::high_resolution_clock hrc
 
typedef std::chrono::milliseconds ms
 
typedef std::chrono::duration< double > sec
 
typedef double(* operate_function) (double)
 
typedef VectorT< UCharVectorBool
 
typedef VectorT< StringVectorString
 
typedef std::function< double(const SpacePoint &, const SpacePoint &, Id, Id, const CovCalcMode *calcmode)> covmaptype
 
typedef std::unordered_map< ParamId, std::shared_ptr< ANoStat >, ParamIdHash, ParamIdEqualmapNoStat
 
typedef struct Local_Relem Relem
 
typedef struct Local_Split Split
 
typedef std::string String
 
typedef unsigned char UChar
 
using Id = long
 Main type for gstlearn 64-bits integers, to be used in priority when an integer is needed.
 
using I32 = int
 Secondary integer type. To be used instead of "int". No "int" should be voluntarily introduced in gstlearn.
 
typedef std::span< double > vect
 
using constvectint = std::span< const Id >
 
using vectint = std::span< Id >
 
using Sp = Eigen::SparseMatrix< double >
 
typedef Eigen::SparseMatrix< double >::StorageIndex StorageIndex
 
typedef std::vector< const AMesh * > VectorMeshes
 
typedef std::vector< ECov > VectorECov
 
typedef std::shared_ptr< const ASpaceASpaceSharedPtr
 
typedef std::vector< ASpaceSharedPtrASpaceSharedPtrVector
 

Enumerations

enum  opt_algorithm { LBFGS = 11 , TNEWTON = 15 , NELDERMEAD = 28 }
 
enum  ENUM_TYPES {
  TYPE_DB = 0 , TYPE_VARIO = 1 , TYPE_MODEL = 2 , TYPE_NEIGH = 3 ,
  TYPE_RULE = 4 , TYPE_ANAM = 5 , TYPE_TOKENS = 6 , TYPE_POLYGON = 7 ,
  TYPE_FRACTURE = 8 , TYPE_PCA = 9
}
 
enum  ENUM_CSTS {
  CST_NTCAR = 0 , CST_NTDEC = 1 , CST_NTROW = 2 , CST_NTCOL = 3 ,
  CST_NPROC = 4 , CST_LOCMOD = 5 , CST_LOCNEW = 6 , CST_RGL = 7 ,
  CST_ASP = 8 , CST_TOLINV = 9 , CST_TOLGEN = 10 , CST_EPSMAT = 11 ,
  CST_EPSSVD = 12 , CST_NUMBER = 13
}
 
enum  ENUM_CONVS { CONV_UNIFORM = 1 , CONV_EXPONENTIAL = 2 , CONV_GAUSSIAN = 3 , CONV_SINCARD = 4 }
 
enum  ENUM_CONVDIRS {
  CONV_DIRX = 1 , CONV_DIRY = 2 , CONV_DIRZ = 3 , CONV_DIRXY = 4 ,
  CONV_DIRXYZ = 5
}
 
enum  ENUM_SHADOWS { SHADOW_IDLE = 0 , SHADOW_ISLAND = 1 , SHADOW_WATER = 2 , SHADOW_SHADOW = 3 }
 
enum  ENUM_SEISMICS {
  SEISMIC_NOP = 0 , SEISMIC_FABS = 1 , SEISMIC_SSQRT = 2 , SEISMIC_SQR = 3 ,
  SEISMIC_SSQR = 4 , SEISMIC_SIGN = 5 , SEISMIC_EXP = 6 , SEISMIC_SLOG = 7 ,
  SEISMIC_SLOG10 = 8 , SEISMIC_COS = 9 , SEISMIC_SIN = 10 , SEISMIC_TAN = 11 ,
  SEISMIC_COSH = 12 , SEISMIC_SINH = 13 , SEISMIC_TANH = 14 , SEISMIC_NORM = 15 ,
  SEISMIC_DB = 16 , SEISMIC_NEG = 17 , SEISMIC_ONLY_POS = 18 , SEISMIC_ONLY_NEG = 19 ,
  SEISMIC_SUM = 20 , SEISMIC_DIFF = 21 , SEISMIC_REFL = 22 , SEISMIC_MOD_2PI = 23 ,
  SEISMIC_INV = 24 , SEISMIC_AVG = 25
}
 
enum  ENUM_WAVELETS {
  WAVELET_NONE = 0 , WAVELET_RICKER1 = 1 , WAVELET_RICKER2 = 2 , WAVELET_AKB = 3 ,
  WAVELET_SPIKE = 4 , WAVELET_UNIT = 5
}
 
enum  ENUM_ANAM_QT {
  ANAM_QT_Z = 0 , ANAM_QT_T = 1 , ANAM_QT_Q = 2 , ANAM_QT_B = 3 ,
  ANAM_QT_M = 4 , ANAM_QT_PROBA = 5 , ANAM_QT_QUANT = 6 , ANAM_N_QT = 7
}
 
enum  ENUM_SEGY {
  SEGY_NUM = 0 , SEGY_ILINE = 1 , SEGY_XLINE = 2 , SEGY_XTRACE = 3 ,
  SEGY_YTRACE = 4 , SEGY_ZMIN = 5 , SEGY_ZMAX = 6 , SEGY_VMIN = 7 ,
  SEGY_VMAX = 8 , SEGY_THICK = 9 , SEGY_NB = 10 , SEGY_AUXTOP = 11 ,
  SEGY_AUXBOT = 12 , SEGY_COUNT = 13
}
 
enum  charTypeT { other , alpha , digit }
 

Functions

Id DisjunctiveKriging (Db *db, AAnam *anam, Selectivity *selectivity, const VectorString &name_est, const VectorString &name_std, const NamingConvention &namconv=NamingConvention("DK"))
 
Id ConditionalExpectation (Db *db, AAnam *anam, Selectivity *selectivity=nullptr, const String &name_est="", const String &name_std="", bool flag_OK=false, double proba=TEST, Id nbsimu=0, const NamingConvention &namconv=NamingConvention("CE"))
 
Id UniformConditioning (Db *db, AAnam *anam, Selectivity *selectivity, const String &name_est, const String &name_varz, const NamingConvention &namconv=NamingConvention("UC"))
 
Id anamPointToBlock (AAnam *anam, Id verbose, double cvv, double coeff, double mu)
 
DbcreateDbFromDataFrame (const DataFrame *dat, const VectorString &coordinates)
 
GaussianProcesscreateModelFromData (const Db *dat, const VectorString &variables, const std::vector< ECov > &structs, bool addMeasurementError=false)
 
 trendSPDE (Db *dbin, Model *model, Id useCholesky=-1, const VectorMeshes *meshesK=nullptr, const ProjMultiMatrix *projInK=nullptr, const SPDEParam &params=SPDEParam(), bool verbose=false)
 
Id krigingSPDE (Db *dbin, Db *dbout, Model *model, bool flag_est=true, bool flag_std=false, Id useCholesky=-1, const VectorMeshes *meshesK=nullptr, const ProjMultiMatrix *projInK=nullptr, const VectorMeshes *meshesS=nullptr, const ProjMultiMatrix *projInS=nullptr, const ProjMultiMatrix *projOutK=nullptr, const ProjMultiMatrix *projOutS=nullptr, const SPDEParam &params=SPDEParam(), bool verbose=false, const NamingConvention &namconv=NamingConvention("KrigingSPDE"))
 
Id simulateSPDE (Db *dbin, Db *dbout, Model *model, Id nbsimu=1, Id useCholesky=-1, const VectorMeshes *meshesK=nullptr, const ProjMultiMatrix *projInK=nullptr, const VectorMeshes *meshesS=nullptr, const ProjMultiMatrix *projInS=nullptr, const ProjMultiMatrix *projOutK=nullptr, const ProjMultiMatrix *projOutS=nullptr, const SPDEParam &params=SPDEParam(), bool verbose=false, const NamingConvention &namconv=NamingConvention("SimuSPDE"))
 
Id simPGSSPDE (Db *dbin, Db *dbout, Model *model, const RuleProp &ruleprop, Id nbsimu=1, Id useCholesky=-1, const VectorMeshes *meshesK=nullptr, const ProjMultiMatrix *projInK=nullptr, const VectorMeshes *meshesS=nullptr, const ProjMultiMatrix *projInS=nullptr, const ProjMultiMatrix *projOutK=nullptr, const ProjMultiMatrix *projOutS=nullptr, const SPDEParam &params=SPDEParam(), bool verbose=false, const NamingConvention &namconv=NamingConvention("SimPGSSPDE"))
 
double logLikelihoodSPDE (Db *dbin, Model *model, Id useCholesky=-1, const VectorMeshes *meshes=nullptr, const ProjMultiMatrix *projIn=nullptr, const SPDEParam &params=SPDEParam(), bool verbose=false)
 
void throw_exp (const std::string &msg="", const std::string &file="", Id line=0)
 
void argumentTestInt (Id value)
 
void argumentTestDouble (double value)
 
void argumentTestVectorInt (const 1 &values)
 
void argumentTestVectorDouble (const 1 &values)
 
void argumentTestVectorVectorInt (const 1 &values)
 
void argumentTestVectorVectorDouble (const 1 &values)
 
void argumentTestString (const String &value)
 
void argumentTestVectorString (const VectorString &values)
 
void argumentTestIntOverload (Id value)
 
void argumentTestIntOverload (const 1 &values)
 
void argumentTestDoubleOverload (double value)
 
void argumentTestDoubleOverload (const 1 &values)
 
void argumentTestStringOverload (const String &value)
 
void argumentTestStringOverload (const VectorString &values)
 
void argumentTestEnum (const ETests &value)
 
Id argumentReturnInt (Id value)
 
double argumentReturnDouble (double value)
 
 argumentReturnVectorInt (const 1 &values)
 
 argumentReturnVectorDouble (const 1 &values)
 
 argumentReturnVectorVectorInt (const 1 &values)
 
 argumentReturnVectorVectorDouble (const 1 &values)
 
void argumentDefTestInt (Id argInt=2)
 
void argumentDefTestDbl (double argDbl=2.)
 
void argumentDefTestStr (const String &argstr="Default String")
 
void argumentDefTestVInt (const 1 &argVInt=1())
 
void argumentDefTestVDbl (const 1 &argVDbl=1())
 
void argumentDefTestVString (const VectorString &argVString=VectorString())
 
void argumentDefTestVVInt (1 argVVInt=1())
 
void argumentDefTestVVDbl (1 argVVDbl=1())
 
void argumentTestMatrixDense (const MatrixDense &mat=MatrixDense())
 
void argumentTestMatrixSquare (const MatrixSquare &mat=MatrixSquare())
 
void argumentTestMatrixSymmetric (const MatrixSymmetric &mat=MatrixSymmetric())
 
MatrixDense argumentReturnMatrix (Id nrows=2, Id ncols=3, Id seed=1312)
 
void argumentTestMatrixSparse (const MatrixSparse &mat=MatrixSparse())
 
MatrixSparse argumentReturnMatrixSparse (Id nrows=2, Id ncols=3, double zeroPercent=0.1, Id seed=1356)
 
void messageFlush (const String &string)
 
void messerrFlush (const String &string)
 
void messerr (const char *format,...)
 
void message (const char *format,...)
 
void messageNoDiff (const char *format,...)
 
void mesArg (const char *title, Id current, Id nmax)
 
bool checkArg (const char *title, Id current, Id nmax)
 
void messageAbort (const char *format,...)
 
void mestitle (Id level, const char *format,...)
 
void mes_process (const char *string, Id ntot, Id iech)
 
String toTitle (Id level, const char *format,...)
 
String toMatrix (const String &title, const AMatrix &mat, bool flagOverride=false, bool flagSkipZero=false)
 
String toMatrix (const String &title, const VectorString &colnames, const VectorString &rownames, bool bycol, Id nrows, Id ncols, const 1 &tab, bool flagOverride=false, bool flagSkipZero=false)
 
String toMatrix (const String &title, const VectorString &colnames, const VectorString &rownames, bool bycol, Id nrows, Id ncols, const double *tab, bool flagOverride=false, bool flagSkipZero=false)
 
String toVector (const String &title, const 1 &tab, bool flagOverride=true)
 
String toVector (const String &title, const VectorString &tab, bool flagOverride=true)
 
String toVector (const String &title, constvect tab, bool flagOverride=true)
 
String toStr (const String &string, const EJustify &justify=EJustify::fromKey("RIGHT"), Id localSize=0)
 
String toDouble (double value, const EJustify &justify=EJustify::fromKey("RIGHT"))
 
String toInt (Id value, const EJustify &justify=EJustify::fromKey("RIGHT"))
 
String toInterval (double zmin, double zmax)
 
VectorString toVectorDouble (const 1 &values, const EJustify &justify=EJustify::fromKey("RIGHT"))
 
void tab_prints (const char *title, const char *string, Id ncol=1, const EJustify &justify=EJustify::fromKey("RIGHT"))
 
void tab_printg (const char *title, double value, Id ncol=1, const EJustify &justify=EJustify::fromKey("RIGHT"))
 
void tab_printd (const char *title, double value, Id ncol=1, const EJustify &justify=EJustify::fromKey("RIGHT"))
 
void tab_printi (const char *title, Id value, Id ncol=1, const EJustify &justify=EJustify::fromKey("RIGHT"))
 
void tab_print_rc (const char *title, Id mode, Id value, Id ncol=1, const EJustify &justify=EJustify::fromKey("RIGHT"))
 
void tab_print_rowname (const char *string, Id taille)
 
void print_matrix (const char *title, Id flag_limit, Id bycol, Id nx, Id ny, const double *sel, const double *tab)
 
void print_matrix (const char *title, Id flag_limit, const AMatrix &mat)
 
void print_trimat (const char *title, Id mode, Id neq, const double *tl)
 
void print_imatrix (const char *title, Id flag_limit, Id bycol, Id nx, Id ny, const double *sel, const Id *tab)
 
void print_vector (const char *title, Id flag_limit, Id ntab, const double *tab)
 
void print_vector (const char *title, Id flag_limit, Id ntab, const 1 &tab)
 
void print_ivector (const char *title, Id flag_limit, Id ntab, const Id *itab)
 
void print_ivector (const char *title, Id flag_limit, Id ntab, const 1 &itab)
 
Id FFTn (Id ndim, const 1 &dims, 1 &Re, 1 &Im, Id iSign=1, double scaling=1.)
 
Array evalCovFFTTimeSlice (const 1 &hmax, double time, Id N, const std::function< std::complex< double >(1, double)> &funcSpectrum)
 
Array evalCovFFTSpatial (const 1 &hmax, Id N, const std::function< double(const 1 &)> &funcSpectrum)
 
void fftshift (const 1 &dims, 1 &data)
 
void skipBOM (std::ifstream &ins)
 
FILE * gslFopen (const char *path, const char *mode)
 
FILE * gslFopen (const String &path, const String &mode)
 
bool gslFileExist (const char *path, const char *mode)
 
bool gslFileExist (const String &path, const String &mode)
 
String gslBaseName (const String &path, bool keepExtension=false)
 
String gslGetEnv (const String &name)
 
std::istream & gslSafeGetline (std::istream &is, String &t)
 
template<typename T >
auto enumerate (T &container)
 
void law_set_old_style (bool style)
 
Id law_get_random_seed (void)
 
void law_set_random_seed (Id seed)
 
double law_uniform (double mini=0., double maxi=1.)
 
Id law_int_uniform (Id mini, Id maxi)
 
double law_gaussian (double mean=0., double sigma=1.)
 
double law_exponential (double lambda=1.)
 
double law_gamma (double alpha, double beta=1.)
 
double law_df_poisson (Id i, double parameter)
 
 law_df_poisson_vec (1 is, double parameter)
 
Id law_poisson (double parameter)
 
double law_stable_standard_agd (double alpha, double beta)
 
double law_stable_standard_a1gd (double beta)
 
double law_stable_standard_abgd (double alpha)
 
double law_stable_a (double alpha, double beta, double gamma, double delta)
 
double law_stable_a1 (double beta, double gamma, double delta)
 
double law_stable (double alpha, double beta, double gamma, double delta)
 
Id law_binomial (Id n, double p)
 
double law_beta1 (double parameter1, double parameter2)
 
double law_beta2 (double parameter1, double parameter2)
 
double law_df_gaussian (double value)
 
double law_dnorm (double value, double mean, double std)
 
double law_cdf_gaussian (double value)
 
double law_invcdf_gaussian (double value)
 
double law_gaussian_between_bounds (double binf, double bsup)
 
double law_df_bigaussian (1 &vect, 1 &mean, MatrixSymmetric &correl)
 
double law_df_quadgaussian (1 &vect, MatrixSymmetric &correl)
 
double law_df_multigaussian (1 &vect, MatrixSymmetric &correl)
 
 law_random_path (Id nech)
 
 law_exp_sample (const double *tabin, Id mode, Id nvar, Id nechin, Id nechout, Id niter, Id nconst, double *consts, Id seed, double percent)
 
Id sampleInteger (Id minit, Id maxi)
 
Id mvndst_infin (double low, double sup)
 
void mvndst (Id n, double *lower, double *upper, Id *infin, double *correl, Id maxpts, double abseps, double releps, double *error, double *value, Id *inform)
 
void mvndst2n (const double *lower, const double *upper, const double *means, double *correl, Id maxpts, double abseps, double releps, double *error, double *value, Id *inform)
 
void mvndst4 (double *lower, double *upper, const double *correl, Id maxpts, double abseps, double releps, double *error, double *value, Id *inform)
 
Id besselj_table (double x, double alpha, Id nb, double *b)
 
double besselj (double x, Id n)
 
Id besselk (double x, double alpha, Id nb, double *bk)
 
double loggamma (double parameter)
 
double ut_legendre (Id n, double v, bool flagNorm=true)
 
 ut_legendreVec (Id n, const 1 &vecin, bool flagNorm)
 
MatrixDense ut_legendreMatNorm (Id n, const 1 &v)
 
MatrixDense ut_legendreAssociatedMat (Id l, const 1 &v, bool flagNorm=true)
 
double ut_flegendre (Id n, Id k0, double theta, bool flagNorm=true)
 
double ut_sphericalHarmonic (Id n, Id k, double theta, double phi)
 
 ut_sphericalHarmonicVec (Id n, Id k, 1 theta, 1 phi)
 
double golden_search (double(*func_evaluate)(double test, void *user_data), void *user_data, double tolstop, double a0, double c0, double *test_loc, double *niter)
 
Id ut_chebychev_count (double(*func)(double, double, const 1 &), Cheb_Elem *cheb_elem, double x, const 1 &blin)
 
Id ut_chebychev_coeffs (double(*func)(double, double, const 1 &), Cheb_Elem *cheb_elem, const 1 &blin)
 
void ut_vandercorput (Id n, Id flag_sym, Id flag_rot, Id *ntri_arg, 1 &coord)
 
Id ut_icosphere (Id n, Id flag_rot, Id *ntri_arg, 1 &coord)
 
double ut_factorial (Id k)
 
void ut_log_factorial (Id nbpoly, double *factor)
 
MatrixDensevanDerCorput (Id n, Id nd)
 
MatrixDense fillLegendreMatrix (const 1 &r, Id legendreOrder)
 
Id solve_P2 (double a, double b, double c, 1 &x)
 
Id solve_P3 (double a, double b, double c, double d, 1 &x)
 
char * mem_alloc_ (const char *call_file, size_t call_line, Id size, Id flag_fatal)
 
char * mem_calloc_ (const char *call_file, size_t call_line, Id size_t, Id size, Id flag_fatal)
 
char * mem_realloc_ (const char *call_file, size_t call_line, char *tab, Id size, Id flag_fatal)
 
char * mem_copy_ (const char *call_file, size_t call_line, char *tabin, Id size, Id flag_fatal)
 
char * mem_free_ (const char *call_file, size_t call_line, char *tab)
 
double ** mem_tab_free (double **tab, Id nvar)
 
double ** mem_tab_alloc (Id nvar, Id size, Id flag_fatal)
 
unsigned long long getTotalSystemMemory ()
 
double distanceBetweenPolylines (const PolyLine2D &poly1, const PolyLine2D &poly2, const PolyPoint2D &pldist1, const PolyPoint2D &pldist2)
 
Id dbUnfoldPolyline (Db *db, const PolyLine2D &polyline, const NamingConvention &namconv=NamingConvention("Unfold"))
 
Id dbFoldPolyline (DbGrid *dbin, Db *dbout, const 1 &cols, const PolyLine2D &polyline, const NamingConvention &namconv=NamingConvention("Fold"))
 
Id dbFromPolylines (Db *db, const PolyLine2D &top, const PolyLine2D &bot, Id nb_neigh=0, bool flagMask=true, const NamingConvention &namconv=NamingConvention("Lines"))
 
String toUpper (const std::string_view string)
 
String toLower (const std::string_view string)
 
void toUpper (String &string)
 
void toLower (String &string)
 
bool matchKeyword (const String &string1, const String &string2, bool caseSensitive=true)
 
bool matchRegexp (const String &string1, const String &string2, bool caseSensitive=true)
 
Id getRankInList (const VectorString &list, const String &match, bool caseSensitive=true)
 
Id decodeInString (const String &symbol, const String &node, Id *facies, bool caseSensitive=true)
 
Id decodeInList (const VectorString &symbols, const String &node, Id *rank, Id *facies, bool caseSensitive=true)
 
void correctNamesForDuplicates (VectorString &list)
 
void correctNewNameForDuplicates (VectorString &list, Id rank)
 
String incrementStringVersion (const String &string, Id rank=1, const String &delim=".")
 
String concatenateString (const String &string, double value, const String &delim="-")
 
String concatenateStrings (const String &delimt=".", const String &string1="", const String &string2="", const String &string3="", const String &string4="")
 
VectorString generateMultipleNames (const String &radix, Id number, const String &delim="-")
 
VectorString expandList (const VectorString &list, const String &match, bool onlyOne=false)
 
VectorString expandList (const VectorString &list, const VectorString &matches)
 
Id getMaxStringSize (const VectorString &list)
 
VectorString separateKeywords (const String &code)
 
Id toInteger (const String &v)
 
double toDouble (const String &v, char dec='.')
 
String toString (Id value)
 
String toString (double value)
 
Id askInt (const String &text, Id defval=ITEST, bool authTest=false)
 
double askDouble (const String &text, double defval=TEST, bool authTest=false)
 
Id askBool (const String &text, bool defval=false)
 
String trimRight (const String &s, const String &t=SPACES)
 
String trimLeft (const String &s, const String &t=SPACES)
 
String trim (const String &s, const String &t=SPACES)
 
String erase (const String &s, const String &t=SPACES)
 
 decodeGridSorting (const String &string, const 1 &nx, bool verbose=false)
 
char * gslStrcpy (char *dst, Id n, const char *src)
 
void gslStrcpy (String &dst, const String &src)
 
void gslStrcpy (String &dst, const char *src)
 
char * gslStrcat (char *dst, Id n, const char *src)
 
void gslStrcat (String &dst, const char *src)
 
void gslStrcat (String &dst, const String &src)
 
Id gslSPrintf (char *dst, Id n, const char *fmt,...)
 
Id gslSPrintf (String &dst, const char *fmt,...)
 
Id gslSPrintfCat (String &dst, const char *fmt,...)
 
char * gslStrtok (char *str, const char *delim)
 
Id gslScanf (const char *fmt,...)
 
Id gslSScanf (const char *str, const char *fmt,...)
 
bool isInteger (double value, double eps=EPSILON10)
 
Id getClosestInteger (double value)
 
bool isMultiple (Id nbig, Id nsmall)
 
bool isOdd (Id number)
 
bool isEven (Id number)
 
bool isZero (double value, double eps=EPSILON10)
 
bool isOne (double value, double eps=EPSILON10)
 
bool isEqual (double v1, double v2, double eps=EPSILON10)
 
double getMin (double val1, double val2)
 
double getMax (double val1, double val2)
 
double ut_deg2rad (double angle)
 
double ut_rad2deg (double angle)
 
bool isEqualExtended (double v1, double v2, double eps, bool flagRelative, bool flagAbsolute, const String &string)
 Function checking that two values are equal This verbose method is essentially used in tests.
 
bool FFFF (double value)
 
bool IFFFF (Id value)
 
double getTEST ()
 
Id getITEST ()
 
template<typename T >
getNA ()
 
template<>
double getNA ()
 
template<>
Id getNA ()
 
template<>
String getNA ()
 
template<>
float getNA ()
 
template<typename T >
bool isNA (const T &v)
 
template<>
bool isNA (const double &v)
 
template<>
bool isNA (const Id &v)
 
template<>
bool isNA (const String &v)
 
template<>
bool isNA (const float &v)
 
void ut_sort_double (Id safe, Id nech, Id *ind, double *value)
 
StatResults ut_statistics (Id nech, const double *tab, const double *sel=nullptr, const double *wgt=nullptr)
 
void ut_stats_mima_print (const char *title, Id nech, double *tab, double *sel)
 
void ut_facies_statistics (Id nech, double *tab, double *sel, Id *nval, Id *mini, Id *maxi)
 
void ut_classify (Id nech, const double *tab, double *sel, Id nclass, double start, double pas, Id *nmask, Id *ntest, Id *nout, Id *classe)
 
double ut_median (1 &tab, Id ntab)
 
double ut_cnp (Id n, Id k)
 
MatrixSquare ut_pascal (Id ndim)
 
 ut_combinations (Id n, Id maxk, Id *ncomb)
 
void ut_shuffle_array (Id nrow, Id ncol, 1 &tab)
 
 getListActiveToAbsolute (const 1 &sel)
 
std::map< Id, IdgetMapAbsoluteToRelative (const 1 &sel, bool verbose=false)
 
Id getRankMapAbsoluteToRelative (const std::map< Id, Id > &map, Id iabs)
 
Id getRankMapRelativeToAbsolute (const std::map< Id, Id > &map, Id irel)
 
operate_function operate_Identify (Id oper)
 
double operate_Identity (double x)
 
double operate_Inverse (double x)
 
double operate_Square (double x)
 
double operate_InverseSquare (double x)
 
double operate_Sqrt (double x)
 
double operate_InverseSqrt (double x)
 
double modifyOperator (const EOperator &oper, double oldval, double value)
 
double roundZero (double value, double eps=EPSILON6)
 
double truncateDecimals (double value, Id ndec=0)
 
double truncateDigits (double value, Id ndigits)
 
void print_range (const char *title, Id ntab, const double *tab, const double *sel)
 
void convertIndptrToIndices (Id ncumul, const I32 *cumul, I32 *tab)
 TODO: transfer this in swig_inc.i.
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const VectorT< VectorNumT< T > > &vec)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const VectorT< T > &vec)
 
Id dbg2gCopy (DbGrid *dbin, DbGrid *dbout, const NamingConvention &namconv=NamingConvention("Copy"))
 
Id dbg2gExpand (DbGrid *dbin, DbGrid *dbout, const NamingConvention &namconv=NamingConvention("Expand"))
 
Id dbg2gShrink (DbGrid *dbin, DbGrid *dbout, const NamingConvention &namconv=NamingConvention("Shrink"))
 
Id dbg2gInterpolate (DbGrid *dbin, DbGrid *dbout, const VectorString &tops=VectorString(), const VectorString &bots=VectorString(), const NamingConvention &namconv=NamingConvention("Interpolation", false))
 
Id migrate (Db *dbin, Db *dbout, const String &name, Id dist_type=1, const 1 &dmax=1(), bool flag_fill=false, bool flag_inter=false, bool flag_ball=false, const NamingConvention &namconv=NamingConvention("Migrate", false))
 
Id migrateMulti (Db *dbin, Db *dbout, const VectorString &names, Id dist_type=1, const 1 &dmax=1(), bool flag_fill=false, bool flag_inter=false, bool flag_ball=false, const NamingConvention &namconv=NamingConvention("Migrate"))
 
Id migrateByAttribute (Db *dbin, Db *dbout, const 1 &iatts=1(), Id dist_type=1, const 1 &dmax=1(), bool flag_fill=false, bool flag_inter=false, bool flag_ball=false, const NamingConvention &namconv=NamingConvention("Migrate"))
 
Id migrateByLocator (Db *dbin, Db *dbout, const ELoc &locatorType, Id dist_type=1, const 1 &dmax=1(), bool flag_fill=false, bool flag_inter=false, bool flag_ball=false, const NamingConvention &namconv=NamingConvention("Migrate"))
 
Id manageExternalInformation (Id mode, const ELoc &locatorType, Db *dbin, Db *dbout, bool *flag_created)
 
Id interpolateVariableToPoint (DbGrid *db_grid, Id iatt, Id np, const double *xp, const double *yp, const double *zp, double *tab)
 
 dbgridLineSampling (DbGrid *dbgrid, const double *x1, const double *x2, Id ndisc, Id ncut, const double *cuts, Id *nval_ret)
 
Id expandPointToGrid (Db *db_point, DbGrid *db_grid, Id iatt, Id iatt_time, Id iatt_angle, Id iatt_scaleu, Id iatt_scalev, Id iatt_scalew, Id flag_index, Id distType, const 1 &dmax, 1 &tab)
 
Id pointToBlock (Db *dbpoint, DbGrid *dbgrid, Id option, Id flag_size, Id iatt_time, Id iatt_size, Id iatt_angle, Id iatt_scaleu, Id iatt_scalev, Id iatt_scalew)
 
Id migrateGridToCoor (const DbGrid *db_grid, Id iatt, const 1 &coords, 1 &tab)
 
Id expandPointToCoor (const Db *db1, Id iatt, const 1 &coords, 1 &tab)
 
Id simuPost (Db *dbin, DbGrid *dbout, const VectorString &names, bool flag_match=false, const EPostUpscale &upscale=EPostUpscale::fromKey("MEAN"), const std::vector< EPostStat > &stats=EPostStat::fromKeys({"MEAN"}), bool verbose=false, const 1 &check_targets=1(), Id check_level=0, const NamingConvention &namconv=NamingConvention("Post"))
 
Id simuPostDemo (Db *dbin, DbGrid *dbout, const VectorString &names, bool flag_match=false, const EPostUpscale &upscale=EPostUpscale::fromKey("MEAN"), const std::vector< EPostStat > &stats=EPostStat::fromKeys({"MEAN"}), bool verbose=false, const 1 &check_targets=1(), Id check_level=0, const NamingConvention &namconv=NamingConvention("Post"))
 
Id simuPostPropByLayer (Db *dbin, DbGrid *dbout, const VectorString &names, bool flag_match=false, bool flag_topToBase=false, const EPostUpscale &upscale=EPostUpscale::fromKey("MEAN"), const std::vector< EPostStat > &stats=EPostStat::fromKeys({"MEAN"}), bool verbose=false, const 1 &check_targets=1(), Id check_level=0, const NamingConvention &namconv=NamingConvention("Prop"))
 
Id dbStatisticsOnGrid (Db *db, DbGrid *dbgrid, const EStatOption &oper, Id radius=0, const NamingConvention &namconv=NamingConvention("Stats"))
 
Id dbRegression (Db *db1, const String &nameResp, const VectorString &nameAux, Id mode=0, bool flagCst=true, Db *db2=nullptr, const Model *model=nullptr, const NamingConvention &namconv=NamingConvention("Regr"))
 
void acknowledge_gstlearn (void)
 
void ascii_study_define (const char *study)
 
void ascii_environ_read (String &filename, bool verbose)
 
void ascii_filename (const char *type, Id rank, Id mode, String &filename)
 
void ascii_simu_read (String &filename, bool verbose, Id *nbsimu, Id *nbtuba, Id *seed)
 
bool ascii_option_defined (const String &filename, const char *option_name, Id *answer, bool verbose=false)
 
Id csv_manage (const char *filename, const CSVformat &csv, Id mode, Id nitem, bool flagInteger=false, bool verbose=false)
 
void csv_print_double (double value)
 
Dbdb_read_csv (const String &filename, const CSVformat &csvfmt, bool verbose=false, Id ncol_max=-1, Id nrow_max=-1, bool flagAddSampleRank=false)
 
Id db_write_csv (Db *db, const char *filename, const CSVformat &csv, Id flag_allcol=1, Id flag_coor=1, bool flagInteger=false)
 
Id csv_table_read (const String &filename, const CSVformat &csvfmt, bool verbose, Id ncol_max, Id nrow_max, Id *ncol_arg, Id *nrow_arg, VectorString &names, 1 &tab)
 
CTablesct_tables_manage (Id mode, Id verbose, Id flag_cumul, Id nconf, Id ndisc, double cmin, double cmax, CTables *ctables_old)
 
void ct_tables_print (CTables *ctables, Id flag_print)
 
Id ct_tableone_covrank (const CTables *ctables, double cova, double *cround)
 
Id ct_tableone_getrank_from_proba (CTables *ctables, double gaussian)
 
double ct_tableone_calculate (CTables *ctables, Id iconf0, double *lows, double *ups)
 
double ct_tableone_calculate_by_rank (CTables *ctables, Id iconf0, double *rklows, double *rkups)
 
double ct_INTRES2 (CTables *ctables, Id iconf0, Id idisc0, Id jdisc0)
 
double ct_INTRES3 (CTables *ctables, Id iconf0, Id idisc0, Id jdisc0, Id kdisc0)
 
Id fftn (Id ndim, const Id dims[], double Re[], double Im[], Id iSign=1, double scaling=1.)
 
Id _file_read (FILE *file, const char *format, va_list ap)
 
Id _file_get_ncol (FILE *file)
 
void _token_delimitors (const char del_com, const char del_sep, const char del_blk)
 
FILE * _file_open (const char *filename, Id mode)
 
Id _record_read (FILE *file, const char *format, void *out)
 
void _file_write (FILE *file, const char *format, va_list ap)
 
void _buffer_write (String &buffer, const char *format, va_list ap)
 
void _lire_string (const char *question, Id flag_def, const char *valdef, char *answer)
 
Id _lire_int (const char *question, Id flag_def, Id valdef, Id valmin, Id valmax)
 
double _lire_double (const char *question, Id flag_def, double valdef, double valmin, double valmax)
 
Id _lire_logical (const char *question, Id flag_def, Id valdef)
 
void _erase_current_string (void)
 
void set_keypair (const char *keyword, Id origin, Id nrow, Id ncol, const double *values)
 
void app_keypair (const char *keyword, Id origin, Id nrow, Id ncol, double *values)
 
void set_keypair_int (const char *keyword, Id origin, Id nrow, Id ncol, Id *values)
 
void app_keypair_int (const char *keyword, Id origin, Id nrow, Id ncol, Id *values)
 
double get_keypone (const char *keyword, double valdef)
 
Id get_keypair (const char *keyword, Id *nrow, Id *ncol, 1 &values)
 
Id get_keypair_int (const char *keyword, Id *nrow, Id *ncol, 1 &values)
 
void del_keypair (const char *keyword, Id flag_exact)
 
void print_keypair (Id flag_short)
 
Id potential_kriging (Db *db, Db *dbgrd, Db *dbtgt, DbGrid *dbout, Model *model, ANeigh *neigh, double nugget_grd=0., double nugget_tgt=0., bool flag_pot=true, bool flag_grad=false, bool flag_trans=false, bool flag_save_data=false, Id opt_part=0, bool verbose=false)
 
Id potential_cov (Model *model, bool verbose, Id type1, const 1 &x10, const 1 &x1p, const 1 &tx1, Id type2, const 1 &x20, const 1 &x2p, const 1 &tx2, 1 &covtab)
 
Id potential_simulate (Db *dbiso, Db *dbgrd, Db *dbtgt, DbGrid *dbout, Model *model, ANeigh *neigh, double nugget_grd=0., double nugget_tgt=0., double dist_tempere=TEST, bool flag_trans=false, Id seed=135674, Id nbsimu=1, Id nbtuba=100, bool verbose=false)
 
Id potential_xvalid (Db *dbiso, Db *dbgrd, Db *dbtgt, Model *model, ANeigh *neigh, double nugget_grd=0., double nugget_tgt=0., bool flag_dist_conv=false, bool verbose=false)
 
Id seismic_estimate_XZ (DbGrid *db, Model *model, Id nbench, Id nv2max, Id flag_ks, Id flag_std, Id flag_sort, Id flag_stat)
 
Id seismic_simulate_XZ (DbGrid *db, Model *model, Id nbench, Id nv2max, Id nbsimu, Id seed, Id flag_ks, Id flag_sort, Id flag_stat)
 
Id seismic_z2t_grid (Id verbose, DbGrid *db_z, Id iatt_v, Id *nx, double *x0, double *dx)
 
Id seismic_t2z_grid (Id verbose, DbGrid *db_t, Id iatt_v, Id *nx, double *x0, double *dx)
 
Id seismic_z2t_convert (DbGrid *db_z, Id iatt_v, DbGrid *db_t)
 
Id seismic_t2z_convert (DbGrid *db_t, Id iatt_v, DbGrid *db_z)
 
Id seismic_operate (DbGrid *db, Id oper)
 
Id seismic_convolve (DbGrid *db, Id flag_operate, Id flag_contrast, Id type, Id ntw, Id option, Id tindex, double fpeak, double period, double amplitude, double distort, double val_before, double val_middle, double val_after, 1 &wavelet)
 
Id sparseinv (Id n, Id *Lp, Id *Li, double *Lx, double *d, Id *Up, Id *Uj, double *Ux, Id *Zp, Id *Zi, double *Zx, double *z, Id *Zdiagp, Id *Lmunch)
 
double scale2range (const ECov &type, double scale, double param=1.)
 
double range2scale (const ECov &type, double range, double param=1.)
 
double _conv_uniform (double v)
 
double _conv_exponential (double v)
 
double _conv_gaussian (double v)
 
double _conv_sincard (double v)
 
Def_ConvolutionD_CONV (Id rank)
 
double _tape_spherical (double)
 
double _tape_cubic (double)
 
double _tape_triangle (double)
 
double _tape_penta (double)
 
double _tape_storkey (double)
 
double _tape_wendland1 (double)
 
double _tape_wendland2 (double)
 
Def_TaperingD_TAPE (Id rank)
 
void bessel_set_old_style (bool style)
 
bool haveSameNDim (const Db *db1, const Db *db2, Id *ndim)
 Given two Dbs, check that they have same Space Dimension The first or the second Db must be undefined When both are undefined, FALSE if returned.
 
bool haveCompatibleNVar (const Db *db1, const Db *db2, Id *nvar)
 Given two Dbs, check that they have same Variable Number (locator Z) The first or the second Db must be undefined When both are undefined, FALSE if returned When both are defined, return the Maximum value.
 
Id getLocatorTypeFromName (const String &name_type)
 
Id locatorIdentify (String string, ELoc *ret_locatorType, Id *ret_locatorIndex, Id *ret_mult)
 
bool isLocatorTypeValid (const ELoc &locatorType, bool unknownValid=false)
 
String getLocatorName (const ELoc &locatorType, Id locatorIndex=1)
 
void printLocatorList ()
 
VectorString getLocatorNames ()
 
 getLocatorMultiples ()
 
Global_Result global_arithmetic (Db *dbin, DbGrid *dbgrid, ModelGeneric *model, Id ivar0=0, bool verbose=false)
 
Global_Result global_kriging (Db *dbin, Db *dbout, ModelGeneric *model, Id ivar0=0, bool verbose=false)
 
Id krimage (DbGrid *dbgrid, Model *model, ANeigh *neigh, bool flagFFT=false, bool verbose=false, Id seed=13431, const NamingConvention &namconv=NamingConvention("Filtering"))
 
Id dbMorpho (DbGrid *dbgrid, const EMorpho &oper, double vmin=0., double vmax=1.5, Id option=0, const 1 &radius=1(), bool flagDistErode=false, bool verbose=false, const NamingConvention &namconv=NamingConvention("Morpho"))
 
Id dbSmoother (DbGrid *dbgrid, ANeigh *neigh, Id type=1, double range=1., const NamingConvention &namconv=NamingConvention("Smooth"))
 
Id kriging (Db *dbin, Db *dbout, ModelGeneric *model, ANeigh *neigh, bool flag_est=true, bool flag_std=true, bool flag_varz=false, const KrigOpt &krigopt=KrigOpt(), const NamingConvention &namconv=NamingConvention("Kriging"))
 
Id krigcell (Db *dbin, Db *dbout, ModelGeneric *model, ANeigh *neigh, bool flag_est=true, bool flag_std=true, const KrigOpt &krigopt=KrigOpt(), const NamingConvention &namconv=NamingConvention("KrigCell"))
 
Id kribayes (Db *dbin, Db *dbout, ModelGeneric *model, ANeigh *neigh, const 1 &prior_mean=1(), const MatrixSymmetric &prior_cov=MatrixSymmetric(), bool flag_est=true, bool flag_std=true, const NamingConvention &namconv=NamingConvention("Bayes"))
 
Id kriggam (Db *dbin, Db *dbout, ModelGeneric *model, ANeigh *neigh, AAnam *anam, const NamingConvention &namconv=NamingConvention("KrigGam"))
 
Krigtest_Res krigtest (Db *dbin, Db *dbout, ModelGeneric *model, ANeigh *neigh, Id iech0=0, const KrigOpt &krigopt=KrigOpt(), bool verbose=true)
 
Id xvalid (Db *db, ModelGeneric *model, ANeigh *neigh, bool flag_kfold=false, Id flag_xvalid_est=1, Id flag_xvalid_std=1, Id flag_xvalid_varz=0, const KrigOpt &krigopt=KrigOpt(), const NamingConvention &namconv=NamingConvention("Xvalid"))
 
Id test_neigh (Db *dbin, Db *dbout, ModelGeneric *model, ANeigh *neigh, const NamingConvention &namconv=NamingConvention("Neigh"))
 
Id krigingFactors (Db *dbin, Db *dbout, Model *model, ANeigh *neigh, bool flag_est=true, bool flag_std=true, const KrigOpt &krigopt=KrigOpt(), const NamingConvention &namconv=NamingConvention("KD"))
 
Id inverseDistance (Db *dbin, Db *dbout, double exponent=2., bool flag_expand=true, double dmax=TEST, bool flag_est=true, bool flag_std=false, Model *model=nullptr, const NamingConvention &namconv=NamingConvention("InvDist"))
 
Id nearestNeighbor (Db *dbin, Db *dbout, bool flag_est=true, bool flag_std=false, Model *model=nullptr, const NamingConvention &namconv=NamingConvention("Nearest"))
 
Id movingAverage (Db *dbin, Db *dbout, ANeigh *neigh, bool flag_est=true, bool flag_std=false, Model *model=nullptr, const NamingConvention &namconv=NamingConvention("MovAve"))
 
Id movingMedian (Db *dbin, Db *dbout, ANeigh *neigh, bool flag_est=true, bool flag_std=false, Model *model=nullptr, const NamingConvention &namconv=NamingConvention("MovMed"))
 
Id leastSquares (Db *dbin, Db *dbout, ANeigh *neigh, Id order=0, const NamingConvention &namconv=NamingConvention("LstSqr"))
 
Id krigingVecchia (Db *dbin, Db *dbout, ModelGeneric *model, Id nb_neigh=5, bool verbose=false, const NamingConvention &namconv=NamingConvention("Vecchia"))
 
double logLikelihoodVecchia (const Db *db, ModelGeneric *model, Id nb_neigh=5, bool verbose=false)
 
Variovariogram_pgs (Db *db, const VarioParam *varioparam, const RuleProp *ruleprop, Id flag_rho=false, Id opt_correl=2)
 
Id model_auto_fit (Vario *vario, Model *model, bool verbose=false, const Option_AutoFit &mauto_arg=Option_AutoFit(), const Constraints &cons_arg=Constraints(), const Option_VarioFit &optvar_arg=Option_VarioFit())
 
Id vmap_auto_fit (const DbGrid *dbmap, Model *model, bool verbose=false, const Option_AutoFit &mauto_arg=Option_AutoFit(), const Constraints &cons_arg=Constraints(), const Option_VarioFit &optvar_arg=Option_VarioFit())
 
void set_test_discrete (bool flag_discret)
 
Variomodel_pgs (Db *db, const VarioParam *varioparam, const RuleProp *ruleprop, const Model *model1, const Model *model2=nullptr)
 
Id krigsum (Db *dbin, Db *dbout, Model *model, ANeigh *neigh, bool flag_positive=false, const NamingConvention &namconv=NamingConvention("KrigSum"))
 
Id declustering (Db *db, Model *model, Id method, ANeigh *neigh=nullptr, DbGrid *dbgrid=nullptr, const 1 &radius=1(), const 1 &ndisc=1(), Id flag_sel=false, bool verbose=false)
 
Id simpgs (Db *dbin, Db *dbout, RuleProp *ruleprop, Model *model1, Model *model2=nullptr, ANeigh *neigh=nullptr, Id nbsimu=1, Id seed=1321421, Id flag_gaus=false, Id flag_prop=false, Id flag_check=false, Id flag_show=false, Id nbtuba=100, Id gibbs_nburn=10, Id gibbs_niter=100, double percent=5., const NamingConvention &namconv=NamingConvention("Facies", true, true, true, ELoc::fromKey("FACIES")))
 
Id simbipgs (Db *dbin, Db *dbout, RuleProp *ruleprop, Model *model11, Model *model12=nullptr, Model *model21=nullptr, Model *model22=nullptr, ANeigh *neigh=nullptr, Id nbsimu=1, Id seed=43243, Id flag_gaus=false, Id flag_prop=false, Id flag_check=false, Id flag_show=false, Id nbtuba=100, Id gibbs_nburn=10, Id gibbs_niter=100, double percent=5., const NamingConvention &namconv=NamingConvention("Facies", true, true, true, ELoc::fromKey("FACIES")))
 
 simsph_mesh (MeshSpherical *mesh, Model *model, const SimuSphericalParam &sphepar, Id seed=54523, Id verbose=false)
 
MatrixDense fluid_extract (DbGrid *dbgrid, const String &name_facies, const String &name_fluid, const String &name_poro, const String &name_date, Id nfacies, Id nfluids, Id facies0, Id fluid0, Id ntime, double time0, double dtime, bool verbose=false)
 
Id db_proportion_estimate (Db *dbin, DbGrid *dbout, Model *model, Id niter=100, bool verbose=false, const NamingConvention &namconv=NamingConvention("Prop", true, true, true, ELoc::fromKey("P")))
 
Id gibbs_sampler (Db *dbin, Model *model, Id nbsimu, Id seed, Id gibbs_nburn, Id gibbs_niter, bool flag_moving, bool flag_norm, bool flag_multi_mono, bool flag_propagation, bool flag_sym_neigh, Id gibbs_optstats, double percent, bool flag_ce, bool flag_cstd, bool verbose=false, const NamingConvention &namconv=NamingConvention("Gibbs"))
 
void record_close (void)
 
void redefine_message (void(*write_func)(const char *))
 
void redefine_error (void(*warn_func)(const char *))
 
void redefine_read (void(*read_func)(const char *, char *))
 
void redefine_exit (void(*exit_func)(void))
 
void mem_error (Id nbyte)
 
void message_extern (const char *string)
 
void exit_extern ()
 
void string_strip_blanks (char *string, Id flag_lead)
 
void string_strip_quotes (char *string)
 
void print_current_line (void)
 
template<typename SpChol , typename SpMat >
SpChol::MatrixType partial_inverse (const SpChol &llt, const SpMat &pattern)
 
std::shared_ptr< MatrixSparsebuildInvNugget (Db *dbin, Model *model, const SPDEParam &params=SPDEParam())
 
Id get_rank_from_propdef (PropDef *propdef, Id ipgs, Id igrf)
 
Id rule_thresh_define_shadow (PropDef *propdef, Db *dbin, const RuleShadow *rule, Id facies, Id iech, Id isimu, Id nbsimu, double *t1min, double *t1max, double *t2min, double *t2max, double *dsup, double *down)
 
Id rule_thresh_define (PropDef *propdef, Db *dbin, const Rule *rule, Id facies, Id iech, Id isimu, Id nbsimu, Id flag_check, double *t1min, double *t1max, double *t2min, double *t2max)
 
void proportion_rule_process (PropDef *propdef, const EProcessOper &mode)
 
PropDefproportion_manage (Id mode, Id flag_facies, Id flag_stat, Id ngrf1, Id ngrf2, Id nfac1, Id nfac2, Db *db, const Db *dbprop, const 1 &propcst, PropDef *proploc)
 
void propdef_reset (PropDef *propdef)
 
void proportion_print (PropDef *propdef)
 
void set_rule_mode (Id rule_mode)
 
Id get_rule_mode (void)
 
double get_rule_extreme (Id mode)
 
Rulerule_free (const Rule *rule)
 
Modelmodel_rule_combine (const Model *model1, const Model *model2, const Rule *rule)
 
Id db_rule_shadow (Db *db, Db *dbprop, RuleShadow *rule, Model *model1, const 1 &props, Id flag_stat, Id nfacies)
 
void setMultiThread (I32 nthreads)
 
I32 getMultiThread ()
 
bool isMultiThread ()
 
bool getFlagMatrixCheck ()
 
void setFlagMatrixCheck (bool flag)
 
MatrixSparsecreateFromAnyMatrix (const AMatrix *mat)
 
MatrixSparseprodNormMatMat (const MatrixSparse *a, const MatrixSparse *m, bool transpose=false)
 
MatrixSparseprodNormMatVec (const MatrixSparse *a, const 1 &vec, bool transpose=false)
 
MatrixSparseprodNormMat (const MatrixSparse *a, bool transpose=false)
 
MatrixSparseprodNormDiagVec (const MatrixSparse *a, const 1 &vec, Id oper_choice=1)
 
Eigen::SparseMatrix< double > AtMA (const Eigen::SparseMatrix< double > &A, const Eigen::SparseMatrix< double > &M)
 
MatrixSquareprodNormMatMat (const MatrixDense *a, const MatrixDense *m, bool transpose=false)
 
MatrixSquareprodNormMat (const MatrixDense &a, bool transpose=false)
 
MatrixSquareprodNormMatVec (const MatrixDense &a, const 1 &vec, bool transpose=false)
 
void dumpMeshes (const VectorMeshes &meshes)
 
 get_db_extension (Db *dbin, Db *dbout, Id *nout)
 
 extend_grid (DbGrid *db, const 1 &gext, Id *nout)
 
 extend_point (Db *db, const 1 &gext, Id *nout)
 
Id MSS (Id ndim, Id ipol, Id icas, Id icorn, Id idim)
 
Id meshes_2D_write (const char *file_name, const char *obj_name, Id verbose, Id ndim, Id ncode, Id ntri, Id npoints, const 1 &ntcode, const 1 &triangles, const 1 &points)
 
AMeshmeshes_turbo_1D_grid_build (DbGrid *dbgrid)
 
AMeshmeshes_turbo_2D_grid_build (DbGrid *dbgrid)
 
AMeshmeshes_turbo_3D_grid_build (DbGrid *dbgrid)
 
void mesh_stats (Id ndim, Id ncorner, Id nmesh, const I32 *meshes, const double *points)
 
void meshes_2D_sph_init (SphTriangle *t)
 
void meshes_2D_sph_free (SphTriangle *t, Id mode)
 
Id meshes_2D_sph_from_db (Db *db, SphTriangle *t)
 
Id meshes_2D_sph_from_points (Id nech, double *x, double *y, SphTriangle *t)
 
Id meshes_2D_sph_from_auxiliary (const String &triswitch, SphTriangle *t)
 
void meshes_2D_sph_print (SphTriangle *t, Id brief)
 
Id meshes_2D_sph_create (Id verbose, SphTriangle *t)
 
bool isTurbo (const VectorMeshes &meshes)
 Check if a series of Meshes (included in 'meshes') are Turbo.
 
double constraints_get (const Constraints &constraints, const EConsType &icase, Id igrf, Id icov, const EConsElem &icons, Id v1, Id v2)
 
void constraints_print (const Constraints &constraints)
 
Id modify_constraints_on_sill (Constraints &constraints)
 
Id add_unit_sill_constraints (Constraints &constraints)
 
Id computeCovMatSVCLHSInPlace (MatrixSymmetric &cov, const MatrixSymmetric &Sigma, const MatrixDense &F1, Id type=1, Id idx=0)
 
Id computeCovMatSVCRHSInPlace (MatrixDense &cov, const MatrixSymmetric &Sigma, const MatrixDense &F1, const MatrixDense &F2, Id type1=1, Id idx1=0, Id type2=1, Id idx2=0)
 
Id computeDriftMatSVCRHSInPlace (MatrixDense &mat, const MatrixDense &F, Id type=1, Id idx=0, bool flagCenteredFactors=true)
 
Id morpho_count (const BImage &imagin)
 
void morpho_duplicate (const BImage &imagin, BImage &imagout)
 
void morpho_erosion (Id option, const 1 &radius, const BImage &imagin, BImage &imagout, bool verbose=false)
 
void morpho_dilation (Id option, const 1 &radius, const BImage &imagin, BImage &imagout, bool verbose=false)
 
void morpho_opening (Id option, const 1 &radius, const BImage &imagin, BImage &imagout, bool verbose=false)
 
void morpho_closing (Id option, const 1 &radius, const BImage &imagin, BImage &imagout, bool verbose=false)
 
void morpho_intersection (const BImage &image1, const BImage &image2, BImage &imagout, bool verbose=false)
 
void morpho_union (const BImage &image1, const BImage &image2, BImage &imagout, bool verbose=false)
 
void morpho_negation (const BImage &imagin, BImage &imagout, bool verbose=false)
 
void morpho_double2imageInPlace (const 1 &nx, const 1 &tabin, double vmin, double vmax, BImage &imagout, bool verbose=false)
 
BImage morpho_double2image (const 1 &nx, const 1 &tabin, double vmin, double vmax, bool verbose=false)
 
void morpho_image2double (const BImage &imagin, Id mode, double grain, double pore, 1 &tabout, bool verbose=false)
 
 morpho_labelling (Id option, Id flag_size, const BImage &imagin, double ccvoid, bool verbose=false)
 
 morpho_labelsize (Id option, const BImage &imagin)
 
void morpho_distance (Id option, const 1 &radius, bool flagDistErode, BImage &imagin, 1 &dist, bool verbose=false)
 
 gridcell_neigh (Id ndim, Id option, Id radius, bool flag_center=true, bool verbose=false)
 
Spill_Res spillPoint (DbGrid *dbgrid, const String &name_depth, const String &name_data, Id option=0, bool flag_up=true, Id verbose_step=0, double hmax=TEST)
 
Id db_morpho_calc (DbGrid *dbgrid, Id iptr0, const EMorpho &oper, double vmin, double vmax, Id option, const 1 &radius, bool flagDistErode, bool verbose)
 
void db_morpho_angle2D (DbGrid *dbgrid, const 1 &radius, Id iptr0)
 
void db_morpho_gradients (DbGrid *dbgrid, Id iptr0)
 
DbGriddb_grid_read_f2g (const char *filename, Id verbose=0)
 
Id db_grid_write_zycor (const char *filename, DbGrid *db, Id icol)
 
DbGriddb_grid_read_zycor (const char *filename, Id verbose=0)
 
Id db_grid_write_arcgis (const char *filename, DbGrid *db, Id icol)
 
Id db_grid_write_XYZ (const char *filename, DbGrid *db, Id icol)
 
Id db_write_vtk (const char *filename, DbGrid *db, const 1 &cols)
 
Id db_grid_write_bmp (const char *filename, DbGrid *db, Id icol, Id nsamplex=1, Id nsampley=1, Id nmult=1, Id ncolor=1, Id flag_low=1, Id flag_high=1, double valmin=TEST, double valmax=TEST, Id *red=nullptr, Id *green=nullptr, Id *blue=nullptr, Id mask_red=0, Id mask_green=0, Id mask_blue=0, Id ffff_red=232, Id ffff_green=232, Id ffff_blue=0, Id low_red=255, Id low_green=255, Id low_blue=255, Id high_red=255, Id high_green=0, Id high_blue=0)
 
DbGriddb_grid_read_bmp (const char *filename, Id verbose=0)
 
Id db_grid_write_irap (const char *filename, DbGrid *db, Id icol, Id nsamplex=1, Id nsampley=1)
 
Id db_grid_write_ifpen (const char *filename, DbGrid *db, Id ncol, Id *icols)
 
DbGriddb_grid_read_ifpen (const char *filename, Id verbose=0)
 
Id db_grid_write_eclipse (const char *filename, DbGrid *db, Id icol)
 
Dbdb_well_read_las (const char *filename, double xwell, double ywell, double cwell, Id verbose=0)
 
Grid segy_summary (const char *filesegy, DbGrid *surf2D=nullptr, const String &name_top="", const String &name_bot="", double thickmin=TEST, Id option=0, Id nz_ss=ITEST, Id verbOption=1, Id iline_min=ITEST, Id iline_max=ITEST, Id xline_min=ITEST, Id xline_max=ITEST, double modif_high=TEST, double modif_low=TEST, double modif_scale=TEST, Id codefmt=1)
 
SegYArg segy_array (const char *filesegy, DbGrid *surf2D=nullptr, const String &top_name="", const String &bot_name="", const String &top_aux="", const String &bot_aux="", double thickmin=TEST, Id option=0, Id nz_ss=ITEST, Id verbOption=0, Id iline_min=ITEST, Id iline_max=ITEST, Id xline_min=ITEST, Id xline_max=ITEST, double modif_high=TEST, double modif_low=TEST, double modif_scale=TEST, Id codefmt=1)
 
Id db_segy (const char *filesegy, DbGrid *grid3D, DbGrid *surf2D=nullptr, const String &name_top="", const String &name_bot="", double thickmin=TEST, Id option=0, Id nz_ss=ITEST, Id verbOption=0, Id iline_min=ITEST, Id iline_max=ITEST, Id xline_min=ITEST, Id xline_max=ITEST, double modif_high=TEST, double modif_low=TEST, double modif_scale=TEST, Id codefmt=1, const NamingConvention &namconv=NamingConvention("SEGY"))
 
void write_point_mesh (const char *filename, Id ub, Id npts, float *pts, Id nvars, Id *vardim, const char *const *varnames, 1 &vars)
 
void write_unstructured_mesh (const char *filename, Id ub, Id npts, float *pts, Id ncells, Id *celltypes, Id *conn, Id nvars, Id *vardim, Id *centering, const char *const *varnames, 1 &vars)
 
void write_regular_mesh (const char *filename, Id ub, Id *dims, Id nvars, Id *vardim, Id *centering, const char *const *varnames, 1 &vars)
 
void write_rectilinear_mesh (const char *filename, Id ub, Id *dims, float *x, float *y, float *z, Id nvars, Id *vardim, Id *centering, const char *const *varnames, 1 &vars)
 
void write_curvilinear_mesh (const char *filename, Id ub, Id *dims, float *pts, Id nvars, Id *vardim, Id *centering, const char *const *varnames, 1 &vars)
 
void db_polygon (Db *db, const Polygons *polygon, bool flag_sel=false, bool flag_period=false, bool flag_nested=false, const NamingConvention &namconv=NamingConvention("Polygon", true, true, true, ELoc::fromKey("SEL")))
 
Id dbPolygonDistance (Db *db, Polygons *polygon, double dmax, Id scale, Id polin, const NamingConvention &namconv=NamingConvention("Distance"))
 
Id db_selhull (Db *db1, Db *db2, double dilate=0., bool verbose=false, const NamingConvention &namconv=NamingConvention("Hull", true, true, true, ELoc::fromKey("SEL")))
 
 hermitePolynomials (double y, double r, Id nbpoly)
 
 hermitePolynomials (double y, double r, const 1 &ifacs)
 
 hermiteCoefIndicator (double yc, Id nbpoly)
 
 hermiteCoefMetal (double yc, const 1 &phi)
 
 hermiteCoefLower (double y, Id nbpoly)
 
 hermiteIndicatorLower (double y, Id nbpoly)
 
MatrixSquare hermiteIncompleteIntegral (double yc, Id nbpoly)
 
 hermiteLognormal (double mean, double sigma, Id nbpoly)
 
double hermiteSeries (const 1 &an, const 1 &hn)
 
 hermiteIndicator (double yc, 1 krigest, 1 krigstd)
 
double hermiteIndicatorElement (double yc, double krigest, double krigstd)
 
 hermiteIndicatorStd (double yc, 1 krigest, 1 krigstd)
 
double hermiteIndicatorStdElement (double yc, double krigest, double krigstd)
 
 hermiteMetal (double yc, 1 krigest, 1 krigstd, const 1 &phi)
 
double hermiteMetalElement (double yc, double krigest, double krigstd, const 1 &phi)
 
 hermiteMetalStd (double yc, 1 krigest, 1 krigstd, const 1 &phi)
 
double hermiteMetalStdElement (double yc, double krigest, double krigstd, const 1 &phi)
 
 hermiteCondExp (1 krigest, 1 krigstd, const 1 &phi)
 
double hermiteCondExpElement (double krigest, double krigstd, const 1 &phi)
 
 hermiteCondStd (1 krigest, 1 krigstd, const 1 &phi)
 
double hermiteCondStdElement (double krigest, double krigstd, const 1 &phi)
 
double integralGaussHermite (double yc, double r, const 1 &psi)
 
void normalizeResults (Id nbsimu, double &valest, double &valstd)
 
void normalizeResults (Id nbsimu, double &valest)
 
 MCCondExp (1 krigest, 1 krigstd, const 1 &psi, Id nbsimu=NBSIMU_DEF)
 
double MCCondExpElement (double krigest, double krigstd, const 1 &psi, Id nbsimu=NBSIMU_DEF)
 
 MCCondStd (1 krigest, 1 krigstd, const 1 &psi, Id nbsimu=NBSIMU_DEF)
 
double MCCondStdElement (double krigest, double krigstd, const 1 &psi, Id nbsimu=NBSIMU_DEF)
 
 MCIndicator (double yc, 1 krigest, 1 krigstd, Id nbsimu=NBSIMU_DEF)
 
double MCIndicatorElement (double yc, double krigest, double krigstd, Id nbsimu=NBSIMU_DEF)
 
 MCIndicatorStd (double yc, const 1 &krigest, const 1 &krigstd, Id nbsimu=NBSIMU_DEF)
 
double MCIndicatorStdElement (double yc, double krigest, double krigstd, Id nbsimu=NBSIMU_DEF)
 
 MCMetal (double yc, 1 krigest, 1 krigstd, const 1 &psi, Id nbsimu=NBSIMU_DEF)
 
double MCMetalElement (double yc, double krigest, double krigstd, const 1 &psi, Id nbsimu=NBSIMU_DEF)
 
 MCMetalStd (double yc, 1 krigest, 1 krigstd, const 1 &psi, Id nbsimu=NBSIMU_DEF)
 
double MCMetalStdElement (double yc, double krigest, double krigstd, const 1 &psi, Id nbsimu=NBSIMU_DEF)
 
Id fluid_propagation (DbGrid *dbgrid, const String &name_facies, const String &name_fluid, const String &name_perm, const String &name_poro, Id nfacies, Id nfluids, Id niter=1, const 1 &speeds=1(), bool show_fluid=false, double number_max=TEST, double volume_max=TEST, Id seed=321321, bool verbose=false, const NamingConvention &namconv=NamingConvention("Eden"))
 
Id simfft (DbGrid *db, ModelGeneric *model, SimuFFTParam &param, Id nbsimu=1, Id seed=432431, Id verbose=false, const NamingConvention &namconv=NamingConvention("FFT"))
 
 getChangeSupport (DbGrid *db, ModelGeneric *model, const SimuFFTParam &param, const 1 &sigma=1(), Id seed=14333, bool verbose=false)
 
Id tessellation_voronoi (DbGrid *dbgrid, Model *model, const SimuPartitionParam &parparam, Id seed=43243, Id verbose=false, const NamingConvention &namconv=NamingConvention("Voronoi"))
 
Id tessellation_poisson (DbGrid *dbgrid, Model *model, const SimuPartitionParam &parparam, Id seed=432432, Id verbose=false, const NamingConvention &namconv=NamingConvention("Poisson"))
 
DbGridsimulation_refine (DbGrid *dbin, Model *model, const SimuRefineParam &param, Id seed=432432, const NamingConvention &namconv=NamingConvention("Refine"))
 
Id substitution (DbGrid *dbgrid, SimuSubstitutionParam &subparam, Id seed=43242, Id verbose=false, const NamingConvention &namconv=NamingConvention("SimSub"))
 
Id simtub (Db *dbin=nullptr, Db *dbout=nullptr, Model *model=nullptr, ANeigh *neigh=nullptr, Id nbsimu=1, Id seed=43431, Id nbtuba=100, bool flag_dgm=false, bool flag_check=false, const NamingConvention &namconv=NamingConvention("Simu"))
 
Id simbayes (Db *dbin, Db *dbout, Model *model, ANeigh *neigh, Id nbsimu=1, Id seed=132141, const 1 &dmean=1(), const MatrixSymmetric &dcov=MatrixSymmetric(), Id nbtuba=100, bool flag_check=false, const NamingConvention &namconv=NamingConvention("SimBayes"))
 
Id simbool (Db *dbin, DbGrid *dbout, ModelBoolean *tokens, const SimuBooleanParam &boolparam=SimuBooleanParam(), Id seed=432431, bool flag_simu=true, bool flag_rank=true, bool verbose=false, const NamingConvention &namconv=NamingConvention("Boolean"))
 
Id simuSpectral (Db *dbin=nullptr, Db *dbout=nullptr, Model *model=nullptr, Id nbsimu=1, Id seed=43431, Id ns=100, Id nd=100, bool verbose=false, const NamingConvention &namconv=NamingConvention("Simu"))
 
Id simsph (DbGrid *db, Model *model, const SimuSphericalParam &sphepar, Id seed, bool verbose, const NamingConvention &namconv=NamingConvention("SimSphe"))
 
void defineDefaultSpace (const ESpaceType &type, size_t ndim=2, double param=0.)
 (Re)Defining the unique default global space
 
void setDefaultSpace (const ASpaceSharedPtr &space)
 Set the unique default global space from another one.
 
ESpaceType getDefaultSpaceType ()
 Return a clone of the unique default global space.
 
Id getDefaultSpaceDimension ()
 
const ASpacegetDefaultSpace ()
 
ASpaceSharedPtr getDefaultSpaceSh ()
 
bool isDefaultSpaceSphere ()
 
VectorString statOptionToName (const std::vector< EStatOption > &opers)
 
std::vector< EStatOption > KeysToStatOptions (const VectorString &opers)
 
Table dbStatisticsMono (Db *db, const VectorString &names, const std::vector< EStatOption > &opers, bool flagIso, double proba, double vmin, double vmax, const String &title)
 
Table dbStatisticsCorrel (Db *db, const VectorString &names, bool flagIso, const String &title)
 
void dbStatisticsPrint (const Db *db, const VectorString &names, const std::vector< EStatOption > &opers, bool flagIso, bool flagCorrel, const String &title, const String &radix)
 
Table dbStatisticsMulti (Db *db, const VectorString &names, const EStatOption &oper, bool flagMono, const String &title)
 
 dbStatisticsPerCell (Db *db, DbGrid *dbgrid, const EStatOption &oper, const String &name1, const String &name2, const 1 &cuts)
 
Id statisticsProportion (DbGrid *dbin, DbGrid *dbout, Id pos, Id nfacies, Id radius)
 
Id statisticsTransition (DbGrid *dbin, DbGrid *dbout, Id pos, Id nfacies, Id radius, Id orient)
 
 dbStatisticsFacies (Db *db)
 
double dbStatisticsIndicator (Db *db)
 
MatrixSquaresphering (const AMatrix *X)
 
 correlationPairs (Db *db1, Db *db2, const String &name1, const String &name2, bool flagFrom1=false, bool verbose=false)
 
 hscatterPairs (Db *db, const String &name1, const String &name2, VarioParam *varioparam, Id ilag=0, Id idir=0, bool verbose=false)
 
Id correlationIdentify (Db *db1, Db *db2, Id icol1, Id icol2, Polygons *polygon)
 
 condexp (Db *db1, Db *db2, Id icol1, Id icol2, double mini, double maxi, Id nclass, bool verbose=false)
 
std::map< Id, IdcontingencyTable (const 1 &values)
 
std::map< Id, std::map< Id, Id > > contingencyTable2 (const 1 &values, const 1 &bins)
 
MatrixSymmetric dbVarianceMatrix (const Db *db)
 Calculate the variance-covariance matrix on the isotopic data set from the Z-locator variables.
 
void dbStatisticsVariables (Db *db, const VectorString &names, const std::vector< EStatOption > &opers, Id iptr0, double proba, double vmin, double vmax)
 
Id dbStatisticsInGridTool (Db *db, DbGrid *dbgrid, const VectorString &names, const EStatOption &oper, Id radius, Id iptr0)
 
Regression regression (Db *db1, const String &nameResp, const VectorString &nameAux=VectorString(), Id mode=0, bool flagCst=false, Db *db2=nullptr, const Model *model=nullptr)
 
 regressionDeming (const 1 &x, const 1 &y, double delta=1)
 
Id dbSelectivity (Db *db, const String &name, const 1 &zcuts, const NamingConvention &namconv=NamingConvention("Selectivity"))
 
MatrixT< IdfindNN (const Db *dbin, const Db *dbout=nullptr, Id nb_neigh=3, bool flagShuffle=false, bool verbose=false, Id leaf_size=10, Id default_distance_function=1)
 
double manhattan_distance (const double *x1, const double *x2, Id n_features)
 
double euclidean_distance (const double *x1, const double *x2, Id n_features)
 
Vario_Ordervario_order_manage (Id mode, Id flag_dist, Id size_aux, Vario_Order *vorder)
 
Vario_Ordervario_order_final (Vario_Order *vorder, Id *npair)
 
void vario_order_print (Vario_Order *vorder, Id idir_target, Id ipas_target, Id verbose)
 
void vario_order_get_bounds (Vario_Order *vorder, Id idir, Id ilag, Id *ifirst, Id *ilast)
 
void vario_order_get_indices (Vario_Order *vorder, Id ipair, Id *iech, Id *jech, double *dist)
 
void vario_order_get_auxiliary (Vario_Order *vorder, Id ipair, char *aux_iech, char *aux_jech)
 
Id vario_order_add (Vario_Order *vorder, Id iech, Id jech, void *aux_iech, void *aux_jech, Id ilag, Id idir, double dist)
 
DbbuildDbFromVarioParam (Db *db, const VarioParam &varioparam)
 
DbGriddb_vcloud (Db *db, const VarioParam *varioparam, double lagmax=TEST, double varmax=TEST, Id lagnb=100, Id varnb=100, const NamingConvention &namconv=NamingConvention("Cloud"))
 
DbGriddb_vmap (Db *db, const ECalcVario &calcul_type=ECalcVario::fromKey("VARIOGRAM"), const 1 &nxx=1(), const 1 &dxx=1(), Id radius=0, bool flag_FFT=true, const NamingConvention &namconv=NamingConvention("VMAP"))
 
void _endOfLine ()
 
void _test ()
 
void _introduction (const String &title, bool end_of_line=false)
 
void _printEmpty ()
 
void _printInt (Id value)
 
void _printDouble (double value)
 
void _printString (const String &value)
 
void _printVectorInt (const 1 &values)
 
void _printVectorDouble (const 1 &values)
 
void _printVectorString (const VectorString &values)
 
void _printVectorVectorInt (const 1 &values)
 
void _printVectorVectorDouble (const 1 &values)
 
static Id _getColumnRank ()
 
static Id _getColumnName ()
 
static Id _getColumnSize ()
 
static Id _getDecimalNumber ()
 
static double _getThresh ()
 
static Id _getMaxNCols ()
 
static Id _getMaxNRows ()
 
static Id _getNBatch ()
 
static void _buildFormat (Id mode)
 
std::stringstream _formatColumn (const EJustify &justify, Id localSize=0)
 
String _tabPrintString (const String &string, const EJustify &justify, Id localSize=0)
 
String _tabPrintDouble (double value, const EJustify &justify, Id localSize=0)
 
String _tabPrintInt (Id value, const EJustify &justify, Id localSize=0)
 
String _tabPrintRowColumn (Id icase, Id value, Id flagAdd)
 
String _printColumnHeader (const VectorString &colnames, Id colfrom, Id colto, Id colSize=_getColumnSize())
 
String _printRowHeader (const VectorString &rownames, Id iy, Id rowSize=_getColumnSize())
 
String _printTrailer (Id ncols, Id nrows, Id ncols_util, Id nrows_util)
 
static _computeStrides (Id ndim, const 1 &dims)
 
static _computeHalf (Id ndim, const 1 &dims)
 
static Id _getIndex (Id ndim, const 1 &strides, const 1 &indices)
 
static void _dimensionRecursion (Id idim, bool verbose, DimLoop &dlp)
 
static _corputVector (Id n, Id b)
 
static double st_mvnphi (const double *z)
 
static void st_mvnlms (double *a, double *b, const Id *infin, double *lower, double *upper)
 
static void st_dkswap (double *x, double *y)
 
static void st_rcswp (const Id *p, const Id *q, double *a, double *b, Id *infin, const Id *n, double *c)
 
static void st_covsrt (Id *n, double *lower, double *upper, double *correl, Id *infin, double *y, Id *infis, double *a, double *b, double *cov, Id *infi)
 
static double st_phinvs (const double *p)
 
static double st_bvu (const double *sh, const double *sk, const double *r)
 
static double st_bvnmvn (double *lower, double *upper, Id *infin, double *correl)
 
static double st_mvndfn_0 (Id n__, Id *n, double *w, double *correl, double *lower, double *upper, Id *infin, Id *infis, double *d, double *e)
 
static double st_mvndnt (Id *n, double *correl, double *lower, double *upper, Id *infin, Id *infis, double *d, double *e)
 
static void st_dkrcht (const Id *s, double *quasi)
 
static void st_dksmrc (Id *ndim, const Id *klim, double *sumkro, const Id *prime, double *vk, double(*functn)(Id *, double *), double *x)
 
static void st_dkbvrc (Id *ndim, Id *minvls, const Id *maxvls, double(*functn)(Id *, double *), const double *abseps, const double *releps, double *abserr, double *finest, Id *inform)
 
static double st_mvndfn (Id *n, double *w)
 
static void st_init_rotation (double *ct, double *st, double *a)
 
static void st_addTriangle (const double v1[3], const double v2[3], const double v3[3], Reg_Coor *R_coor)
 
static void st_normalize (double v[3])
 
void st_subdivide (double v1[3], double v2[3], double v3[3], Id depth, Reg_Coor *R_coor)
 
static Id st_already_present (Reg_Coor *R_coor, Id i0, Id ntri, const 1 &coord, double eps=EPSILON3)
 
std::regex _protectRegexp (const String &match)
 
charTypeT _charType (char c)
 
static void st_combinations (Id *v, Id start, Id n, Id k, Id maxk, Id *ncomb, 1 &comb)
 
static void st_shift (Id rank, Db *dbgrid, const 1 &indg1, const 1 &prop, 1 &indg2, double *weight)
 
static Id st_multilinear_evaluate (DbGrid *db_grid, const 1 &indg, Id iatt, double *value)
 
static double st_multilinear_interpolation (DbGrid *dbgrid, Id iatt, Id distType, const 1 &dmax, const 1 &coor)
 
static double st_distance_modify (DbGrid *dbgrid, Id ig, Db *dbpoint, Id ip, 1 &dvect, Id flag_aniso, Id iatt_time, Id iatt_angle, Id iatt_scaleu, Id iatt_scalev, Id iatt_scalew)
 
void st_get_closest_sample (DbGrid *dbgrid, Id ig, Db *dbpoint, Id ip, Id flag_aniso, Id iatt_time, Id iatt_angle, Id iatt_scaleu, Id iatt_scalev, Id iatt_scalew, Id *ipmin, double *ddmin, 1 &dvect)
 
Id st_next_sample (Id ip0_init, const 1 &rank, const 1 &xtab, double xtarget)
 
static Id st_locate_point_on_grid (const Db *db_point, const DbGrid *db_grid, 1 &coor, 1 &tab)
 
static Id st_locate_coor_on_grid (Id np, const 1 &coords, const DbGrid *db_grid, 1 &tab)
 
static Id st_larger_than_dmax (Id ndim, const 1 &dvect, Id distType, const 1 &dmax)
 
static void st_expand (Id flag_size, DbGrid *dbgrid, 1 &tab1, 1 &indg0, 1 &indg, 1 &tab2)
 
Id expand_point_to_coor (const Db *db1, Id iatt, const 1 &coords, 1 &tab)
 
static double st_distance (Id nvar, const 1 &data1, const 1 &data2, Id index1, Id index2)
 
static void st_randomassign (Id nclusters, Id nech, 1 &clusterid)
 
static void st_printclusterlist (Id nclusters, Id nech, const 1 &clusterid)
 
static void st_printclustercount (Id nclusters, Id nech, const 1 &clusterid)
 
static void st_getclustermeans (const 1 &data, Id nvar, Id nech, Id nclusters, const 1 &clusterid, 1 &cdata, 1 &cmask)
 
static void st_getclustermedian (const 1 &data, Id nvar, Id nech, Id nclusters, const 1 &clusterid, 1 &cdata, 1 &cache)
 
static void st_get_distmatrix (const 1 &data, Id nvar, Id nech, 1 &distmatrix)
 
static void st_getclustermedoids (Id nech, Id nclusters, const 1 &distmatrix, const 1 &clusterid, 1 &centroids, 1 &errors)
 
 kclusters (const 1 &data, Id nvar, Id nech, Id nclusters, Id npass, Id mode, Id verbose)
 
 kmedoids (const 1 &data, Id nvar, Id nech, Id nclusters, Id npass, Id verbose)
 
Id compat_NDIM (Db *db1, Db *db2)
 
void db_grid_print (Db *db)
 
Id get_LOCATOR_NITEM (const Db *db, const ELoc &locatorType)
 
double distance_inter (const Db *db1, const Db *db2, Id iech1, Id iech2, double *dist_vect)
 
double distance_intra (const Db *db, Id iech1, Id iech2, double *dist_vect)
 
double distance_grid (DbGrid *db, Id flag_moins1, Id iech1, Id iech2, double *dist_vect)
 
void db_sample_print (Db *db, Id iech, Id flag_ndim, Id flag_nvar, Id flag_nerr, Id flag_blk)
 
Id db_center (Db *db, double *center)
 
Id db_grid_define_coordinates (DbGrid *db)
 
Id db_gradient_update (Db *db)
 
Id db_selref (Id ndim, const Id *nx, const Id *ref, const double *tabin, double *tabout)
 
Id db_locator_attribute_add (Db *db, const ELoc &locatorType, Id number, Id r_tem, double valinit, Id *iptr)
 
Id db_grid_copy (DbGrid *db1, DbGrid *db2, const Id *ind1, const Id *ind2, Id ncol, Id *cols)
 
Id db_grid_copy_dilate (DbGrid *db1, Id iatt1, DbGrid *db2, Id iatt2, Id mode, const Id *nshift)
 
Id point_to_point (Db *db, const double *coor)
 
Id point_to_grid (const DbGrid *db, const double *coor, Id flag_outside, Id *indg)
 
Id point_to_bench (const DbGrid *db, double *coor, Id flag_outside, Id *indb)
 
Id index_point_to_grid (const Db *dbin, Id iech, Id flag_outside, const DbGrid *dbout, double *coor)
 
Id point_inside_grid (Db *db, Id iech, const DbGrid *dbgrid)
 
void db_monostat (Db *db, Id iatt, double *wtot, double *mean, double *var, double *mini, double *maxi)
 
Id db_proportion (Db *db, DbGrid *dbgrid, Id nfac1max, Id nfac2max, Id *nclout)
 
Id db_merge (Db *db, Id ncol, Id *cols)
 
void db_locators_correct (VectorString &strings, const 1 &current, Id flag_locnew)
 
Id db_prop_read (DbGrid *db, Id ix, Id iy, double *props)
 
Id db_prop_write (DbGrid *db, Id ix, Id iy, double *props)
 
 db_distances_general (Db *db1, Db *db2, Id niso, Id mode, Id flag_same, Id *n1, Id *n2, double *dmin, double *dmax)
 
Id is_grid_multiple (DbGrid *db1, DbGrid *db2)
 
Id db_gradient_modang_to_component (Db *db, Id ang_conv, Id iad_mod, Id iad_ang, Id iad_gx, Id iad_gy)
 
Id db_gradient_component_to_modang (Db *db, Id verbose, Id iad_gx, Id iad_gy, Id iad_mod, Id iad_ang, double scale, double ve)
 
double get_grid_value (DbGrid *dbgrid, Id iptr, 1 &indg, Id ix, Id iy, Id iz)
 
void set_grid_value (DbGrid *dbgrid, Id iptr, 1 &indg, Id ix, Id iy, Id iz, double value)
 
DbGriddb_grid_reduce (DbGrid *db_grid, Id iptr, const Id *margin, const Id *limmin, Id flag_sel, Id flag_copy, Id verbose, double vmin, double vmax)
 
Id db_grid_patch (DbGrid *ss_grid, DbGrid *db_grid, Id iptr_ss, Id iptr_db, Id iptr_rank, Id new_rank, Id oper, Id verbose)
 
Id db_name_identify (Db *db, const String &string)
 
void grid_iterator_init (Grid *grid, const 1 &order)
 
 grid_iterator_next (Grid *grid)
 
static void fft_free (void)
 
static Id factorize (Id nPass, Id *kt)
 
static Id fftradix (double Re[], double Im[], size_t nTotal, size_t nPass, size_t nSpan, Id iSign, Id maxFactors, Id maxPerm)
 
static void st_gradient (1 &param, 1 &lower, 1 &upper, 1 &scale, 1 &tabwgt, MatrixDense &Jr, 1 &param1, 1 &param2, 1 &tabmod1, 1 &tabmod2)
 
static double st_residuals (1 &param, 1 &tabexp, 1 &tabwgt, 1 &tabmod, 1 &residuals)
 
static void st_determine_gauss (MatrixDense &Jr, MatrixSquare &gauss)
 
static double st_norm_hgn (1 &hgn, 1 &scale)
 
static double st_essai (1 &hgnadm, 1 &grad_red, MatrixSquare &gauss_red)
 
static Id st_solve_hgnc (Id npar, const 1 &grad, const MatrixSquare &gauss, 1 &hgnc, Id flaginvsign)
 
static void st_fill_constraints (const MatrixDense &acont, 1 &grad, MatrixSquare &gauss)
 
static Id st_calcul0 (1 &param, 1 &lower, 1 &upper, 1 &scale, const MatrixDense &acont, 1 &tabwgt, 1 &residuals, MatrixDense &Jr, 1 &grad, MatrixSquare &gauss, 1 &hgnc, 1 &param1, 1 &param2, 1 &tabmod1, 1 &tabmod2)
 
static Id st_possibilities (Id npar, MatrixDense &bords, 1 &ai, 1 &hgnc, 1 &flag, 1 &temp)
 
static Id st_define_constraints (Id mode, MatrixDense &bords_red, 1 &ai_red, 1 &hgnc, MatrixDense &consts, 1 &flag, 1 &temp)
 
static void st_minimum (1 &, 1 &flag, MatrixDense &bords_red, const 1 &top, const 1 &bot, 1 &hgnc, 1 &hgnadm)
 
static void st_update_bords (MatrixDense &bords, 1 &ind_util, MatrixDense &bords_red)
 
static Id st_suppress_unused_constraints (MatrixDense &bords, 1 &ai, 1 &grad, MatrixSquare &gauss, 1 &hgnc, 1 &ind_util, MatrixDense &bords_red, 1 &ai_red, 1 &grad_red, MatrixSquare &gauss_red, 1 &flag1, 1 &flag2, 1 &temp)
 
static Id st_establish_minimization (Id nactive, 1 &ind_util, 1 &flag_active, MatrixDense &bords_red, 1 &ai_red, 1 &grad_red, MatrixSquare &gauss_red, Id *lambda_neg, 1 &hgnc, MatrixSquare &a, 1 &b, 1 &temp)
 
static void st_check (1 &ind_util, 1 &hgnc, const MatrixDense &acont)
 
static Id st_minimization_under_constraints (1 &ind_util, MatrixDense &bords_red, 1 &ai_red, 1 &grad_red, MatrixSquare &gauss_red, MatrixDense &consts, 1 &hgnc, 1 &hgnadm, 1 &flag_active, 1 &flag_actaux, MatrixSquare &a, 1 &b1, 1 &b2, 1 &b3, 1 &temp, const MatrixDense &acont)
 
static void st_constraints_init (1 &ind_util, 1 &ai)
 
static void st_define_bounds (1 &param, 1 &lower, 1 &upper, 1 &scale, double delta, MatrixDense &bords)
 
static void st_foxleg_debug_title (void)
 
static void st_foxleg_debug_current (double mscur, double delta, 1 &param)
 
static void st_linear_interpolate (double mscur, 1 &param, const MatrixDense &acont, 1 &tabexp, 1 &tabwgt, MatrixDense &bords, 1 &grad, double *msaux, 1 &paramaux, 1 &residuals, 1 &tabmod1)
 
static Id st_check_param (1 &param, 1 &lower, 1 &upper)
 
Id foxleg_f (Id ndat, Id npar, Id ncont, const MatrixDense &acont, 1 &param, 1 &lower, 1 &upper, 1 &scale, const Option_AutoFit &mauto, Id flag_title, void(*func_evaluate)(Id ndat, Id npar, 1 &param, 1 &work), 1 &tabexp, 1 &tabwgt)
 
static void error (Id flag)
 
Id time_3db (double *HS, double *T, Id NX, Id NY, Id NZ, Id BX, Id BY, Id BZ, double XS, double YS, double ZS, double HS_EPS_INIT, Id MSG)
 
static Id pre_init (void)
 
static Id init_point (void)
 
static void init_nearest (void)
 
static void init_cell (double vx, double vy, double vz, Id xl, Id yl, Id zl)
 
static double init_cellh (double vh, double vv, double hsc, double hsn)
 
static Id recursive_init (void)
 
static Id propagate_point (Id start)
 
static void free_ptrs ()
 
static double exact_delay (double vx, double vy, double vz, Id xm, Id ym, Id zm)
 
static Id t_1d (Id x, Id y, Id z, double t0, double hs0, double hs1, double hs2, double hs3)
 
static Id diff_2d (Id x, Id y, Id z, double t0, double hs0, double hs1)
 
static Id point_diff (Id x, Id y, Id z, double t0, double hs0)
 
static Id t_2d (Id x, Id y, Id z, double t0, double t1, double hs0, double hs1)
 
static Id edge_diff (Id x, Id y, Id z, double t0, double t1, double hs0)
 
static Id t_3d_ (Id x, Id y, Id z, double t0, double tl, double tr, double td, double hs0, Id redundant)
 
static Id t_3d_part1 (Id x, Id y, Id z, double t0, double tl, double tr, double hs0)
 
static Id x_side (Id y_begin, Id y_end, Id z_begin, Id z_end, Id x, Id future)
 
static Id scan_x_ff (Id y_start, Id y_end, Id z_start, Id z_end, Id x0, Id x, Id x_s)
 
static Id scan_x_bf (Id y_begin, Id y_start, Id z_start, Id z_end, Id x0, Id x, Id x_s)
 
static Id scan_x_bb (Id y_begin, Id y_start, Id z_begin, Id z_start, Id x0, Id x, Id x_s)
 
static Id scan_x_fb (Id y_start, Id y_end, Id z_begin, Id z_start, Id x0, Id x, Id x_s)
 
static Id y_side (Id x_begin, Id x_end, Id z_begin, Id z_end, Id y, Id future)
 
static Id scan_y_ff (Id x_start, Id x_end, Id z_start, Id z_end, Id y0, Id y, Id y_s)
 
static Id scan_y_bf (Id x_begin, Id x_start, Id z_start, Id z_end, Id y0, Id y, Id y_s)
 
static Id scan_y_bb (Id x_begin, Id x_start, Id z_begin, Id z_start, Id y0, Id y, Id y_s)
 
static Id scan_y_fb (Id x_start, Id x_end, Id z_begin, Id z_start, Id y0, Id y, Id y_s)
 
static Id z_side (Id x_begin, Id x_end, Id y_begin, Id y_end, Id z, Id future)
 
static Id scan_z_ff (Id x_start, Id x_end, Id y_start, Id y_end, Id z0, Id z, Id z_s)
 
static Id scan_z_bf (Id x_begin, Id x_start, Id y_start, Id y_end, Id z0, Id z, Id z_s)
 
static Id scan_z_bb (Id x_begin, Id x_start, Id y_begin, Id y_start, Id z0, Id z, Id z_s)
 
static Id scan_z_fb (Id x_start, Id x_end, Id y_begin, Id y_start, Id z0, Id z, Id z_s)
 
static void st_print (const char *string)
 
static void st_read (const char *prompt, char *buffer)
 
static void st_exit (void)
 
static Id _stripToken (std::string &token, const char *format)
 
static Id _decodeToken (const std::string &token, const char *format, void *out)
 
static st_core (Id nli, Id nco)
 
static st_relative_position_array (Id neq)
 
static void st_global_init (Db *dbin, Db *dbout)
 
static double st_get_idim (Id loc_rank, Id idim)
 
void set_DBIN (Db *dbin)
 ‍****************************************************************************‍/ *!
 
void set_DBOUT (Db *dbout)
 
static double st_get_ivar (Id rank, Id ivar)
 ‍****************************************************************************‍/ *!
 
static double st_get_verr (Id rank, Id ivar)
 
static Id st_check_environment (Id flag_in, Id flag_out, Model *model)
 
static Id st_model_manage (Id mode, Model *model)
 
static Id st_krige_manage_basic (Id mode, Id nech, Id nmax, Id nvar, Id nfeq)
 
static Id st_get_nmax (ANeigh *neigh)
 
static Id st_krige_manage (Id mode, Id nvar, Model *model, ANeigh *neigh)
 
static Id st_block_discretize_alloc (Id ndim, const 1 &ndiscs)
 
static void st_data_discretize_alloc (Id ndim)
 
static void st_block_discretize (Id mode, Id flag_rand, Id iech)
 
Id krige_koption_manage (Id mode, Id flag_check, const EKrigOpt &calcul, Id flag_rand, const 1 &ndiscs)
 
void krige_lhs_print (Id nech, Id neq, Id nred, const Id *flag, const double *lhs)
 
void krige_rhs_print (Id nvar, Id nech, Id neq, Id nred, const Id *flag, double *rhs)
 
static void st_krige_wgt_print (Id status, Id nvar, Id nvar_m, Id nfeq, const 1 &nbgh_ranks, Id nred, Id icase, const Id *flag, const double *wgt)
 
static void st_result_kriging_print (Id flag_xvalid, Id nvar, Id status)
 
Id _krigsim (Db *dbin, Db *dbout, const Model *model, ANeigh *neigh, bool flag_bayes, const 1 &dmean, const MatrixSymmetric &dcov, Id icase, Id nbsimu, bool flag_dgm)
 
Id global_transitive (DbGrid *dbgrid, Model *model, Id flag_verbose, Id flag_regular, Id ndisc, double *abundance, double *sse, double *cvtrans)
 
static Id st_get_limits (DbGrid *db, double top, double bot, Id *ideb, Id *ifin)
 
static Id st_get_neigh (Id ideb, Id ifin, Id neigh_radius, Id *status, Id *nbefore, Id *nafter)
 
static double st_cov_exp (Id dist, const double *cov, Id cov_radius, Id flag_sym)
 
static void st_lhs_exp (double *covdd, Id cov_radius, Id flag_sym, Id nfeq, Id nbefore, Id nafter, Id neq)
 
static void st_rhs_exp (double *covd0, Id cov_radius, Id flag_sym, Id nfeq, Id nbefore, Id nafter, Id neq)
 
static double st_estim_exp (Db *db, const double *wgt, Id nbefore, Id nafter)
 
Id anakexp_f (DbGrid *db, double *covdd, double *covd0, double top, double bot, Id cov_radius, Id neigh_radius, Id flag_sym, Id nfeq)
 
static void st_calculate_covres (DbGrid *db, Model *model, const double *cov_ref, Id cov_radius, Id flag_sym, const Id cov_ss[3], const Id cov_nn[3], double *cov_res)
 
static void st_calculate_covtot (DbGrid *db, Id ix0, Id iy0, Id flag_sym, const Id cov_ss[3], const Id cov_nn[3], Id *num_tot, double *cov_tot)
 
static st_neigh_find (DbGrid *db, Id ix0, Id iy0, Id iz0, const Id nei_ss[3], const Id nei_nn[3], Id *nei_cur)
 
static Id st_neigh_diff (const Id nei_ss[3], const Id nei_nn[3], Id *nei_ref, const Id *nei_cur)
 
static void st_lhs_exp_3D (Id nech, Id nfeq, const Id nei_ss[3], const Id nei_nn[3], const Id cov_ss[3], const Id cov_nn[3], const Id *nei_cur, const double *cov_tot, double nugget)
 
static void st_rhs_exp_3D (Id nech, Id nfeq, const Id nei_ss[3], const Id nei_nn[3], const Id cov_ss[3], const Id cov_nn[3], const Id *nei_cur, const double *cov_res)
 
static double st_estim_exp_3D (Db *db, const Id nei_ss[3], const Id nei_nn[3], Id *nei_cur, const double *weight)
 
static void st_vario_dump (FILE *file, Id ix0, Id iy0, const Id cov_ss[3], const Id cov_nn[3], const Id *num_tot, const double *cov_tot)
 
Id anakexp_3D (DbGrid *db, double *cov_ref, Id cov_radius, Id neigh_ver, Id neigh_hor, Id flag_sym, Model *model, double nugget, Id nfeq, Id dbg_ix, Id dbg_iy)
 
static st_ranks_other (Id nech, const 1 &ranks1, const 1 &ranks2)
 
static Id st_sampling_krige_data (Db *db, Model *model, double beta, 1 &ranks1, 1 &ranks2, 1 &rother, Id *ntot_arg, Id *nutil_arg, 1 &rutil, 1 &tutil, 1 &invsig)
 
Id st_krige_data (Db *db, Model *model, double beta, 1 &ranks1, 1 &ranks2, 1 &rother, Id flag_abs, double *data_est, double *data_var)
 
Id st_crit_global (Db *db, Model *model, 1 &ranks1, 1 &rother, double *crit)
 
Id sampling_f (Db *db, Model *model, double beta, Id method1, Id nsize1_max, 1 &ranks1, Id method2, Id nsize2_max, 1 &ranks2, Id verbose)
 
Id krigsampling_f (Db *dbin, Db *dbout, Model *model, double beta, 1 &ranks1, 1 &ranks2, bool flag_std, Id verbose)
 
static void st_declustering_stats (Id mode, Id method, Db *db, Id iptr)
 
static void st_declustering_truncate_and_rescale (Db *db, Id iptr)
 
static Id st_declustering_1 (Db *db, Id iptr, const 1 &radius)
 
static Id st_declustering_2 (Db *db, Model *model, ANeigh *neigh, Id iptr)
 
static Id st_declustering_3 (Db *db, Db *dbgrid, Model *model, ANeigh *neigh, const 1 &ndiscs, Id iptr)
 
static st_calcul_covmat (const char *title, Db *db1, Id test_def1, Db *db2, Id test_def2, Model *model)
 
static st_calcul_drfmat (const char *title, Db *db1, Id test_def1, Model *model)
 
static st_calcul_distmat (const char *title, Db *db1, Id test_def1, Db *db2, Id test_def2, double power)
 
static st_calcul_product (const char *title, Id n1, Id ns, const 1 &covss, const 1 &distgen)
 
static st_inhomogeneous_covpp (Db *dbdat, Db *dbsrc, Model *model_dat, const 1 &distps, const 1 &prodps)
 
static st_inhomogeneous_covgp (Db *dbdat, Db *dbsrc, Db *dbout, Id flag_source, Model *model_dat, const double *distps, const double *prodps, const double *prodgs)
 
static st_inhomogeneous_covgg (Db *dbsrc, Db *dbout, Id flag_source, Model *model_dat, const double *distgs, const 1 &prodgs)
 
static Id st_drift_prepar (Id np, Id nbfl, const double *covpp, const double *drftab, 1 &ymat, 1 &zmat)
 
static void st_drift_update (Id np, Id nbfl, const double *covgp, const double *driftg, const double *ymat, double *zmat, double *maux, double *lambda, double *mu)
 
Id inhomogeneous_kriging (Db *dbdat, Db *dbsrc, Db *dbout, double power, Id flag_source, Model *model_dat, Model *model_src)
 
static void st_tableone_manage (CTables *ctables, Id mode, Id rank, Id *nb_used, Id *nb_max)
 
static void st_tableone_getrank (const CTables *ctables, double low, double up, Id *indmin, Id *indmax)
 
static double _getTolInvert ()
 
void matrix_product_safe (Id n1, Id n2, Id n3, const double *v1, const double *v2, double *v3)
 
Id matrix_prod_norme (Id transpose, Id n1, Id n2, const double *v1, const double *a, double *w)
 
void matrix_transpose (Id n1, Id n2, 1 &v1, 1 &w1)
 
Id matrix_invert (double *a, Id neq, Id rank)
 
double matrix_determinant (Id neq, const 1 &b)
 
Id matrix_cholesky_decompose (const double *a, double *tl, Id neq)
 
void matrix_combine (Id nval, double coeffa, const double *a, double coeffb, const double *b, double *c)
 
static LMlayerslmlayers_free (LMlayers *lmlayers)
 
static Id st_get_number_drift (Id irf_rank, Id flag_ext)
 
static LMlayerslmlayers_alloc (Id flag_same, Id flag_vel, Id flag_cumul, Id flag_ext, Id flag_z, Id colrefd, Id colreft, Id colrefb, Id irf_rank, Id match_time, Id nlayers)
 
static void lmlayers_print (LMlayers *lmlayers)
 
static Id st_locate_sample_in_output (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, Id iech, Id *igrid)
 
static void st_check_layer (const char *string, LMlayers *lmlayers, Id ilayer0)
 
static Id st_get_props_result (LMlayers *lmlayers, Db *dbout, Id iech, Id ilayer0, 1 &props)
 
static Id st_get_props_data (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, Id iech, Id ilayer0, 1 &props)
 
static double st_get_drift_result (LMlayers *lmlayers, Db *dbout, Id iech, Id ilayer0)
 
static double st_get_drift_data (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, Id iech, Id ilayer0)
 
static void st_covariance_c00 (LMlayers *lmlayers, Model *model, const 1 &prop1, MatrixSquare &covtab, double *c00)
 
static double st_cij (LMlayers *lmlayers, Model *model, Id ilayer, const 1 &prop1, Id jlayer, const 1 &prop2, const double *dd, MatrixSquare &covtab)
 
static double st_ci0 (LMlayers *lmlayers, Model *model, Id ilayer, const 1 &prop1, Id jlayer, const double *dd, MatrixSquare &covtab)
 
static Id st_drift (LMlayers *lmlayers, const double *coor, double propval, double drext, Id *ipos_loc, 1 &b)
 
static Id st_lhs_one (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, Model *model, 1 &seltab, Id iech0, Id ilayer0, double *coor, 1 &prop0, 1 &prop2, MatrixSquare &covtab, 1 &b)
 
static Id st_rhs (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, Model *model, double *coor, 1 &seltab, Id iechout, Id ilayer0, 1 &prop0, 1 &prop2, MatrixSquare &covtab, 1 &b)
 
static Id st_lhs (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, Model *model, 1 &seltab, 1 &prop1, 1 &prop2, MatrixSquare &covtab, double *a, double *acov)
 
static void st_data_vector (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, 1 &seltab, 1 &zval)
 
static Id st_subtract_optimal_drift (LMlayers *lmlayers, Id verbose, Db *dbin, DbGrid *dbout, 1 &seltab, 1 &zval)
 
static Id st_get_close_sample (LMlayers *lmlayers, Db *dbin, Id iech0, const double *coor)
 
static Id st_collocated_prepare (LMlayers *lmlayers, Id iechout, double *coor, Db *dbin, DbGrid *dbout, Model *model, 1 &seltab, double *a, 1 &zval, 1 &prop1, 1 &prop2, MatrixSquare &covtab, double *b2, 1 &baux, double *ratio)
 
static void st_estimate_regular (LMlayers *lmlayers, Id flag_std, double c00, double *a, 1 &b, double *dual, double *wgt, double *estim, double *stdev)
 
static void st_estimate_bayes (LMlayers *lmlayers, Id flag_std, double c00, const double *acov, 1 &zval, 1 &b, double *wgt, double *post_mean, double *a0, double *cc, double *ss, const double *gs, double *estim, double *stdev)
 
static void st_estimate (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, Model *model, 1 &seltab, Id flag_bayes, Id flag_std, double *a, 1 &zval, double *dual, 1 &prop1, 1 &prop2, MatrixSquare &covtab, 1 &b, double *b2, 1 &baux, double *wgt, double *c00, 1 &, double *a0, double *cc, double *ss, double *gs, double *, double *post_mean)
 
static Id st_check_auxiliary_variables (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, 1 &seltab)
 
static void st_convert_results (LMlayers *lmlayers, Db *dbout, Id flag_std)
 
static Id st_drift_data (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, 1 &seltab, 1 &prop1, 1 &fftab)
 
static Id st_drift_bayes (LMlayers *lmlayers, Id verbose, double *prior_mean, const double *prior_vars, double *acov, 1 &zval, 1 &fftab, double *a0, double *cc, double *ss, double *gs, double *post_mean, double *post_S)
 
Id multilayers_kriging (Db *dbin, DbGrid *dbout, Model *model, ANeigh *neigh, Id flag_same, Id flag_z, Id flag_vel, Id flag_cumul, Id flag_ext, Id flag_std, Id flag_bayes, Id irf_rank, Id match_time, Id dim_prior, double *prior_mean, double *prior_vars, Id colrefd, Id colreft, Id colrefb, Id verbose)
 
static Id st_evaluate_lag (LMlayers *lmlayers, Db *dbin, DbGrid *dbout, Vario_Order *vorder, Id nlayers, Id ifirst, Id ilast, 1 &zval, Id *nval, double *distsum, Id *stat, 1 &phia, 1 &phib, double *atab, double *btab)
 
static Id st_varioexp_chh (LMlayers *lmlayers, Id verbose, Db *dbin, DbGrid *dbout, Vario_Order *vorder, 1 &zval, Id idir, Vario *vario)
 
Id multilayers_vario (Db *dbin, DbGrid *dbout, Vario *vario, Id nlayers, Id flag_vel, Id flag_ext, Id irf_rank, Id match_time, Id colrefd, Id colreft, Id verbose)
 
static Id st_get_prior (Id nech, Id npar, 1 &zval, 1 &fftab, double *mean, double *vars)
 
Id multilayers_get_prior (Db *dbin, DbGrid *dbout, Model *model, Id flag_same, Id flag_vel, Id flag_ext, Id irf_rank, Id match_time, Id colrefd, Id colreft, Id colrefb, Id verbose, Id *npar_arg, 1 &mean, 1 &vars)
 
Modelmodel_duplicate_for_gradient (const Model *model, double ball_radius)
 
void model_cova_characteristics (const ECov &type, char cov_name[STRING_LENGTH], Id *flag_range, Id *flag_param, Id *min_order, Id *max_ndim, Id *flag_int_1d, Id *flag_int_2d, Id *flag_aniso, Id *flag_rotation, double *scale, double *parmax)
 
Modelmodel_combine (const Model *model1, const Model *model2, double r)
 
Id model_covmat_inchol (Id verbose, Db *db, Model *model, double eta, Id npivot_max, Id nsize1, const Id *ranks1, const double *center, Id flag_sort, Id *npivot_arg, 1 &pvec, 1 &Gmatrix, const CovCalcMode *mode)
 
static Id st_velocity_minmax (Id nech, double *vv, double *v0, double *v1, double *vmin, double *vmax)
 
static void st_yxtoxy (Id nx, double dx, double x0, const double *y, Id ny, double dy, double y0, double xylo, double xyhi, double *x)
 
static double dsinc (double x)
 
static void stoepd (Id n, const double *r, const double *g, double *f, double *a)
 
static void st_mksinc (double d, Id lsinc, double *sinc)
 
static void st_intt8r (Id ntable, double table[][LTABLE], Id nxin, double dxin, double fxin, const double *yin, double yinl, double yinr, Id nxout, const double *xout, double *yout)
 
static void st_weights (double table[][LTABLE])
 
static void st_seismic_debug (Id rankz, Id nz, double z0, double dz, Id rankt, Id nt, double t0, double dt, double vmin, double vmax)
 
static void st_copy (Id mode, DbGrid *db, Id iatt, Id ival, double *tab)
 
static Id st_match (DbGrid *db_z, DbGrid *db_t)
 
static void st_seismic_z2t_convert (DbGrid *db_z, Id iatt_z, Id nz, double z0, double, double dz, DbGrid *db_t, Id iatt_t, Id nt, double t0, double t1, double dt, DbGrid *db_v, Id iatt_v, Id natt, double *tz, double *zt, double *at, double *az)
 
static void st_seismic_t2z_convert (DbGrid *db_t, Id iatt_t, Id nt, double t0, double t1, double dt, DbGrid *db_z, Id iatt_z, Id nz, double z0, double z1, double dz, DbGrid *db_v, Id iatt_v, Id natt, double *tz, double *zt, double *at, double *az)
 
static double TR_IN (Db *db, Id iatt_in, Id iatt, Id itrace, Id it)
 
static void TR_OUT (Db *db, Id iatt_out, Id iatt, Id itr, Id it, double value)
 
static Id st_seismic_operate (Db *db, Id oper, Id natt, Id nt, Id iatt_in, Id iatt_out, double dt)
 
static st_seismic_wavelet (Id verbose, Id type, Id ntw, Id tindex, double dt, double fpeak, double period, double amplitude, double distort)
 
static void st_seismic_convolve (Id nx, Id ix0, const double *x, Id ny, Id iy0, const double *y, Id nz, Id iz0, double *z)
 
static void st_seismic_affect (Db *, Id nz, Id shift, double val_before, double val_middle, double val_after, const double *tab0, double *tab1)
 
static void st_seismic_contrast (Id nz, double *tab)
 
static Id st_absolute_index (DbGrid *db, Id ix, Id iz)
 
static void st_sample_remove_central (ST_Seismic_Neigh *ngh)
 
static void st_sample_add (DbGrid *db, Id iatt_z1, Id iatt_z2, Id flag_test, Id ix, Id iz, ST_Seismic_Neigh *ngh)
 
static void st_estimate_check_presence (DbGrid *db, Id ivar, Id *npres, Id *presence)
 
static void st_estimate_neigh_init (ST_Seismic_Neigh *ngh)
 
static ST_Seismic_Neighst_estimate_neigh_management (Id mode, Id nvois, ST_Seismic_Neigh *ngh)
 
static Id st_estimate_neigh_unchanged (ST_Seismic_Neigh *ngh_old, ST_Seismic_Neigh *ngh_cur)
 
static void st_estimate_neigh_copy (ST_Seismic_Neigh *ngh_cur, ST_Seismic_Neigh *ngh_old)
 
static void st_estimate_neigh_print (ST_Seismic_Neigh *ngh, Id ix0, Id iz0)
 
static Id st_estimate_neigh_create (DbGrid *db, Id flag_exc, Id iatt_z1, Id iatt_z2, Id ix0, Id iz0, Id nbench, Id nv2max, Id[2], 1 &presence, ST_Seismic_Neigh *ngh)
 
static void st_estimate_flag (ST_Seismic_Neigh *ngh, Id nfeq, Id *flag, Id *nred)
 
static void st_estimate_var0 (Model *model, double *var0)
 
static void st_estimate_c00 (Model *model, double *c00)
 
static void st_estimate_lhs (ST_Seismic_Neigh *ngh, Model *model, Id nfeq, Id nred, Id *flag, double *lhs)
 
static void st_estimate_rhs (ST_Seismic_Neigh *ngh, Model *model, Id nfeq, Id nred, Id *flag, double *rhs)
 
static void st_wgt_print (ST_Seismic_Neigh *ngh, Id nvar, Id nech, Id nred, const Id *flag, const double *wgt)
 
static Id st_estimate_wgt (ST_Seismic_Neigh *ngh, Model *, Id nred, Id *flag, double *lhs, double *rhs, double *wgt)
 
static void st_estimate_result (Db *db, ST_Seismic_Neigh *ngh, Id flag_std, Id, Id nred, const Id *flag, const double *wgt, const double *rhs, const double *var0, Id *iatt_est, Id *iatt_std)
 
static void st_simulate_result (DbGrid *db, Id ix0, Id iz0, ST_Seismic_Neigh *ngh, Id nbsimu, Id, Id nred, const Id *flag, const double *wgt, const double *rhs, const double *c00, Id *iatt_sim)
 
static Id st_estimate_sort (const Id *presence, Id *rank)
 
static void st_copy_attribute (Db *db, Id nbsimu, Id *iatt)
 
static void st_simulation_environment (void)
 
static Id st_facies (PropDef *propdef, Id ipgs, Id ifac)
 
void simu_func_categorical_transf (Db *db, Id verbose, Id isimu, Id nbsimu)
 
void simu_func_continuous_update (Db *db, Id verbose, Id isimu, Id nbsimu)
 
void simu_func_categorical_update (Db *db, Id verbose, Id isimu, Id nbsimu)
 
void simu_func_continuous_scale (Db *db, Id verbose, Id nbsimu)
 
void simu_func_categorical_scale (Db *db, Id verbose, Id nbsimu)
 
void check_mandatory_attribute (const char *method, Db *db, const ELoc &locatorType)
 
static Id st_keep (Id flag_gaus, Id flag_prop, Id file, Id type)
 
static Id st_check_simtub_environment (Db *dbin, Db *dbout, Model *model, ANeigh *neigh)
 
static void st_suppress_added_samples (Db *db, Id nech)
 
static void st_check_facies_data2grid (Db *dbin, Db *dbout, Id flag_check, Id flag_show, Id ipgs, Id nechin, Id nfacies, Id nbsimu)
 
Id db_simulations_to_ce (Db *db, const ELoc &locatorType, Id nbsimu, Id nvar, Id *iptr_ce_arg, Id *iptr_cstd_arg)
 
Id simtub_constraints (Db *dbin, Db *dbout, Model *model, ANeigh *neigh, Id seed, Id nbtuba, Id nbsimu_min, Id nbsimu_quant, Id niter_max, 1 &cols, Id(*func_valid)(Id flag_grid, Id nDim, Id nech, Id *nx, double *dx, double *x0, double nonval, double percent, 1 &tab))
 
static Id st_maxstable_mask (Db *dbout, double seuil, double scale, Id iptrv, Id iptrs)
 
static void st_maxstable_combine (Db *dbout, double scale, Id iter0, Id iptrg, Id iptrv, Id iptrr, Id *last)
 
Id simmaxstable (Db *dbout, Model *model, double ratio, Id seed, Id nbtuba, Id flag_simu, Id flag_rank, Id verbose)
 
static double st_quantile (Db *dbout, double proba, double *sort)
 
Id simRI (Db *dbout, Model *model, Id ncut, double *zcut, double *wcut, Id seed, Id nbtuba, Id verbose)
 
Id simcond (Db *dbin, Db *dbout, Model *model, Id seed, Id nbsimu, Id nbtuba, Id gibbs_nburn, Id gibbs_niter, Id flag_check, Id flag_ce, Id flag_cstd, Id verbose)
 
static Id st_getTimeInterval (double date, Id ntime, double time0, double dtime)
 
static Id st_getFACIES (const DbGrid *dbgrid, Id nfacies, Id indFacies, Id iech)
 
static double st_getPORO (const DbGrid *dbgrid, Id indPoro, Id iech)
 
static double st_getDATE (const DbGrid *dbgrid, Id indDate, Id iech)
 
static Id st_getFLUID (const DbGrid *dbgrid, Id nfluids, Id indFluid, Id iech)
 
static double st_htop_evaluate ()
 
static void st_get_coordinates (const double *pt_out, Id *ix, Id *iy, SPIMG *image=SPIMG_OUT, bool flag_center=false)
 
static void st_dump (bool flagMain, const String &title, double *pt_out, SPIMG *image)
 
static void st_blank_center (SPIMG *image)
 
static void st_copy_center (Id mode, Id iatt, SPIMG *image, double defval)
 
static void st_extract_center (SPIMG *image, Id iatt)
 
static void st_change (double *pt_out, double value)
 
static void st_convert (double hspill)
 
static SPIMGst_image_free (SPIMG *image)
 
static SPIMGst_image_alloc (double value)
 
static void st_heap_add (double *p)
 
static double * st_heap_del (void)
 
static Id st_traite (double *pt_out, double *pt_vois)
 
static void st_print ()
 
static void st_final_stats (double hspill, Id ix0, Id iy0)
 
Id spill_point (DbGrid *dbgrid, Id ind_depth, Id ind_data, Id option, bool flag_up, Id verbose_step, double hmax, double *h, const double *th, Id *ix0, Id *iy0)
 
static double st_extract_subgrid (Id verbose, Id flag_ffff, Id iech0, Id nech0, Id ntot, DbGrid *dbgrid, Id *ind0, Id *ixyz, Id *nxyz, double *numtab1, double *valtab1)
 
static Id st_divide_by_2 (Id *nxyz, Id orient)
 
static void st_mean_arith (Id idim, const Id *nxyz1, const Id *nxyz2, const double *numtab1, double *numtab2, double *valtab1, double *valtab2)
 
static void st_mean_harmo (Id idim, const Id *nxyz1, const Id *nxyz2, const double *numtab1, double *numtab2, double *valtab1, double *valtab2)
 
static Id st_recopy (const Id *nxyz1, const double *numtab1, const double *valtab1, Id *nxyz2, double *numtab2, double *valtab2)
 
static void st_print_grid (const char *subtitle, Id nxyz[3], double *numtab, double *valtab)
 
static void st_print_upscale (const char *title, Id *nxyz, const double *valtab)
 
static void st_upscale (Id orient, Id *nxyz, Id flag_save, double *numtab0, double *numtab1, double *numtab2, double *valtab0, double *valtab1, double *valtab2, double *res1, double *res2)
 
static Id st_is_subgrid (Id verbose, const char *title, DbGrid *dbgrid1, DbGrid *dbgrid2, Id *ind0, Id *nxyz, Id *ntot)
 
Id db_upscale (DbGrid *dbgrid1, DbGrid *dbgrid2, Id orient, Id verbose)
 
static double st_squared_distance (Id orient, Id ndim, const Id *locini, const Id *loccur)
 
static void st_sample_to_grid (Id ndim, Id ntot, const Id *nxyz, Id iech, Id *indg)
 
static Id st_grid_to_sample (Id ndim, const Id *nxyz, const Id *indg)
 
static Id st_fixed_position (Id ntot, const double *tab, Id cell)
 
static Id st_find_cell (Id ntot, const double *tab, double proba)
 
static void st_migrate_seed (Id ndim, Id n_nbgh, Id *nxyz, const Id *nbgh, double *valwrk, const double *valtab0, Id *locwrk, Id *loccur)
 
static void st_print_position (Id ndim, Id iseed, Id iter, Id *tab)
 
static void st_updiff (Id orient, Id ndim, Id ntot, Id nseed, Id niter, Id n_nbgh, Id flag_save, double probtot, Id *nxyz, Id *nbgh, Id *tabini, Id *tabcur, Id *tabwrk, double *valwrk, double *valtab0, Id verbose, double *cvdist2, double *trsave)
 
static void st_update_regression (double x, double y, double *count, double *sum_x, double *sum_y, double *sum_xx, double *sum_xy)
 
static double st_get_diff_coeff (Id niter, Id verbose, double pmid, Id flag_save, double *cvdist2, double *cvsave)
 
Id db_diffusion (DbGrid *dbgrid1, DbGrid *dbgrid2, Id orient, Id niter, Id nseed, Id seed, Id verbose)
 
Id stats_residuals (Id verbose, Id nech, const double *tab, Id ncut, double *zcut, Id *nsorted, double *mean, double *residuals, double *T, double *Q)
 
static Id st_proportion_locate (PropDef *propdef, Id ifac_ref)
 
static Id st_proportion_transform (PropDef *propdef)
 
static Id st_proportion_changed (PropDef *propdef)
 
static Id st_proportion_define (PropDef *propdef, const Db *db, Id iech, Id isimu, Id nbsimu, Id *jech)
 
Id _db_rule (Db *db, const RuleProp *ruleprop, Model *model, const NamingConvention &namconv)
 
Id db_bounds_shadow (Db *db, Db *dbprop, RuleShadow *rule, Model *model, const 1 &props, Id flag_stat, Id nfacies)
 
Id _db_bounds (Db *db, const RuleProp *ruleprop, Model *model, const NamingConvention &namconv)
 
Id _db_threshold (Db *db, const RuleProp *ruleprop, Model *model, const NamingConvention &namconv)
 
static Id st_match_keypair (const char *keyword, Id flag_exact)
 
static Keypairst_get_keypair_address (const char *keyword)
 
static void st_keypair_attributes (Keypair *keypair, Id mode, Id origin, Id, Id ncol)
 
static void st_keypair_allocate (Keypair *keypair, Id nrow, Id ncol)
 
static void st_keypair_copy (Keypair *keypair, Id type, Id start, void *values)
 
static void del_keypone (Id indice)
 
double ut_distance (Id ndim, const double *tab1, const double *tab2)
 
void ut_distance_allocated (Id ndim, double **tab1, double **tab2)
 
 ut_split_into_two (Id ncolor, Id flag_half, Id verbose, Id *nposs)
 
static Relemst_relem_alloc (Split *old_split)
 
static Splitst_split_alloc (Relem *old_relem)
 
static Id st_define_fipos (Id oper, Id side)
 
static void st_relem_define (Relem *relem, Id nfacies, const 1 &facies, Id side, const Id *poss)
 
static void st_rule_print (Id rank, Id nbyrule, const 1 &rules, const 1 &fipos, bool flag_rank, Id flag_similar, Id flag_igrf, double score)
 
static void st_rules_print (const char *title, Id nrule, Id nbyrule, const 1 &rules, const 1 &fipos)
 
static void st_relem_subdivide (Relem *relem0, Id half, Id noper)
 
static Splitst_split_free (Split *split)
 
static Relemst_relem_free (Relem *relem)
 
static void st_variogram_define_vars (Vario *vario, const Rule *rule, Id ngrf)
 
static void st_set_bounds (Db *db, Id flag_one, Id ngrf, Id nfacies, Id ifac, Id iech, double t1min, double t1max, double t2min, double t2max)
 
static void st_set_rho (double rho, Local_Pgs *local_pgs)
 
static double st_get_proba_ind (double correl, double *low, double *up, Id iconf)
 
static Id st_calculate_thresh_stat (Local_Pgs *local_pgs)
 
static Id st_vario_pgs_variable (Id mode, Id ngrf, Id nfacies, Id flag_one, Id flag_prop, Db *db, PropDef *propdef, const Rule *rule)
 
static Rulest_rule_encode (const Id *string)
 
static double st_extract_trace (Local_Pgs *local_pgs)
 
static void st_variogram_patch_C00 (Local_Pgs *local_pgs, Vario *vario, Id idir, double rho)
 
static void trace_add_row (Local_Pgs *local_pgs)
 
static double st_func_search_stat (double correl, void *user_data)
 
static double st_func_search_nostat (double correl, void *user_data)
 
static void trace_define (Local_Pgs *local_pgs, double value0, double value1, Id origin, Id number, const double *values)
 
static Id st_varcalc_from_vario_stat (Vario *vario, Local_Pgs *local_pgs, Id ngrf)
 
static void st_define_trace (Id flag_rho, Id flag_correl, Local_Pgs *local_pgs)
 
static void st_retrace_define (Local_Pgs *local_pgs)
 
static void st_varcalc_uncorrelated_grf (Local_Pgs *local_pgs, Id idir)
 
static double st_rule_calcul (Local_Pgs *local_pgs, Id *string)
 
static Id st_permut (Id value, Id igrf)
 
static Id st_fipos_encode (1 &fgrf)
 
static void st_fipos_decode (Id fipos, 1 &fgrf)
 
static Id st_update_orientation (Id fac0, Id igrf_cas, 1 &fgrf)
 
static Id st_same_score (Relem *relem, Id ir0, Id igrf_cas, 1 &fgrf, 1 &fcmp)
 
static st_relem_evaluate (Relem *relem, Id verbose, 1 &fgrf, 1 &fcmp, Local_Pgs *local_pgs, Id *nscore, Id *r_opt)
 
static void st_rule_glue (Relem *relem, Id nrule1, Id nbyrule1, const 1 &rules1, const 1 &fipos1)
 
static void st_rule_product (Split *split, Id nprod, Id nrule1, Id nbyrule1, const 1 &rules1, const 1 &fipos1, Id nrule2, Id nbyrule2, const 1 &rules2, const 1 &fipos2)
 
static void st_split_collapse (Split *split, Id verbose)
 
static void st_relem_explore (Relem *relem, Id verbose)
 
static Id invgen (MatrixSymmetric &a, MatrixSymmetric &tabout)
 
static Id st_index (Id i, Id j)
 
static st_compute_params (Local_CorPgs *corpgs, 1 &params_in)
 
static void st_build_correl (Local_CorPgs *corpgs, 1 &params_in, MatrixSymmetric &correl)
 
static void st_update_constraints (Local_CorPgs *corpgs, 1 &Grad, MatrixSymmetric &Hess)
 
static void st_update_constraints_with_JJ (Local_CorPgs *corpgs, 1 &Grad, MatrixSymmetric &Hess, MatrixSymmetric &JJ)
 
static void st_deriv_eigen (Local_CorPgs *corpgs, double eigval, const MatrixSquare *ev, 1 &d1, MatrixSymmetric &d2)
 
static double st_param_expand (Local_Pgs *local_pgs, Id igrf, Id jgrf, Id idir)
 
static void st_set_modif (Local_CorPgs *corpgs)
 
static void st_define_corpgs (Id option, Id flag_rho, double rho, Local_Pgs *local_pgs)
 
static Id st_get_count (Local_Pgs *local_pgs, Id ifac1, Id ifac2)
 
static double st_rkl (Id maxpts, double x, double y, 1 &lower, 1 &upper, MatrixSymmetric &corr1, MatrixSquare &covar, MatrixSquare &temp)
 
static double st_ikl (Id maxpts, Id index1, Id index2, 1 &lower, 1 &upper, MatrixSymmetric &correl)
 
static double st_nkl (1 &u, double lower, double upper, 1 &invvari, Id index2, double meanj, double varj, double stdj)
 
static double st_d2_dkldkl (Id maxpts, Id index1, Id index2, 1 &lower, 1 &upper, MatrixSymmetric &correl)
 
static double st_d2_dkldij (1 &lower, 1 &upper, MatrixSymmetric &correl)
 
static double st_d2_dkldkj (Id index1, Id index2, 1 &lower, 1 &upper, MatrixSymmetric &correl)
 
static double st_calcul_stat (Local_Pgs *local_pgs, Id flag_deriv, Id flag_reset, MatrixSymmetric &correl, 1 &Grad, MatrixSymmetric &Hess, MatrixSymmetric &JJ)
 
static double st_calcul_nostat (Local_Pgs *local_pgs, Id flag_deriv, Id flag_reset, MatrixSymmetric &correl, 1 &Grad, MatrixSymmetric &Hess, MatrixSymmetric &JJ)
 
static double st_calcul (Local_Pgs *local_pgs, Id flag_deriv, Id flag_reset, 1 &params, 1 &Grad, MatrixSymmetric &Hess, MatrixSymmetric &JJ)
 
static void st_initialize_params (Local_CorPgs *corpgs)
 
static double st_optim_onelag_pgs (Local_Pgs *local_pgs, double tolsort, Id new_val)
 
static Id st_discard_point (Local_Pgs *local_pgs, Id iech)
 
static Id st_variogram_geometry_pgs_final (Local_Pgs *local_pgs)
 
static void st_variogram_geometry_pgs_correct (Local_Pgs *local_pgs, Vario *vario, Id idir)
 
static Id st_variogram_geometry_pgs_calcul (Local_Pgs *local_pgs, Vario *vario, Id idir)
 
static void st_set_opt_correl (Id opt, Local_CorPgs *corpgs)
 
static double st_varcalc_correlated_grf (Local_Pgs *local_pgs, Id idir)
 
static void st_manage_corpgs (Local_CorPgs *local_corpgs)
 
static void st_manage_trace (Local_TracePgs *local_tracepgs)
 
static void st_manage_pgs (Id mode, Local_Pgs *local_pgs, Db *db=nullptr, const Rule *rule=nullptr, Vario *vario=nullptr, Vario *varioind=nullptr, Model *model=nullptr, PropDef *propdef=nullptr, Id flag_stat=0, Id flag_facies=0, Id flag_dist=0, Id ngrf=0, Id nfacies=0, const ECalcVario &calcul_type=ECalcVario::UNDEFINED)
 
static Id st_variopgs_calcul_norho (Vario *vario, const Rule *rule, Local_Pgs *local_pgs, Id ngrf, Id opt_correl, Id flag_geometry)
 
static void st_make_some_lags_inactive (Vario *vario)
 
static void st_make_all_lags_active (Vario *vario)
 
static double st_rho_search (double rho, void *user_data)
 
static Id st_variopgs_calcul_rho (Vario *vario, const Rule *rule, Local_Pgs *local_pgs, Id ngrf, Id opt_correl)
 
static Id st_check_test_discret (const ERule &mode, Id flag_rho)
 
static Id st_vario_pgs_check (Id flag_db, Id flag_rule, Id flag_varioind, Db *db, const Db *dbprop, const Vario *vario, Vario *varioind, const Rule *rule)
 
static Id st_variogram_pgs_nostat (Db *db, const Db *dbprop, Vario *vario, const Rule *rule, const 1 &propcst, Id flag_rho, Id opt_correl)
 
static void st_calcul_covmatrix (Local_Pgs *local_pgs, Id *flag_ind, Id *iconf, double *cov)
 
static double st_get_proba (Local_Pgs *local_pgs, Id flag_ind, double *low, double *up, Id *iconf, double *cov)
 
static void st_define_bounds (Local_Pgs *local_pgs, Id iech1, Id iech2, Id ifac1, Id ifac2, double *low, double *up, double *ploc)
 
static double st_get_value (Local_Pgs *local_pgs, Id flag_ind, Id iech1, Id iech2, Id ifac1, Id ifac2, Id *iconf, double *cov)
 
static void st_variogram_scale (Vario *vario, Id idir)
 
static Id st_vario_indic_model_nostat (Local_Pgs *local_pgs)
 
static Id st_copy_swhh (const Vario *vario1, Vario *vario2, bool flagSw, bool flagHh, bool flagGg)
 
static Id st_vario_indic_model_stat (Local_Pgs *local_pgs)
 
static void st_update_variance_stat (Local_Pgs *local_pgs)
 
static void st_update_variance_nostat (Local_Pgs *local_pgs)
 
static Id st_variogram_pgs_stat (Db *db, Vario *vario, Vario *varioind, const Rule *rule, const 1 &propcst)
 
Rule_rule_auto (Db *db, const VarioParam *varioparam, const RuleProp *ruleprop, Id ngrfmax, Id verbose)
 
static double softplus (double x)
 
static double softplusinv (double x)
 
static double softplusDerivative (double x)
 
bool _isValid (ACovFunc *cova, const CovContext &ctxt)
 
bool _isSelected (ACovFunc *cov, Id ndim, Id minorder, bool hasrange, bool flagSimtub, bool flagSimuSpectral)
 
static Id st_code_comparable (const Db *db1, const Db *db2, Id iech, Id jech, Id opt_code, Id tolcode)
 
static void st_grid_fill_neigh (Id ipos, Id ndim, Id radius, Id *nech_loc, Id *tabind, double *tabval)
 
static Id st_grid_fill_calculate (Id ipos, Id mode, Id nech, Id *tabind, const double *tabval)
 
static void st_write_active_sample (Db *db, Id iech, Id nvar, Id *iatt, double *tab)
 
static Id st_read_active_sample (Db *db, Id flag_zero, Id iech, Id nvar, Id *iatt, double eps, double *tab)
 
static Id st_find_interval (double x, Id ndef, const double *X)
 
static void st_grid1D_interpolate_linear (Db *dbgrid, Id ivar, Id ndef, const double *X, const double *Y)
 
static Id st_grid1D_interpolate_spline (Db *dbgrid, Id ivar, Id ndef, const double *X, const double *Y)
 
thread_local viech2 (1)
 
static void _modifyMopForAnam (ModelGeneric *model, ModelOptimParam &mop)
 
static Id _modifyMopForVMap (const DbGrid *dbmap, ModelGeneric *model, Constraints *constraints, ModelOptimParam &mop)
 
static Id _modifyMopForVario (const Vario *vario, ModelGeneric *model, Constraints *constraints, ModelOptimParam &mop)
 
static void _modifyOneParam (const EConsType &cas, ParamInfo *param, double value)
 
static Id _modifyModelForConstraints (Constraints *constraints, ModelGeneric *model)
 
static void _fixAllAnglesFromIndex (CorAniso *coraniso, Id start, bool resetToZero=false)
 
static void _fixAllScalesFromIndex (CorAniso *coraniso, Id start=0)
 
static Id _modifyModelForMop (const ModelOptimParam &mop, ModelGeneric *model)
 
double logLikelihood (const Db *db, ModelGeneric *model, bool verbose)
 
BiTargetCheckGeometrycreate (Id ndim, const 1 &codir, double tolang, double bench, double cylrad, bool flagasym)
 
static double _getRadius (double radius_arg)
 
static double st_convertGeodeticAngle (double, double cosa, double sinb, double cosb, double sinc, double cosc)
 
double util_rotation_gradXYToAngle (double dzoverdx, double dzoverdy)
 
static void _addVerrConstant (MatrixSymmetric &sills, const 1 &verrDef)
 
static void _checkMinNugget (MatrixSymmetric &sills, const 1 &minNug)
 
static MatrixSymmetric _buildSillPartialMatrix (const MatrixSymmetric &sillsRef, Id nvar, Id ndef, const 1 &identity)
 
static Id _loadPositions (Id iech, const 1 &index1, const 1 &cumul, 1 &positions, 1 &identity, Id *rank_arg)
 
static std::vector< std::vector< const IProj * > > castToBase (const std::vector< std::vector< const ProjMatrix * > > &vect)
 
static Id st_load_segment (DbGrid *dbgrid, 1 &mesh, 1 &order, Id ipos, Id ix1, Id ix2)
 
static Id st_load_triangle (DbGrid *dbgrid, 1 &mesh, 1 &order, Id ipos, Id ix1, Id iy1, Id ix2, Id iy2, Id ix3, Id iy3)
 
static Id st_load_tetra (DbGrid *dbgrid, 1 &mesh, 1 &order, Id ipos, Id ix1, Id iy1, Id iz1, Id ix2, Id iy2, Id iz2, Id ix3, Id iy3, Id iz3, Id ix4, Id iy4, Id iz4)
 
static MeshEStandardst_ultimate_regular_grid (Db *dbgrid, Id ndim, Id nmesh, Id ncorner, 1 &meshes, 1 &order)
 
Id add_sill_constraints (Constraints &constraints, double constantSill)
 
static MatrixDense _transformF (const MatrixDense &F1, Id type, Id idx)
 
void _st_morpho_image_radius_define (const 1 &radius)
 
Id _st_morpho_label_size (const 1 &compnum, Id nbcomp, 1 &sizes)
 
void _st_morpho_label_order (1 &compnum, const 1 &order, Id nbcomp)
 
static Id st_to_f (Id x)
 
static short st_to_s (short x)
 
static unsigned short st_to_u (unsigned short a)
 
static Id st_to_i (Id a)
 
static float st_ibm2ieee (const float ibm)
 
static double st_scaling (Id coor, Id scale)
 
static void st_print_traceHead (traceHead *Theader, Id numTrace)
 
static void st_print_BFileHead (binaryFileHeader *Bheader)
 
static binaryFileHeader st_binaryFileHeader_init ()
 
static Id st_readFileHeader (FILE *file, Id verbOption, Id *NPerTrace, double *delta)
 
static Id st_read_trace (FILE *file, Id codefmt, Id numtrace, Id nPerTrace, double delta, Id verbOption, 1 &values, 1 &cotes)
 
static Id st_surface_identify (Id verbOption, Db *surfaces, const String &name_bot, bool flag_bot, Id *iatt_bot, const String &name_top, bool flag_top, Id *iatt_top, const String &aux_top, Id *iaux_top, const String &aux_bot, Id *iaux_bot)
 
static Id st_get_cuts (Db *surfaces, Id rank, Id iatt_top, Id iatt_bot, double, double, double thickmin, double *cztop, double *czbot)
 
static void st_verify_refpt (RefPt refpt[3], RefStats &refstats, Id nbrefpt, double x0, double y0, double dx, double dy, double sint, double cost)
 
static void st_grid_from_3refpt (RefPt refpt[3], RefStats &refstats, double dz, Grid &def_grid)
 
static void st_grid_from_2refpt (RefPt refpt[3], RefStats &refstats, double dz, Grid &def_grid)
 
static Id st_store_refpt (Id nbrefpt, RefPt refpt[3], Id iline, Id xline, double xtrace, double ytrace)
 
static void st_print_grid (const Grid &def_grid)
 
static Id st_complete_squeeze_and_stretch (Id ntab, 1 &tab)
 
static bool st_within_layer (double z0, double delta, double cztop, double czbot, double cote, Id option, Id nz, Id *iz1_ret, Id *iz2_ret, double *cote_ret)
 
static double st_get_average (Id nz, const 1 &writes)
 
static Id st_identify_trace_rank (DbGrid *surfaces, double xtrace, double ytrace)
 
static void st_auxiliary (Db *surfaces, Id rank, Id nz, Id option, double z0, double delta, double czbot, double cztop, Id iaux_bot, Id iaux_top, RefStats &refstats)
 
static Id st_load_trace (Id nPerTrace, Id nz, Id option, double z0, double delta, double czbot, double cztop, const 1 &cotes, const 1 &values, 1 &writes, Id *nbvalues, RefStats &refstats)
 
static void st_print_results (Id nPerTrace, bool flag_surf, double delta, RefStats &refstats)
 
void st_get_trace_params (traceHead *Theader, Id *iline, Id *xline, double *delta, double *xtrace, double *ytrace)
 
static Id st_reject_trace (Id iline, Id xline, Id iline_min, Id iline_max, Id xline_min, Id xline_max)
 
static void st_refstats_update (Id iline, Id xline, double xtrace, double ytrace, RefStats &refstats)
 
static void st_refstats_init (RefStats &refstats, double modif_high, double modif_low, double modif_scale)
 
static traceHead st_traceHead_init ()
 
static void end_line (void)
 
static void open_file (const char *filename)
 
static void close_file (void)
 
static void force_big_endian (unsigned char *bytes)
 
static void write_string (const char *str)
 
static void new_section (void)
 
static void write_int (Id val)
 
static void write_float (float val)
 
static void write_header (void)
 
void write_variables (Id nvars, const Id *vardim, const Id *centering, const char *const *varname, 1 &vars, Id npts, Id ncells)
 
static Id num_points_for_cell (Id celltype)
 
double _convert2u (double yc, double krigest, double krigstd)
 
void _calculateIn (1 &In, double yk, double sk, double u, const 1 &hnYc)
 
void _calculateJJ (MatrixSquare &JJ, 1 &In, double yk, double sk, double u, const 1 &hnYc, const 1 &phi)
 
static void _updateGravityCenter (const 1 &xxs, const 1 &yys, const 1 &zzs, const 1 &wws, std::vector< SpacePoint > &centers, 1 &pa, 1 &pb, 1 &ig, Id found)
 
static SpacePoint _calculateGlobalGravityCenter (const 1 &xxs, const 1 &yys, const 1 &zzs, const 1 &wws, double *patot, double *pbtot)
 
static void _createNewPatch (Id iech, const 1 &xxs, const 1 &yys, const 1 &zzs, const 1 &wws, std::vector< SpacePoint > &centers, 1 &pa, 1 &pb)
 
bool _operStatisticsCheck (const EStatOption &oper, Id flag_multi, Id flag_indic, Id flag_sum, Id flag_median, Id flag_qt)
 
void _updateProportions (DbGrid *dbin, 1 &indg, Id nfacies, 1 &prop)
 
void _updateTransition (DbGrid *dbin, Id pos, 1 &indg, Id nfacies, Id orient, 1 &trans)
 
void _scaleAndAffect (Db *dbout, Id iptr, Id iech, Id nitem, 1 &tab)
 
bool _operExists (const std::vector< EStatOption > &opers, const EStatOption &refe)
 
void _refactor (Id ncol, 1 &tab)
 
void _copyResults (Id nx, Id ny, const 1 &tabin, 1 &tabout)
 
void _neighboringCell (Id ndim, Id radius, Id rank0, const 1 &indg0, 1 &indg)
 
double _getQuantile (1 &tab, Id ntab, double proba)
 
void _getRowname (const String &radix, Id ncol, Id icol, const String &name, String &string)
 
bool _regressionCheck (Db *db1, Id icol0, const 1 &icols, Id mode, Db *db2, const Model *model)
 
bool _regressionLoad (Db *db1, Db *db2, Id iech, Id icol0, const 1 &icols, Id mode, Id flagCst, const Model *model, double *value, 1 &x)
 
void swap (Id *arr, Id i1, Id i2)
 
Id find_node_split_dim (const MatrixT< double > &data, const 1 &node_indices, Id n_features, Id n_points)
 
Id partition_node_indices (const MatrixT< double > &data, Id *node_indices, Id split_dim, Id n_points, Id split_index)
 
void dual_swap (double *darr, Id *iarr, Id i1, Id i2)
 
void simultaneous_sort (double *dist, Id *idx, Id size)
 

Variables

DISABLE_WARNING_NOT_EXPORTED_FROM_DLL DISABLE_WARNING_BASE_NOT_EXPORTED_FROM_DLL typedef std::span< const double > constvect
 
typedef VectorNumT< Id >
 
typedef VectorNumT< double >
 
typedef VectorNumT< float >
 
typedef VectorNumT< UChar >
 
typedef VectorT< 1 >
 
static unsigned char FLAG_RESUME = 1
 Print the Db summary.
 
static unsigned char FLAG_VARS = 2
 Print the Field names.
 
static unsigned char FLAG_EXTEND = 4
 Print the Db extension.
 
static unsigned char FLAG_STATS = 8
 Print the variable statistics.
 
static unsigned char FLAG_ARRAY = 16
 Print the variable contents.
 
static unsigned char FLAG_LOCATOR = 32
 Print the locators.
 
static String FORMAT
 
static String DECODE
 
static String TABSTR
 
thread_local _iwork0
 
thread_local _work1
 
thread_local _work2
 
thread_local Id Random_factor = 105
 
thread_local Id Random_congruent = 20000159
 
thread_local Id Random_value = 43241421
 
thread_local bool Random_Old_Style = true
 
thread_local std::mt19937 Random_gen
 
static double c_b11 = 1.
 
static EDbg _debugOptions = EDbg::DB
 
static work1
 
static work2
 
static size_t SpaceAlloced = 0
 
static size_t MaxPermAlloced = 0
 
static void * Tmp0 = NULL
 
static void * Tmp1 = NULL
 
static void * Tmp2 = NULL
 
static void * Tmp3 = NULL
 
static IdPerm = NULL
 
static Id factor [NFACTOR]
 
static Id VERBOSE_GQO = 0
 
static Id NPAR
 
static Id NPAR2
 
static Id NPARAC
 
static Id NPARAC2
 
static Id NDAT
 
static Id NCONT
 
static Id NPCT
 
static Id NPCT2
 
static Id ITERATION
 
static Id SOUSITER
 
static void(* FUNC_EVALUATE )(Id ndat, Id npar, 1 &param, 1 &work)
 
static Id messages
 
static Id source_at_node = 0
 
static Id init_stage = 0
 
static Id current_side_limit
 
static Id X0
 
static Id X1
 
static Id Y0
 
static Id Y1
 
static Id Z0
 
static Id Z1
 
static Id reverse_order
 
static Id flag_fb
 
static Id x_start_fb
 
static Id y_start_fb
 
static Id z_start_fb
 
static Id flag_bf
 
static Id x_start_bf
 
static Id y_start_bf
 
static Id z_start_bf
 
static Id flag_ff
 
static Id x_start_ff
 
static Id y_start_ff
 
static Id z_start_ff
 
static Id flag_bb
 
static Id x_start_bb
 
static Id y_start_bb
 
static Id z_start_bb
 
static longflags
 local headwave flags.
 
static double hs_eps_init
 
static Id bx
 
static Id by
 
static Id bz
 
static const char * err_msg []
 
static char DEL_COM = '#'
 
static char DEL_BLK = ' '
 
static char DEL_SEP = ' '
 
static void(* WRITE_FUNC )(const char *) = static_cast<void (*)(const char*)>(st_print)
 
static void(* WARN_FUNC )(const char *) = static_cast<void (*)(const char*)>(st_print)
 
static void(* READ_FUNC )(const char *, char *) = st_read
 
static void(* EXIT_FUNC )(void) = st_exit
 
static std::string currentLine
 
static size_t pos = 0
 
static d1_1_global
 
static d1_2_global
 
static covaux_global
 
static var0_global
 
static d1_global
 
static d1_t_global
 
static lhs_global
 
static rhs_global
 
static wgt_global
 
static zam1_global
 
static flag_global
 
static Id KRIGE_INIT = 0
 
static Id MODEL_INIT = 0
 
static Id IECH_OUT = -1
 
static Id FLAG_COLK
 
static Id FLAG_SIMU
 
static Id FLAG_EST
 
static Id FLAG_STD
 
static Id FLAG_VARZ
 
static Id FLAG_PROF
 
static Id IPTR_EST
 
static Id IPTR_STD
 
static Id IPTR_VARZ
 
static Id IPTR_NBGH
 
static IdRANK_COLCOK
 
static DbDBIN
 
static DbDBOUT
 
static Koption KOPTION
 
static Id INH_FLAG_VERBOSE = 0
 
static Id INH_FLAG_LIMIT = 1
 
static String string
 
static CovInternal COVINT
 
Id NDIM_LOCAL = 0
 
 X1_LOCAL
 
 X2_LOCAL
 
static MatrixSquare covtab
 
static double DX
 
static double DZ
 
static Id NX
 
static Id NY
 
static Id NZ
 
static Id NVAR
 
static Id NTRACE
 
static double VFACT = 1000.
 
static Id IECH_OUT = -1
 
static double GIBBS_RHO
 
static double GIBBS_SQR
 
static Modif_Categorical ModCat = {0, {0, 0}, NULL, NULL}
 
static Id SX
 
static Id SY
 
static Id TX
 
static Id TY
 
static Id TXY
 
static Id SXY
 
static Id STEP = 0
 
static Id Hsize = 0
 
static double ** Heap
 
static double HMAX
 
static double HINIT
 
static double HTOP
 
static double BIGVAL
 
static Id Offset_mark_out
 
static Id Offset_out_in
 
static Id SIGNE
 
static Id OPTION
 
static Id VERBOSE_STEP
 
static DbGridDB
 
static SPIMGSPIMG_OUT = nullptr
 
static SPIMGSPIMG_IN = nullptr
 
static SPIMGSPIMG_MARK = nullptr
 
static double * PT_SPILL = nullptr
 
static Id DEBUG = 0
 
static Id KEYPAIR_NTAB = 0
 
static std::vector< KeypairKEYPAIR_TABS
 
static Id DISTANCE_NDIM = 0
 
static DISTANCE_TAB1
 
static DISTANCE_TAB2
 
static Id NWGT [4] = {2, 3, 4, 5}
 
static Id NORWGT [4] = {2, 6, 20, 70}
 
static Id COVWGT [4][5]
 
static bool bessel_Old_Style = false
 
thread_local nbgh_init
 
thread_local jvars
 
static DbGridDB_GRID_FILL
 
static Def_Locator DEF_LOCATOR []
 
thread_local ivars
 
static const VectorString symbol = {"F","S","T"}
 
static const VectorString symbol = {"F", "S", "T"}
 
static Id GAUSS_MODE = 1
 
static I32 _globalMultiThread = 0
 
static bool _flagMatrixCheck = false
 
static Id RADIUS [3]
 
static Id LARGE = 9999999
 
static FILE * fp = NULL
 
static Id useBinary = 0
 
static Id numInColumn = 0
 
 _emptyVec
 
PolyElem _emptyElem
 
static Id invdir [6] = {1, 0, 3, 2, 5, 4}
 
Id _maxiter
 
double _tmax
 
double _background
 
double _facies
 
 _dilate
 
static Id ndir [4] = {0, 2, 4, 6}
 
static Id invdir [6] = {1, 0, 3, 2, 5, 4}
 
static Id id [6][3]
 
static ASpaceSharedPtr defaultSpace = nullptr
 Unique default global space.
 
static Id IECH1
 
static Id IECH2
 
static Id IDIRLOC
 
static Id NWGT [4] = {2, 3, 4, 5}
 
static Id NORWGT [4] = {2, 6, 20, 70}
 
static Id VARWGT [4][5] = {{1, -1, 0, 0, 0}, {1, -2, 1, 0, 0}, {1, -3, 3, -1, 0}, {1, -4, 6, -4, 1}}
 
static Id IPTR
 
static PolygonsPOLYGON = nullptr
 
static IDS
 
static Id IPTV
 
static Id IPTW
 

Detailed Description

Shift Operator for performing the basic tasks of SPDE.

TODO : to be kept ?

Output structure

Gaussian Anamorphosis using Empirical Method

This class is meant in order to construct the transfer function from Raw to Gaussian scale directly based on the data.

It essentially maps the cumulative function (CDF) of the raw values into the CDF of the theoretical Gaussian distribution.

This can be performed directly on the experimental CDF (normal score) or by diluting the data values beforehand. In the latter solution, each (valid) datum is replaced by a small local distribution. This is meant to smooth the stepwise CDF.

The dilution function (implemented at any data point) can be either a Gaussian or a Lognormal one. In the Gaussian case, the variance (width of the dilution function) is considered as constant (either provided by the user or defaulted by the program)* In the lognormal case, the logarithmic variance is constant (hence the width is proportional to the square of the value).

Square Matrix

Multivariate complex Fourier transform, computed in place using mixed-radix Fast Fourier Transform algorithm.

Fortran code by: RC Singleton, Stanford Research Institute, Sept. 1968 NIST Guide to Available Math Software. Source for module FFT from package GO. Retrieved from NETLIB on Wed Jul 5 11:50:07 1995. translated by f2c (version 19950721) and with lots of cleanup to make it resemble C by: MJ Olesen, Queen's University at Kingston, 1995-97

Copyright(c)1995,97 Mark Olesen olese.nosp@m.n@me.nosp@m..Quee.nosp@m.nsU..nosp@m.CA Queen's Univ at Kingston (Canada)

Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software.

THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR QUEEN'S UNIVERSITY AT KINGSTON MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.

All of which is to say that you can do what you like with this source code provided you don't try to sell it as your own and you include an unaltered copy of this message (including the copyright).

It is also implicitly understood that bug fixes and improvements should make their way back to the general Internet community so that everyone benefits.

This variable switches ON/OFF the ability to use Eigen library for Algebra

Typedef Documentation

◆ ASpaceSharedPtr

typedef std::shared_ptr<const ASpace> gstlrn::ASpaceSharedPtr

◆ ASpaceSharedPtrVector

◆ constvectint

using gstlrn::constvectint = typedef std::span<const Id>

◆ covmaptype

typedef std::function<double(const SpacePoint&, const SpacePoint&, Id, Id, const CovCalcMode* calcmode)> gstlrn::covmaptype

◆ DataFrame

using gstlrn::DataFrame = typedef std::map<std::string, std::vector<double> >

◆ hrc

typedef std::chrono::high_resolution_clock gstlrn::hrc

◆ I32

using gstlrn::I32 = typedef int

Secondary integer type. To be used instead of "int". No "int" should be voluntarily introduced in gstlearn.

◆ Id

using gstlrn::Id = typedef long

Main type for gstlearn 64-bits integers, to be used in priority when an integer is needed.

◆ mapNoStat

typedef std::unordered_map<ParamId, std::shared_ptr<ANoStat>, ParamIdHash, ParamIdEqual> gstlrn::mapNoStat

◆ ms

typedef std::chrono::milliseconds gstlrn::ms

◆ operate_function

typedef double(* gstlrn::operate_function) (double)

◆ Relem

typedef struct Local_Relem gstlrn::Relem

◆ sec

typedef std::chrono::duration<double> gstlrn::sec

◆ Sp

using gstlrn::Sp = typedef Eigen::SparseMatrix<double>

◆ Split

typedef struct Local_Split gstlrn::Split

◆ StorageIndex

typedef Eigen::SparseMatrix<double>::StorageIndex gstlrn::StorageIndex

◆ String

typedef std::string gstlrn::String

◆ UChar

typedef unsigned char gstlrn::UChar

◆ vect

typedef std::span<double> gstlrn::vect

◆ vectint

using gstlrn::vectint = typedef std::span<Id>

◆ VectorBool

◆ VectorECov

typedef std::vector<ECov> gstlrn::VectorECov

◆ VectorMeshes

typedef std::vector<const AMesh*> gstlrn::VectorMeshes

◆ VectorString

Enumeration Type Documentation

◆ charTypeT

Enumerator
other 
alpha 
digit 

◆ ENUM_ANAM_QT

Enumerator
ANAM_QT_Z 
ANAM_QT_T 
ANAM_QT_Q 
ANAM_QT_B 
ANAM_QT_M 
ANAM_QT_PROBA 
ANAM_QT_QUANT 
ANAM_N_QT 

◆ ENUM_CONVDIRS

Enumerator
CONV_DIRX 

Along X.

CONV_DIRY 

Along Y.

CONV_DIRZ 

Along Z.

CONV_DIRXY 

Along XY.

CONV_DIRXYZ 

Along XYZ.

◆ ENUM_CONVS

Enumerator
CONV_UNIFORM 

Uniform.

CONV_EXPONENTIAL 

Exponential.

CONV_GAUSSIAN 

Gaussian.

CONV_SINCARD 

Sine Cardinal.

◆ ENUM_CSTS

Enumerator
CST_NTCAR 

Number of characters in printout.

CST_NTDEC 

Number of decimal digits in printout.

CST_NTROW 

Maximum number of rows in table printout.

CST_NTCOL 

Maximum number of columns in table printout.

CST_NPROC 

Display the Progress Bar.

CST_LOCMOD 

Update Locators Option.

CST_LOCNEW 

Delete all similar locators.

CST_RGL 

RGL graphic rendition.

CST_ASP 

Scaling Factor.

CST_TOLINV 

Tolerance for matrix inversion.

CST_TOLGEN 

Tolerance for matrix generalized inversion.

CST_EPSMAT 

Tolerance value for Matrix calculation.

CST_EPSSVD 

Tolerance value for SVD Matrix calculation.

CST_NUMBER 

Maximum number of CST Enums.

◆ ENUM_SEGY

Enumerator
SEGY_NUM 
SEGY_ILINE 
SEGY_XLINE 
SEGY_XTRACE 
SEGY_YTRACE 
SEGY_ZMIN 
SEGY_ZMAX 
SEGY_VMIN 
SEGY_VMAX 
SEGY_THICK 
SEGY_NB 
SEGY_AUXTOP 
SEGY_AUXBOT 
SEGY_COUNT 

◆ ENUM_SEISMICS

Enumerator
SEISMIC_NOP 

No Operation.

SEISMIC_FABS 

Absolute value.

SEISMIC_SSQRT 

Signed square root.

SEISMIC_SQR 

Square.

SEISMIC_SSQR 

Signed square.

SEISMIC_SIGN 

Signum Function.

SEISMIC_EXP 

Exponentiate.

SEISMIC_SLOG 

Signed Natural Log.

SEISMIC_SLOG10 

Signed Common Log.

SEISMIC_COS 

Cosine.

SEISMIC_SIN 

Sine.

SEISMIC_TAN 

Tangent.

SEISMIC_COSH 

Hyperbolic Cosine.

SEISMIC_SINH 

Hyperbolic Sine.

SEISMIC_TANH 

Hyperbolic Tangent.

SEISMIC_NORM 

Divide trace by Max. Value.

SEISMIC_DB 

20 * slog10 (data)

SEISMIC_NEG 

Negate value.

SEISMIC_ONLY_POS 

Pass only positive values.

SEISMIC_ONLY_NEG 

Pass only negative values.

SEISMIC_SUM 

Running sum trace integration.

SEISMIC_DIFF 

Running diff trace differentiation.

SEISMIC_REFL 

(v[i+1] - v[i]) / (v[i+1] + v[i])

SEISMIC_MOD_2PI 

Modulo 2 PI.

SEISMIC_INV 

Inverse.

SEISMIC_AVG 

Remove average value.

◆ ENUM_SHADOWS

Enumerator
SHADOW_IDLE 

No Shadow.

SHADOW_ISLAND 

Island for Shadow.

SHADOW_WATER 

Water for Shadow.

SHADOW_SHADOW 

Shadow.

◆ ENUM_TYPES

Enumerator
TYPE_DB 

Data Base.

TYPE_VARIO 

Experimental variogram.

TYPE_MODEL 

Variogram Model.

TYPE_NEIGH 

Neighborhood.

TYPE_RULE 

Lithotype Rule.

TYPE_ANAM 

Gaussian Anamorphosis.

TYPE_TOKENS 

Object Definition.

TYPE_POLYGON 

Polygon.

TYPE_FRACTURE 

Fracture.

TYPE_PCA 

PCA Transform.

◆ ENUM_WAVELETS

Enumerator
WAVELET_NONE 

No Convolution.

WAVELET_RICKER1 

Ricker wavelet with peak frequency "fpeak".

WAVELET_RICKER2 

Ricker wavelet.

WAVELET_AKB 

Wavelet Alford, Kelly, and Boore.

WAVELET_SPIKE 

Spike.

WAVELET_UNIT 

Constant unit shift.

◆ opt_algorithm

Enumerator
LBFGS 
TNEWTON 
NELDERMEAD 

Function Documentation

◆ _addVerrConstant()

static void gstlrn::_addVerrConstant ( MatrixSymmetric sills,
const 1 &  verrDef 
)
static

◆ _buffer_write()

void gstlrn::_buffer_write ( String buffer,
const char *  format,
va_list  ap 
)

Write the next token into the buffer

Parameters
[in]bufferWriting buffer
[in]formatEncoding format
[in]apva_list to be written

This method is not documented on purpose. It should remain private

◆ _buildFormat()

static void gstlrn::_buildFormat ( Id  mode)
static

◆ _buildSillPartialMatrix()

static MatrixSymmetric gstlrn::_buildSillPartialMatrix ( const MatrixSymmetric sillsRef,
Id  nvar,
Id  ndef,
const 1 &  identity 
)
static

◆ _calculateGlobalGravityCenter()

static SpacePoint gstlrn::_calculateGlobalGravityCenter ( const 1 &  xxs,
const 1 &  yys,
const 1 &  zzs,
const 1 &  wws,
double *  patot,
double *  pbtot 
)
static

◆ _calculateIn()

void gstlrn::_calculateIn ( 1 &  In,
double  yk,
double  sk,
double  u,
const 1 &  hnYc 
)

Calculate In(u,v) = int_u^v H_n(yk + sk * t) g(t) dt (with v = +Inf)

Parameters
InReturned vector (in place)
ykKriged value
skStandard deviation of estimation error
uLower bound of integral (-inf if set to TEST)
hnYcVector of Hermite polynomials at cutoff

◆ _calculateJJ()

void gstlrn::_calculateJJ ( MatrixSquare JJ,
1 &  In,
double  yk,
double  sk,
double  u,
const 1 &  hnYc,
const 1 &  phi 
)

Calculate matrix JJ(n,p) = int_u_v H_n(y+st) H_p(y+st) g(t) dt (with v = +Inf)

Parameters
JJOutput matrix
InPreliminary calculations (see _calculateII)
ykKriged value
skStandard deviation of Krging error
uLower bound for integration
hnYcVector of Hermite polynomials at cutoff
phi

◆ _charType()

charTypeT gstlrn::_charType ( char  c)

◆ _checkMinNugget()

static void gstlrn::_checkMinNugget ( MatrixSymmetric sills,
const 1 &  minNug 
)
static

◆ _computeHalf()

static gstlrn::_computeHalf ( Id  ndim,
const 1 &  dims 
)
static

◆ _computeStrides()

static gstlrn::_computeStrides ( Id  ndim,
const 1 &  dims 
)
static

◆ _conv_exponential()

double gstlrn::_conv_exponential ( double  v)

◆ _conv_gaussian()

double gstlrn::_conv_gaussian ( double  v)

◆ _conv_sincard()

double gstlrn::_conv_sincard ( double  v)

◆ _conv_uniform()

double gstlrn::_conv_uniform ( double  v)

◆ _convert2u()

double gstlrn::_convert2u ( double  yc,
double  krigest,
double  krigstd 
)

◆ _copyResults()

void gstlrn::_copyResults ( Id  nx,
Id  ny,
const 1 &  tabin,
1 &  tabout 
)

Copy the multivariate or monovariate statistics into the returned array

Parameters
[in]nxFirst dimension of the matrix
[in]nyFirst dimension of the matrix
[in]tabinArray to be refactored
[out]taboutArray to be refactored

◆ _corputVector()

static gstlrn::_corputVector ( Id  n,
Id  b 
)
static

Function to compute the Van der Corput sequence

Parameters
nThe number of values to be computed
bThe base in which the numbers are represented
Returns
A vector of first n values of the the Van Der Corput sequence
Note
The base should be a prime number

◆ _createNewPatch()

static void gstlrn::_createNewPatch ( Id  iech,
const 1 &  xxs,
const 1 &  yys,
const 1 &  zzs,
const 1 &  wws,
std::vector< SpacePoint > &  centers,
1 &  pa,
1 &  pb 
)
static

◆ _db_bounds()

Id gstlrn::_db_bounds ( Db db,
const RuleProp ruleprop,
Model model,
const NamingConvention namconv 
)

Apply the Rule transformation to derive the bounds variables for a Db

Returns
Error return code
Parameters
[in]dbDb structure
[in]rulepropRuleProp structure
[in]modelFirst Model structure (only for SHIFT)
[in]namconvNaming convention

◆ _db_rule()

Id gstlrn::_db_rule ( Db db,
const RuleProp ruleprop,
Model model,
const NamingConvention namconv 
)

Apply the Rule transformation to convert a set of Gaussian vectors into the corresponding Facies in a Db

Returns
Error return code
Parameters
[in]dbOutput Db structure
[in]rulepropRuleProp structure
[in]modelFirst Model structure (only for SHIFT)
[in]namconvNaming convention
Remarks
The input variable must be locatorized as Z or ELoc::SIMU

◆ _db_threshold()

Id gstlrn::_db_threshold ( Db db,
const RuleProp ruleprop,
Model model,
const NamingConvention namconv 
)

Calculate all the thresholds at each sample of a Db

Returns
Error return code
Parameters
[in]dbDb structure
[in]rulepropRuleProp structure
[in]modelFirst Model structure (only for SHIFT)
[in]namconvNaming Convention

◆ _decodeToken()

static Id gstlrn::_decodeToken ( const std::string &  token,
const char *  format,
void *  out 
)
static

◆ _dimensionRecursion()

static void gstlrn::_dimensionRecursion ( Id  idim,
bool  verbose,
DimLoop dlp 
)
static

Perform the recursion through the dimension

Parameters
[in]idimSpace rank
[in]verboseVerbose flag
[in]dlpDimLoop structure

◆ _endOfLine()

void gstlrn::_endOfLine ( )

◆ _erase_current_string()

void gstlrn::_erase_current_string ( void  )

◆ _file_get_ncol()

Id gstlrn::_file_get_ncol ( FILE *  file)

◆ _file_open()

FILE * gstlrn::_file_open ( const char *  filename,
Id  mode 
)

Open an ASCII file

Returns
FILE returned pointer
Parameters
[in]filenameLocal file name
[in]modetype of file (OLD or NEW)

This method is not documented on purpose. It should remain private

◆ _file_read()

Id gstlrn::_file_read ( FILE *  file,
const char *  format,
va_list  ap 
)

◆ _file_write()

void gstlrn::_file_write ( FILE *  file,
const char *  format,
va_list  ap 
)

Write the next token from the file

Parameters
[in]fileFILE structure
[in]formatEncoding format
[in]apValue to be written

This method is not documented on purpose. It should remain private

◆ _fixAllAnglesFromIndex()

static void gstlrn::_fixAllAnglesFromIndex ( CorAniso coraniso,
Id  start,
bool  resetToZero = false 
)
static

◆ _fixAllScalesFromIndex()

static void gstlrn::_fixAllScalesFromIndex ( CorAniso coraniso,
Id  start = 0 
)
static

◆ _formatColumn()

std::stringstream gstlrn::_formatColumn ( const EJustify &  justify,
Id  localSize = 0 
)

◆ _getColumnName()

static Id gstlrn::_getColumnName ( )
static

◆ _getColumnRank()

static Id gstlrn::_getColumnRank ( )
static

◆ _getColumnSize()

static Id gstlrn::_getColumnSize ( )
static

◆ _getDecimalNumber()

static Id gstlrn::_getDecimalNumber ( )
static

◆ _getIndex()

static Id gstlrn::_getIndex ( Id  ndim,
const 1 &  strides,
const 1 &  indices 
)
static

◆ _getMaxNCols()

static Id gstlrn::_getMaxNCols ( )
static

◆ _getMaxNRows()

static Id gstlrn::_getMaxNRows ( )
static

◆ _getNBatch()

static Id gstlrn::_getNBatch ( )
static

◆ _getQuantile()

double gstlrn::_getQuantile ( 1 &  tab,
Id  ntab,
double  proba 
)

Calculate the quantile which corresponds to a given probability

Returns
Quantile value
Parameters
[in]tabArray of outcomes per sample
[in]ntabNumber of active values
[in]probaProbability value (between 0 and 1)

◆ _getRadius()

static double gstlrn::_getRadius ( double  radius_arg)
static

◆ _getRowname()

void gstlrn::_getRowname ( const String radix,
Id  ncol,
Id  icol,
const String name,
String string 
)

Constitute the name of the row

Parameters
[in]radixRadix for the different variables (optional)
[in]ncolNumber of variables
[in]icolRank of the variable
[in]nameVariables name
[in]stringString array

◆ _getThresh()

static double gstlrn::_getThresh ( )
static

◆ _getTolInvert()

static double gstlrn::_getTolInvert ( )
static

◆ _introduction()

void gstlrn::_introduction ( const String title,
bool  end_of_line = false 
)

◆ _isSelected()

bool gstlrn::_isSelected ( ACovFunc cov,
Id  ndim,
Id  minorder,
bool  hasrange,
bool  flagSimtub,
bool  flagSimuSpectral 
)

◆ _isValid()

bool gstlrn::_isValid ( ACovFunc cova,
const CovContext ctxt 
)

◆ _krigsim()

Id gstlrn::_krigsim ( Db dbin,
Db dbout,
const Model model,
ANeigh neigh,
bool  flag_bayes,
const 1 &  dmean,
const MatrixSymmetric dcov,
Id  icase,
Id  nbsimu,
bool  flag_dgm 
)

Conditioning Kriging

Returns
Error return code
Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure
[in]modelModel structure
[in]neighANeigh structure
[in]flag_bayes1 if Bayes option is switched ON
[in]dmeanArray giving the prior means for the drift terms
[in]dcovArray containing the prior covariance matrix for the drift terms
[in]icaseCase for PGS and GRF (or -1)
[in]nbsimuNumber of simulations
[in]flag_dgm1 if the DGM version of kriging should be used
Remarks
: The model contains an anamorphosis with a change of support
: coefficient as soon as flag_dgm is TRUE

◆ _lire_double()

double gstlrn::_lire_double ( const char *  question,
Id  flag_def,
double  valdef,
double  valmin,
double  valmax 
)

◆ _lire_int()

Id gstlrn::_lire_int ( const char *  question,
Id  flag_def,
Id  valdef,
Id  valmin,
Id  valmax 
)

◆ _lire_logical()

Id gstlrn::_lire_logical ( const char *  question,
Id  flag_def,
Id  valdef 
)

◆ _lire_string()

void gstlrn::_lire_string ( const char *  question,
Id  flag_def,
const char *  valdef,
char *  answer 
)

◆ _loadPositions()

static Id gstlrn::_loadPositions ( Id  iech,
const 1 &  index1,
const 1 &  cumul,
1 &  positions,
1 &  identity,
Id rank_arg 
)
static

◆ _modifyModelForConstraints()

static Id gstlrn::_modifyModelForConstraints ( Constraints constraints,
ModelGeneric model 
)
static

◆ _modifyModelForMop()

static Id gstlrn::_modifyModelForMop ( const ModelOptimParam mop,
ModelGeneric model 
)
static

◆ _modifyMopForAnam()

static void gstlrn::_modifyMopForAnam ( ModelGeneric model,
ModelOptimParam mop 
)
static

◆ _modifyMopForVario()

static Id gstlrn::_modifyMopForVario ( const Vario vario,
ModelGeneric model,
Constraints constraints,
ModelOptimParam mop 
)
static

Define the options of the structure Opt_Vario

Returns
Error return code
Parameters
[in]varioVario structure containing the exp. variogram
[in]modelModelGeneric structure
[in]constraintsConstraints structure
[out]mopModelOptimParam structure

◆ _modifyMopForVMap()

static Id gstlrn::_modifyMopForVMap ( const DbGrid dbmap,
ModelGeneric model,
Constraints constraints,
ModelOptimParam mop 
)
static

Define the options of the structure ModelOptimParam

Parameters
[in]dbmapDb Grid structure containing the Vmap
[in]modelModelGeneric structure
[in]constraintsConstraints structure
[out]mopModelOptimParam structure

◆ _modifyOneParam()

static void gstlrn::_modifyOneParam ( const EConsType &  cas,
ParamInfo param,
double  value 
)
static

◆ _neighboringCell()

void gstlrn::_neighboringCell ( Id  ndim,
Id  radius,
Id  rank0,
const 1 &  indg0,
1 &  indg 
)

Calculate the indices of the cell neighboring a target cell

Parameters
[in]ndimSpace dimension
[in]radiusNeighborhood radius
[in]rank0Rank of the neighbor
[in]indg0Array of indices of the target cell
[out]indgArray of indices of the neighboring cell

◆ _operExists()

bool gstlrn::_operExists ( const std::vector< EStatOption > &  opers,
const EStatOption &  refe 
)

Check the operator name is mentioned within a list

Returns
true if the operator is mentioned; false otherwise
Parameters
[in]opersArray of operators
[in]refeReference operator
Remarks
If the array 'opers' if empty, any name is considered as valid

◆ _operStatisticsCheck()

bool gstlrn::_operStatisticsCheck ( const EStatOption &  oper,
Id  flag_multi,
Id  flag_indic,
Id  flag_sum,
Id  flag_median,
Id  flag_qt 
)

Check the operator name

Returns
1 if the operator is valid; 0 otherwise
Parameters
[in]operA EStatOption item
[in]flag_multi1 if multivariate operator is authorized
[in]flag_indic1 if indicator ("plus","minus","zero") is authorized
[in]flag_sum1 if sum of variable is authorized
[in]flag_median1 if median is authorized
[in]flag_qt1 if QT ("ore","metal") is authorized
Remarks
If an error occurred, the message is printed

◆ _printColumnHeader()

String gstlrn::_printColumnHeader ( const VectorString colnames,
Id  colfrom,
Id  colto,
Id  colSize = _getColumnSize() 
)

◆ _printDouble()

void gstlrn::_printDouble ( double  value)

◆ _printEmpty()

void gstlrn::_printEmpty ( )

◆ _printInt()

void gstlrn::_printInt ( Id  value)

◆ _printRowHeader()

String gstlrn::_printRowHeader ( const VectorString rownames,
Id  iy,
Id  rowSize = _getColumnSize() 
)

◆ _printString()

void gstlrn::_printString ( const String value)

◆ _printTrailer()

String gstlrn::_printTrailer ( Id  ncols,
Id  nrows,
Id  ncols_util,
Id  nrows_util 
)

◆ _printVectorDouble()

void gstlrn::_printVectorDouble ( const 1 &  values)

◆ _printVectorInt()

void gstlrn::_printVectorInt ( const 1 &  values)

◆ _printVectorString()

void gstlrn::_printVectorString ( const VectorString values)

◆ _printVectorVectorDouble()

void gstlrn::_printVectorVectorDouble ( const 1 &  values)

◆ _printVectorVectorInt()

void gstlrn::_printVectorVectorInt ( const 1 &  values)

◆ _protectRegexp()

std::regex gstlrn::_protectRegexp ( const String match)

Protect the matching pattern against Crash which happens when the string contains "*" without any preceding character

Parameters
matchInitial matching pattern
Returns
The std::regex item used for further comparisons

◆ _record_read()

Id gstlrn::_record_read ( FILE *  file,
const char *  format,
void *  out 
)

Read the next record

Returns
Error return code
Parameters
[in]filePointer to the file to be read
[in]formatEncoding format
[in]outOutput argumentn
Returns
returned arguent: 0 for OK; 1 for error; -1 for EOF This method is not documented on purpose. It should remain private

◆ _refactor()

void gstlrn::_refactor ( Id  ncol,
1 &  tab 
)

Copy the multivariate into monovariate statistics (before printout)

Parameters
[in]ncolDimension of the (square) matrix
[in,out]tabArray to be refactored

◆ _regressionCheck()

bool gstlrn::_regressionCheck ( Db db1,
Id  icol0,
const 1 &  icols,
Id  mode,
Db db2,
const Model model 
)

◆ _regressionLoad()

bool gstlrn::_regressionLoad ( Db db1,
Db db2,
Id  iech,
Id  icol0,
const 1 &  icols,
Id  mode,
Id  flagCst,
const Model model,
double *  value,
1 &  x 
)

◆ _rule_auto()

Rule * gstlrn::_rule_auto ( Db db,
const VarioParam varioparam,
const RuleProp ruleprop,
Id  ngrfmax,
Id  verbose 
)

Find the optimal Truncation Scheme from Variopgs score

Returns
The newly created Rule structure
Parameters
[in]dbDb structure
[in]varioparamVarioParam structure for the GRFs
[in]rulepropRuleProp structure
[in]ngrfmaxMaximum number of underlying GRFs (1 or 2)
[in]verboseVerbose flag

◆ _scaleAndAffect()

void gstlrn::_scaleAndAffect ( Db dbout,
Id  iptr,
Id  iech,
Id  nitem,
1 &  tab 
)

Scale the proportions and store the proportions

Parameters
[in]dboutDb for the output grid
[in]iptrWriting pointer
[in]iechRank of the target sample
[in]nitemNumber of items
[in]tabArray of cumulative statistics

◆ _st_morpho_image_radius_define()

void gstlrn::_st_morpho_image_radius_define ( const 1 &  radius)

Defines the image radius (global variables)

Parameters
[in]radiusRadius of the structural element

◆ _st_morpho_label_order()

void gstlrn::_st_morpho_label_order ( 1 &  compnum,
const 1 &  order,
Id  nbcomp 
)

Orders the connected components using a rank array

Parameters
[in]compnumarray containing the component index
[in]orderarray containing the ordering criterion
[in]nbcompnumber of connected components

◆ _st_morpho_label_size()

Id gstlrn::_st_morpho_label_size ( const 1 &  compnum,
Id  nbcomp,
1 &  sizes 
)

Returns the sizes of all the connected components

Returns
Total volume of the measured connected components
Parameters
[in]compnumarray containing the component index
[in]nbcompnumber of connected components to be measured
[out]sizesarray containing the sizes of the connected components labelled from 1 to nbcomp

◆ _stripToken()

static Id gstlrn::_stripToken ( std::string &  token,
const char *  format 
)
static

◆ _tabPrintDouble()

String gstlrn::_tabPrintDouble ( double  value,
const EJustify &  justify,
Id  localSize = 0 
)

◆ _tabPrintInt()

String gstlrn::_tabPrintInt ( Id  value,
const EJustify &  justify,
Id  localSize = 0 
)

◆ _tabPrintRowColumn()

String gstlrn::_tabPrintRowColumn ( Id  icase,
Id  value,
Id  flagAdd 
)

◆ _tabPrintString()

String gstlrn::_tabPrintString ( const String string,
const EJustify &  justify,
Id  localSize = 0 
)

◆ _tape_cubic()

double gstlrn::_tape_cubic ( double  h)

◆ _tape_penta()

double gstlrn::_tape_penta ( double  h)

◆ _tape_spherical()

double gstlrn::_tape_spherical ( double  h)

◆ _tape_storkey()

double gstlrn::_tape_storkey ( double  h)

◆ _tape_triangle()

double gstlrn::_tape_triangle ( double  h)

◆ _tape_wendland1()

double gstlrn::_tape_wendland1 ( double  h)

◆ _tape_wendland2()

double gstlrn::_tape_wendland2 ( double  h)

◆ _test()

void gstlrn::_test ( )

◆ _token_delimitors()

void gstlrn::_token_delimitors ( const char  del_com,
const char  del_sep,
const char  del_blk 
)

Define the file delimitors

Parameters
[in]del_comDelimitor for comments
[in]del_sepDelimitor for separator
[in]del_blkDelimitor for blank

This method is not documented on purpose. It should remain private

◆ _transformF()

static MatrixDense gstlrn::_transformF ( const MatrixDense F1,
Id  type,
Id  idx 
)
static

◆ _updateGravityCenter()

static void gstlrn::_updateGravityCenter ( const 1 &  xxs,
const 1 &  yys,
const 1 &  zzs,
const 1 &  wws,
std::vector< SpacePoint > &  centers,
1 &  pa,
1 &  pb,
1 &  ig,
Id  found 
)
static

◆ _updateProportions()

void gstlrn::_updateProportions ( DbGrid dbin,
1 &  indg,
Id  nfacies,
1 &  prop 
)

Update the proportions

Parameters
[in]dbinDb for the input grid
[in]indgArray of grid indices
[in]nfaciesNumber of facies
[out]propArray of proportions

◆ _updateTransition()

void gstlrn::_updateTransition ( DbGrid dbin,
Id  pos,
1 &  indg,
Id  nfacies,
Id  orient,
1 &  trans 
)

Update the transitions

Parameters
[in]dbinDbGrid for the input grid
[in]posRank of the montee axis
[in]indgArray of grid indices
[in]nfaciesNumber of facies
[in]orientOrientation
[out]transArray of transitions

◆ acknowledge_gstlearn()

void gstlrn::acknowledge_gstlearn ( void  )

Acknowledgment of the authors for gstlearn Library

◆ add_sill_constraints()

Id gstlrn::add_sill_constraints ( Constraints constraints,
double  constantSill 
)

Add constraints to the Option_AutoFit structure

Returns
Error return code
Parameters
[in]constraintsConstraints structure
[in]constantSillConstant value for the Sill as a constraint

◆ add_unit_sill_constraints()

Id gstlrn::add_unit_sill_constraints ( Constraints constraints)

Add constraints (all equal to 1) to the Option_AutoFit structure

Returns
Error return code
Parameters
[in]constraintsConstraints structure

◆ anakexp_3D()

Id gstlrn::anakexp_3D ( DbGrid db,
double *  cov_ref,
Id  cov_radius,
Id  neigh_ver,
Id  neigh_hor,
Id  flag_sym,
Model model,
double  nugget,
Id  nfeq,
Id  dbg_ix,
Id  dbg_iy 
)

Factorial Kriging analysis on a grid file using discretized covariances for the target variable. The discretized covariance of the total variable is calculated on the fly

Returns
Error return code
Parameters
[in]dbinput Db structure
[in]cov_refArray of discretized covariance for target variable
[in]cov_radiusRadius of the covariance array
[in]neigh_verRadius of the Neighborhood along Vertical
[in]neigh_horRadius of the Neighborhood along Horizontal
[in]flag_sym1 for symmetrized covariance
[in]modelModel structure (only used for horizontal)
[in]nuggetAdditional Nugget Effect component
[in]nfeq0 or 1 drift function(s)
[in]dbg_ixRank of the trace along X for variogram debug
[in]dbg_iyRank of the trace along Y for variogram debug
Remarks
The discretized covariance of the target variable is provided
in 1-D along the vertical. Its extension to the space dimension
is performed using the theoretical factorized model
If dbg_ix < -1 || dbg_iy < -1, no variogram debug file is created

◆ anakexp_f()

Id gstlrn::anakexp_f ( DbGrid db,
double *  covdd,
double *  covd0,
double  top,
double  bot,
Id  cov_radius,
Id  neigh_radius,
Id  flag_sym,
Id  nfeq 
)

Factorial Kriging analysis on a 1-D grid file using discretized covariances for total and partial variables

Returns
Error return code
Parameters
[in]dbinput Db structure
[in]covddArray of discretized cov. for total variable
[in]covd0Array of discretized cov. for partial variable
[in]topElevation of the Top variable
[in]botElevation of the bottom variable
[in]cov_radiusRadius of the Covariance arrays
[in]neigh_radiusRadius of the Neighborhood
[in]flag_sym1 for symmetrized covariance
[in]nfeq0 or 1 drift function(s)

◆ anamPointToBlock()

Id gstlrn::anamPointToBlock ( AAnam anam,
Id  verbose,
double  cvv,
double  coeff,
double  mu 
)

Transform a point anamorphosis into a block anamorphosis

Returns
Error return code
Parameters
[in]anamPoint anamorphosis -> Block anamorphosis [out]
[in]verboseVerbose option
[in]cvvBlock variance
[in]coeffCoefficient of change of support
[in]muAdditional coefficient for Discrete case
Remarks
If 'coeff' is provided, it is used directly ('cvv' is ignored)
Otherwise, it is derived from 'cvv'

◆ app_keypair()

void gstlrn::app_keypair ( const char *  keyword,
Id  origin,
Id  nrow,
Id  ncol,
double *  values 
)

Deposit a keypair (double values) - Append to existing array

Parameters
[in]keywordKeyword
[in]origin1 from C; 2 from R
[in]nrowNumber of rows
[in]ncolNumber of columns
[in]valuesArray of values (Dimension: nrow * ncol)
Remarks
Appending extends the number of rows but keeps the number of
columns and the origin unchanged... otherwise fatal error is issued

◆ app_keypair_int()

void gstlrn::app_keypair_int ( const char *  keyword,
Id  origin,
Id  nrow,
Id  ncol,
Id values 
)

Deposit a keypair (doubleinteger values) - Append to existing array

Parameters
[in]keywordKeyword
[in]origin1 from C; 2 from R
[in]nrowNumber of rows
[in]ncolNumber of columns
[in]valuesArray of values (Dimension: nrow * ncol)
Remarks
Appending extends the number of rows but keeps the number of
columns and the origin unchanged ... otherwise fatal error is issued

◆ argumentDefTestDbl()

void gstlrn::argumentDefTestDbl ( double  argDbl = 2.)

◆ argumentDefTestInt()

void gstlrn::argumentDefTestInt ( Id  argInt = 2)

◆ argumentDefTestStr()

void gstlrn::argumentDefTestStr ( const String argstr = "Default String")

◆ argumentDefTestVDbl()

void gstlrn::argumentDefTestVDbl ( const 1 &  argVDbl = 1())

◆ argumentDefTestVInt()

void gstlrn::argumentDefTestVInt ( const 1 &  argVInt = 1())

◆ argumentDefTestVString()

void gstlrn::argumentDefTestVString ( const VectorString argVString = VectorString())

◆ argumentDefTestVVDbl()

void gstlrn::argumentDefTestVVDbl ( argVVDbl = 1())

◆ argumentDefTestVVInt()

void gstlrn::argumentDefTestVVInt ( argVVInt = 1())

◆ argumentReturnDouble()

double gstlrn::argumentReturnDouble ( double  value)

◆ argumentReturnInt()

Id gstlrn::argumentReturnInt ( Id  value)

◆ argumentReturnMatrix()

MatrixDense gstlrn::argumentReturnMatrix ( Id  nrows = 2,
Id  ncols = 3,
Id  seed = 1312 
)

◆ argumentReturnMatrixSparse()

MatrixSparse gstlrn::argumentReturnMatrixSparse ( Id  nrows = 2,
Id  ncols = 3,
double  zeroPercent = 0.1,
Id  seed = 1356 
)

◆ argumentReturnVectorDouble()

gstlrn::argumentReturnVectorDouble ( const 1 &  values)

◆ argumentReturnVectorInt()

gstlrn::argumentReturnVectorInt ( const 1 &  values)

◆ argumentReturnVectorVectorDouble()

gstlrn::argumentReturnVectorVectorDouble ( const 1 &  values)

◆ argumentReturnVectorVectorInt()

gstlrn::argumentReturnVectorVectorInt ( const 1 &  values)

◆ argumentTestDouble()

void gstlrn::argumentTestDouble ( double  value)

Function to test Double argument

Parameters
valueDouble input argument

◆ argumentTestDoubleOverload() [1/2]

void gstlrn::argumentTestDoubleOverload ( const 1 &  values)

◆ argumentTestDoubleOverload() [2/2]

void gstlrn::argumentTestDoubleOverload ( double  value)

◆ argumentTestEnum()

void gstlrn::argumentTestEnum ( const ETests &  value)

◆ argumentTestInt()

void gstlrn::argumentTestInt ( Id  value)

Function to test Integer argument

Parameters
valueInteger input argument

◆ argumentTestIntOverload() [1/2]

void gstlrn::argumentTestIntOverload ( const 1 &  values)

◆ argumentTestIntOverload() [2/2]

void gstlrn::argumentTestIntOverload ( Id  value)

◆ argumentTestMatrixDense()

void gstlrn::argumentTestMatrixDense ( const MatrixDense mat = MatrixDense())

◆ argumentTestMatrixSparse()

void gstlrn::argumentTestMatrixSparse ( const MatrixSparse mat = MatrixSparse())

◆ argumentTestMatrixSquare()

void gstlrn::argumentTestMatrixSquare ( const MatrixSquare mat = MatrixSquare())

◆ argumentTestMatrixSymmetric()

void gstlrn::argumentTestMatrixSymmetric ( const MatrixSymmetric mat = MatrixSymmetric())

◆ argumentTestString()

void gstlrn::argumentTestString ( const String value)

◆ argumentTestStringOverload() [1/2]

void gstlrn::argumentTestStringOverload ( const String value)

◆ argumentTestStringOverload() [2/2]

void gstlrn::argumentTestStringOverload ( const VectorString values)

◆ argumentTestVectorDouble()

void gstlrn::argumentTestVectorDouble ( const 1 &  values)

◆ argumentTestVectorInt()

void gstlrn::argumentTestVectorInt ( const 1 &  values)

◆ argumentTestVectorString()

void gstlrn::argumentTestVectorString ( const VectorString values)

◆ argumentTestVectorVectorDouble()

void gstlrn::argumentTestVectorVectorDouble ( const 1 &  values)

◆ argumentTestVectorVectorInt()

void gstlrn::argumentTestVectorVectorInt ( const 1 &  values)

◆ ascii_environ_read()

void gstlrn::ascii_environ_read ( String filename,
bool  verbose 
)

◆ ascii_filename()

void gstlrn::ascii_filename ( const char *  type,
Id  rank,
Id  mode,
String filename 
)

◆ ascii_option_defined()

bool gstlrn::ascii_option_defined ( const String filename,
const char *  option_name,
Id answer,
bool  verbose = false 
)

◆ ascii_simu_read()

void gstlrn::ascii_simu_read ( String filename,
bool  verbose,
Id nbsimu,
Id nbtuba,
Id seed 
)

◆ ascii_study_define()

void gstlrn::ascii_study_define ( const char *  study)

◆ askBool()

Id gstlrn::askBool ( const String text,
bool  defval 
)

Ask interactively for the value of one boolean

Parameters
textText of the question
defvalDefault value

◆ askDouble()

double gstlrn::askDouble ( const String text,
double  defval,
bool  authTest 
)

Ask interactively for the value of one Real (Double value)

Parameters
textText of the question
defvalDefault value (or IFFFF)
authTestTrue if a TEST answer is authorized (TEST)

◆ askInt()

Id gstlrn::askInt ( const String text,
Id  defval,
bool  authTest 
)

Ask interactively for the value of one integer

Parameters
textText of the question
defvalDefault value (or IFFFF)
authTestTrue if TEST value is authorized (TEST)

◆ AtMA()

Eigen::SparseMatrix< double > gstlrn::AtMA ( const Eigen::SparseMatrix< double > &  A,
const Eigen::SparseMatrix< double > &  M 
)

◆ bessel_set_old_style()

void gstlrn::bessel_set_old_style ( bool  style)

◆ besselj()

double gstlrn::besselj ( double  x,
Id  n 
)

◆ besselj_table()

Id gstlrn::besselj_table ( double  x,
double  alpha,
Id  nb,
double *  b 
)

This routine calculates Bessel functions J SUB(NB+ALPHA) (X) for non-negative argument X, and non-negative order NB+ALPHA.

Returns
Error return code : NCALC
NCALC < -1: An argument is out of range.
1 < NCALC < NB: Not all requested function values could be calculated accurately.
BY(I) contains correct function values
Parameters
[in]xWorking precision non-negative real argument for which J's are to be calculated.
[in]alphaWorking precision fractional part of order for which J's are to be calculated. 0 <= ALPHA < 1.0.
[in]nbInteger number of functions to be calculated, NB > 0 The first function calculated is of order ALPHA, and the last is of order (NB - 1 + ALPHA).
[out]bWorking precision output vector of length NB. If the routine terminates normally (NCALC=NB), the vector b[] contains the functions Y(ALPHA,X), ... ,Y(NB-1+ALPHA,X),
Remarks
This program is based on a program written by David J. Sookne (2)
that computes values of the Bessel functions J or I of real
argument and integer order. Modifications include the
restriction of the computation to the J Bessel function of
non-negative real argument, the extension of the computation to
arbitrary positive order, and the elimination of most underflow.
References: "A Note on Backward Recurrence Algorithms," Olver, F.
W. J., and Sookne, D. J., Math. Comp. 26, 1972, pp 941-947.
"Bessel Functions of Real Argument and Integer Order," Sookne, D.
J., NBS Jour. of Res. B. 77B, 1973, pp 125-132.

◆ besselk()

Id gstlrn::besselk ( double  x,
double  alpha,
Id  nb,
double *  bk 
)

This routine calculates modified Bessel functions of the second kind, K SUB(N+ALPHA) (X), for non-negative argument X and non-negative order N+ALPHA

Returns
Error return code :
NCALC < -1: An argument is out of range.
0 < NCALC < NB: Not all requested function values could be calculated accurately.
BK(I) contains correct function values for I <= NCALC, and contains the ratios
K(ALPHA+I-1,X)/K(ALPHA+I-2,X) for the rest of the array.
Parameters
[in]xWorking precision non-negative real argument for which K's are to calculated. If K's are to be calculated, X must not be greater than XMAX.
[in]alphaWorking precision fractional part of order for which K's are to be calculated. 0 <= ALPHA <1.0.
[in]nbInteger number of functions to be calculated, NB > 0. The first function calculated is of order ALPHA, and the last is of order (NB - 1 + ALPHA).
[out]bkWorking precision output vector of length NB. If the routine terminates normally (NCALC=NB), the vector BK contains the functions : K(ALPHA,X), ... , K(NB-1+ALPHA,X),
Remarks
This program is based on a program written by J. B. Campbell (2)
that computes values of the Bessel functions K of real argument
and real order. References: "On Temme's Algorithm for the \remark Modified Bessel Functions of the Third Kind," Campbell, J. B.,
TOMS 6(4), Dec. 1980, pp. 581-586. "A FORTRAN IV Subroutine for \remark the Modified Bessel Functions of the Third Kind of Real Order and \remark Real Argument," Campbell, J. B., Report NRC/ERB-925, National
Research Council, Canada.

◆ buildDbFromVarioParam()

Db * gstlrn::buildDbFromVarioParam ( Db db,
const VarioParam varioparam 
)

Establish a new Db containing the pairs of the Variogram

Returns
Pointer to the newly created Db
Parameters
[in]dbDb structure
[in]varioparamVarioParam structure

◆ buildInvNugget()

std::shared_ptr< MatrixSparse > gstlrn::buildInvNugget ( Db dbin,
Model model,
const SPDEParam params = SPDEParam() 
)

◆ castToBase()

static std::vector< std::vector< const IProj * > > gstlrn::castToBase ( const std::vector< std::vector< const ProjMatrix * > > &  vect)
static

◆ check_mandatory_attribute()

void gstlrn::check_mandatory_attribute ( const char *  method,
Db db,
const ELoc &  locatorType 
)

Check for the presence of mandatory attributes

Parameters
[in]methodName of the method
[in]dbDb structure
[in]locatorTypeMandatory attribute type

◆ checkArg()

bool gstlrn::checkArg ( const char *  title,
Id  current,
Id  nmax 
)

◆ close_file()

static void gstlrn::close_file ( void  )
static

◆ compat_NDIM()

Id gstlrn::compat_NDIM ( Db db1,
Db db2 
)

Checks if Space Dimension of the first Db is at least equal to the Space dimension of the second Db

Returns
Error return code (1 for correct and 0 otherwise).
If an error is found, a message is issued
Parameters
[in]db1first Db descriptor (usually dbin)
[in]db2second Db descriptor (usually dbout)
Remarks
This function checks that the we can perform an operation
(i.e. migration) of a 2D data set onto a 3D one.
The opposite is not correct.

◆ computeCovMatSVCLHSInPlace()

Id gstlrn::computeCovMatSVCLHSInPlace ( MatrixSymmetric cov,
const MatrixSymmetric Sigma,
const MatrixDense F1,
Id  type = 1,
Id  idx = 0 
)

◆ computeCovMatSVCRHSInPlace()

Id gstlrn::computeCovMatSVCRHSInPlace ( MatrixDense cov,
const MatrixSymmetric Sigma,
const MatrixDense F1,
const MatrixDense F2,
Id  type1 = 1,
Id  idx1 = 0,
Id  type2 = 1,
Id  idx2 = 0 
)

◆ computeDriftMatSVCRHSInPlace()

Id gstlrn::computeDriftMatSVCRHSInPlace ( MatrixDense mat,
const MatrixDense F,
Id  type = 1,
Id  idx = 0,
bool  flagCenteredFactors = true 
)

◆ concatenateString()

String gstlrn::concatenateString ( const String string,
double  value,
const String delim = "-" 
)

◆ concatenateStrings()

String gstlrn::concatenateStrings ( const String delimt = ".",
const String string1 = "",
const String string2 = "",
const String string3 = "",
const String string4 = "" 
)

◆ condexp()

gstlrn::condexp ( Db db1,
Db db2,
Id  icol1,
Id  icol2,
double  mini,
double  maxi,
Id  nclass,
bool  verbose 
)

Evaluate the experimental conditional expectation

Parameters
[in]db1Db descriptor (for target variable)
[in]db2Db descriptor (for auxiliary variables)
[in]icol1Rank of the target variable
[in]icol2Rank of the explanatory variable
[in]miniMinimum value for the explanaroty variable
[in]maxiMaximum value for the explanaroty variable
[in]nclassNumber of classes
[in]verboseVerbose flag

◆ ConditionalExpectation()

Id gstlrn::ConditionalExpectation ( Db db,
AAnam anam,
Selectivity selectivity,
const String name_est,
const String name_std,
bool  flag_OK,
double  proba,
Id  nbsimu,
const NamingConvention namconv 
)

Calculate the Conditional Expectation

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]anamPoint anamorphosis
[in]selectivitySelectivity structure
[in]name_estName of the Kriging estimate
[in]name_stdName of the Kriging St. deviation
[in]flag_OK1 if kriging has ben performed in Ordinary Kriging
[in]probaProbability
[in]nbsimuNumber of Simulation outcomes
[in]namconvNaming convention

◆ constraints_get()

double gstlrn::constraints_get ( const Constraints constraints,
const EConsType &  icase,
Id  igrf,
Id  icov,
const EConsElem &  icons,
Id  iv1,
Id  iv2 
)

Return the constraint value (if defined) or TEST

Returns
Returned value or TEST
Parameters
[in,out]constraintsConstraints structure
[in]icaseParameter type (EConsType)
[in]igrfRank of the Gaussian Random Function
[in]icovRank of the structure (starting from 0)
[in]iconsType of the constraint (EConsElem)
[in]iv1Rank of the first variable
[in]iv2Rank of the second variable

◆ constraints_print()

void gstlrn::constraints_print ( const Constraints constraints)

Print the Auto Fitting Constraints Structure

Parameters
[in]constraintsConstraints structure

◆ contingencyTable()

std::map< Id, Id > gstlrn::contingencyTable ( const 1 &  values)

◆ contingencyTable2()

std::map< Id, std::map< Id, Id > > gstlrn::contingencyTable2 ( const 1 &  values,
const 1 &  bins 
)

◆ convertIndptrToIndices()

void gstlrn::convertIndptrToIndices ( Id  ncumul,
const I32 cumul,
I32 tab 
)

TODO: transfer this in swig_inc.i.

◆ correctNamesForDuplicates()

void gstlrn::correctNamesForDuplicates ( VectorString list)

Check that the names in 'list' are not conflicting with any previous name. If it does, increment its name by a version number.

Parameters
list

◆ correctNewNameForDuplicates()

void gstlrn::correctNewNameForDuplicates ( VectorString list,
Id  rank 
)

◆ correlationIdentify()

Id gstlrn::correlationIdentify ( Db db1,
Db db2,
Id  icol1,
Id  icol2,
Polygons polygon 
)

Identify samples from scatter plot when included within a polygon

Returns
Error return code
Parameters
[in]db1Db descriptor (first variable)
[in]db2Db descriptor (second variable for flag.same=T)
[in]icol1Rank of the first column
[in]icol2Rank of the second column
[in]polygonPolygons structure
Remarks
The two input Db must match exactly (same number of samples with
same set of coordinates and same optional selection)

◆ correlationPairs()

gstlrn::correlationPairs ( Db db1,
Db db2,
const String name1,
const String name2,
bool  flagFrom1,
bool  verbose 
)

Evaluate the correlation Correl(Z1(x) , Z2(x))

Returns
Array of the indices of pairs of samples (or VectorVectorInt())
Parameters
[in]db1Db descriptor (first variable)
[in]db2Db descriptor (second variable for flag.same=T)
[in]name1Name of the first variable
[in]name2Name of the second variable
[in]flagFrom1Start numbering of indices from 1 if True
[in]verboseVerbose flag
Remarks
The two input Db must match exactly (same number of samples with
same set of coordinates and same optional selection)
The returned Vector of Vector of integer 'indices' contain
the set of indices of the pairs of samples.
Its contents is i1,j1,i2,j2,...
The indices are numbered starting from 0

◆ create()

BiTargetCheckGeometry * gstlrn::create ( Id  ndim,
const 1 &  codir,
double  tolang,
double  bench,
double  cylrad,
bool  flagasym 
)

◆ createDbFromDataFrame()

Db * gstlrn::createDbFromDataFrame ( const DataFrame dat,
const VectorString coordinates 
)

◆ createFromAnyMatrix()

MatrixSparse * gstlrn::createFromAnyMatrix ( const AMatrix mat)

Transform any matrix into a Sparse format

◆ createModelFromData()

GaussianProcess * gstlrn::createModelFromData ( const Db dat,
const VectorString variables,
const std::vector< ECov > &  structs,
bool  addMeasurementError = false 
)

◆ csv_manage()

Id gstlrn::csv_manage ( const char *  filename,
const CSVformat csv,
Id  mode,
Id  nitem,
bool  flagInteger = false,
bool  verbose = false 
)

◆ csv_print_double()

void gstlrn::csv_print_double ( double  value)

◆ csv_table_read()

Id gstlrn::csv_table_read ( const String filename,
const CSVformat csvfmt,
bool  verbose,
Id  ncol_max,
Id  nrow_max,
Id ncol_arg,
Id nrow_arg,
VectorString names,
1 &  tab 
)

◆ ct_INTRES2()

double gstlrn::ct_INTRES2 ( CTables ctables,
Id  iconf0,
Id  idisc0,
Id  jdisc0 
)

◆ ct_INTRES3()

double gstlrn::ct_INTRES3 ( CTables ctables,
Id  iconf0,
Id  idisc0,
Id  jdisc0,
Id  kdisc0 
)

◆ ct_tableone_calculate()

double gstlrn::ct_tableone_calculate ( CTables ctables,
Id  iconf0,
double *  lows,
double *  ups 
)

◆ ct_tableone_calculate_by_rank()

double gstlrn::ct_tableone_calculate_by_rank ( CTables ctables,
Id  iconf0,
double *  rklows,
double *  rkups 
)

◆ ct_tableone_covrank()

Id gstlrn::ct_tableone_covrank ( const CTables ctables,
double  cova,
double *  cround 
)

◆ ct_tableone_getrank_from_proba()

Id gstlrn::ct_tableone_getrank_from_proba ( CTables ctables,
double  gaussian 
)

◆ ct_tables_manage()

CTables * gstlrn::ct_tables_manage ( Id  mode,
Id  verbose,
Id  flag_cumul,
Id  nconf,
Id  ndisc,
double  cmin,
double  cmax,
CTables ctables_old 
)

◆ ct_tables_print()

void gstlrn::ct_tables_print ( CTables ctables,
Id  flag_print 
)

◆ D_CONV()

Def_Convolution & gstlrn::D_CONV ( Id  rank)

◆ D_TAPE()

Def_Tapering & gstlrn::D_TAPE ( Id  rank)

◆ db_bounds_shadow()

Id gstlrn::db_bounds_shadow ( Db db,
Db dbprop,
RuleShadow rule,
Model model,
const 1 &  props,
Id  flag_stat,
Id  nfacies 
)

Apply the Rule transformation to derive the bounds variables for a Db (Shadow case)

Returns
Error return code
Parameters
[in]dbDb structure
[in]dbpropDb structure used for proportions (non-stationary case)
[in]ruleLithotype Rule definition
[in]modelFirst Model structure (only for SHIFT)
[in]propsArray of proportions for the facies
[in]flag_stat1 for stationary; 0 otherwise
[in]nfaciesNumber of facies

◆ db_center()

Id gstlrn::db_center ( Db db,
double *  center 
)

Returns the center of a data set

Parameters
[in]dbDb structure
[out]centerArray containing the coordinates of the center (Dimension = get_NDIM(db))

◆ db_diffusion()

Id gstlrn::db_diffusion ( DbGrid dbgrid1,
DbGrid dbgrid2,
Id  orient,
Id  niter,
Id  nseed,
Id  seed,
Id  verbose 
)

Calculate the diffusion factor from a grid Db into another grid Db

Returns
Error return code
Parameters
[in]dbgrid1Db for the input grid
[in]dbgrid2Db for the output grid
[in]orientDiffusion orientation (0 or the space rank dimension)
[in]niterNumber of iterations
[in]nseedNumber of seeds
[in]seedSeed for the random number generation
[in]verboseVerbose Option
Remarks
The user may specify the type of storage
0: average squared distance; 1: slope; 2: origin
get.keypair("Diffusion.Converge.Option",0)
The neighborhood is Block(0) or Cross(1) according to
get.keypair("Diffusion.Converge.Morpho",0)
The rank of the convergence if measured from a Starting to an Ending
percentages of the 'niter' iterations. The 'Mid' percentage gives
the value assigned to the output block
get.keypair("Diffusion.Converge.PMid",70)
The user can specify the block of interest by using:
get.keypair("Diffusion.Converge.Block")
For the target block, the array of squared distances as a function
of the iteration is returned using the keypair mechanism:
set.keypair("Diffusion.Converge")
For the target block, the trajectories are saved using keypair;
set.keypair("Diffusion.Trajectory.XX")

◆ db_distances_general()

gstlrn::db_distances_general ( Db db1,
Db db2,
Id  niso,
Id  mode,
Id  flag_same,
Id n1,
Id n2,
double *  dmin,
double *  dmax 
)

Evaluate the array of distances between samples of two data sets Takes the selection into account (if any)

Returns
Array of distances
Parameters
[in]db1Db first descriptor
[in]db2Db second descriptor
[in]nisoNumber of variables tested for isotopy
[in]modeType of array returned 0 : extreme distances 1 : the distance to the closest sample 2 : all point-to-point distances
[in]flag_same1 if both Db coincide
[out]n1First dimension of the returned array
[out]n2Second dimension of the returned array
[out]dminMinimum distance
[out]dmaxMaximum distance
Remarks
The returned array must be freed by calling routine
When the two Dbs coincide, the distance calculation excludes
the comparison between one sample and itself

◆ db_gradient_component_to_modang()

Id gstlrn::db_gradient_component_to_modang ( Db db,
Id  verbose,
Id  iad_gx,
Id  iad_gy,
Id  iad_mod,
Id  iad_ang,
double  scale,
double  ve 
)

Transform a set of gradients defined by (gx,gy) into (module,angle) Only defined in the 2-D case

Returns
Error return code
Parameters
[in]dbInitial Db
[in]verbose1 for the verbose option
[in]iad_gxRank of the 'gx' attribute (defined in degrees)
[in]iad_gyRank of the 'gy' attribute (defined in degrees)
[in]iad_modRank of the 'modulus' attribute
[in]iad_angRank of the 'angle' attribute (defined in degrees)
[in]scaleScaling factor for the modulus
[in]veModeration factor
Remarks
Attributes 'gx' and 'gy' may coincide with 'modulus' and 'angle'
Nothing is done (more than the conversion if scale=1 and ve=0)

◆ db_gradient_modang_to_component()

Id gstlrn::db_gradient_modang_to_component ( Db db,
Id  ang_conv,
Id  iad_mod,
Id  iad_ang,
Id  iad_gx,
Id  iad_gy 
)

Transform a set of gradients defined by (modulus,angle) into (gx,gy) Only defined in the 2-D case

Returns
Error return code
Parameters
[in]dbInitial Db
[in]ang_convConvention on the angles
  • 1: Trigonometry (From East counter-clockwise)
  • 2: From North clockwise
[in]iad_modRank of the 'modulus' attribute
[in]iad_angRank of the 'angle' attribute (defined in degrees)
[in]iad_gxRank of the 'gx' attribute (defined in degrees)
[in]iad_gyRank of the 'gy' attribute (defined in degrees)
Remarks
Attributes 'gx' and 'gy' may coincide with 'modulus' and 'angle'

◆ db_gradient_update()

Id gstlrn::db_gradient_update ( Db db)

Update the Data Base for Kriging with Gradient components This update is limited to the 2-D Monovariate case

Returns
Error return code
Parameters
[in]dbInput/output Db
Remarks
In the case of Kriging with Gradient, the gradient components
are transformed into additional variables

◆ db_grid_copy()

Id gstlrn::db_grid_copy ( DbGrid db1,
DbGrid db2,
const Id ind1,
const Id ind2,
Id  ncol,
Id cols 
)

Copy a set of variables from a grid Db to another grid Db

Returns
Error return code
Parameters
[in]db1Input Grid Db structure
[in]db2Output Grid Db structure
[in]ind1Vector of indices in the first Db
[in]ind2Vector of indices in the second Db
[in]ncolNumber of variables to be copied
[in]colsArray of input variable columns

◆ db_grid_copy_dilate()

Id gstlrn::db_grid_copy_dilate ( DbGrid db1,
Id  iatt1,
DbGrid db2,
Id  iatt2,
Id  mode,
const Id nshift 
)

Copy one variable from a grid Db to another grid Db

Returns
Error return code
Parameters
[in]db1Input Grid Db structure
[in]iatt1Rank of the attribute in Db1
[in]db2Output Grid Db structure
[in]iatt2Rank of the attribute in Db2
[in]mode1 for dilation; -1 for compression
[in]nshiftVector of dilation/compression defined in cell number along each space direction

◆ db_grid_define_coordinates()

Id gstlrn::db_grid_define_coordinates ( DbGrid db)

Define the coordinates in a Grid structure

Returns
Error return code
Parameters
[in]dbThe Db structure
Remarks
This function considers the grid characteristics and updates
the locators dedicated to coordinates
This makes sense when a new grid is generated or when the grid
characteristics have changed

◆ db_grid_patch()

Id gstlrn::db_grid_patch ( DbGrid ss_grid,
DbGrid db_grid,
Id  iptr_ss,
Id  iptr_db,
Id  iptr_rank,
Id  new_rank,
Id  oper,
Id  verbose 
)

Patch a sub-grid within a main grid

Returns
Error return code
Parameters
[in]ss_gridDb sub-grid structure
[in]db_gridDb main grid structure
[in]iptr_ssRank of the attribute in the sub-grid
[in]iptr_dbRank of the attribute in the main grid
[in]iptr_rankRank of the attribute storing object rank If <0, no check is performed: always patch
[in]new_rankRank of the current object to patch in main grid
[in]oper>0 for larger; <0 for smaller
[in]verboseVerbose flag
Remarks
When 'iptr_rank' is defined (>=0), defined pixels of the current
sub-grid overwrites the corresponding pixel within the main grid
only if its rank ('new_rank') is larger (oper>0) or smaller
(oper<0)) than the rank of the same pixel in the main grid
(attribute 'iptr_rank')
When 'iptr_rank' is undefined, arguments 'new_rank', 'oper' are
useless

◆ db_grid_print()

void gstlrn::db_grid_print ( Db db)

Print the Summary of the Grid structure

Parameters
[in]dbPointer to the Db structure (organized as a grid)

◆ db_grid_read_bmp()

DbGrid * gstlrn::db_grid_read_bmp ( const char *  filename,
Id  verbose = 0 
)

◆ db_grid_read_f2g()

DbGrid * gstlrn::db_grid_read_f2g ( const char *  filename,
Id  verbose = 0 
)

◆ db_grid_read_ifpen()

DbGrid * gstlrn::db_grid_read_ifpen ( const char *  filename,
Id  verbose = 0 
)

◆ db_grid_read_zycor()

DbGrid * gstlrn::db_grid_read_zycor ( const char *  filename,
Id  verbose = 0 
)

◆ db_grid_reduce()

DbGrid * gstlrn::db_grid_reduce ( DbGrid db_grid,
Id  iptr,
const Id margin,
const Id limmin,
Id  flag_sel,
Id  flag_copy,
Id  verbose,
double  vmin,
double  vmax 
)

Extract the subgrid (from a grid) which contains the only cells where the target variable lies wuthin the target interval Selection in the input grid is taken into account

Parameters
[in]db_gridDb structure
[in]iptrRank of the column of the target variable
[in]marginArray of margins (or NULL)
[in]limminArray of minimum dimensions (or NULL)
[in]flag_selCreate the selection
[in]flag_copy1 if the selection must be copied in sub-grid
[in]verboseVerbose flag
[in]vminLower bound (included)
[in]vmaxUpper bound (excluded)

◆ db_grid_write_arcgis()

Id gstlrn::db_grid_write_arcgis ( const char *  filename,
DbGrid db,
Id  icol 
)

◆ db_grid_write_bmp()

Id gstlrn::db_grid_write_bmp ( const char *  filename,
DbGrid db,
Id  icol,
Id  nsamplex = 1,
Id  nsampley = 1,
Id  nmult = 1,
Id  ncolor = 1,
Id  flag_low = 1,
Id  flag_high = 1,
double  valmin = TEST,
double  valmax = TEST,
Id red = nullptr,
Id green = nullptr,
Id blue = nullptr,
Id  mask_red = 0,
Id  mask_green = 0,
Id  mask_blue = 0,
Id  ffff_red = 232,
Id  ffff_green = 232,
Id  ffff_blue = 0,
Id  low_red = 255,
Id  low_green = 255,
Id  low_blue = 255,
Id  high_red = 255,
Id  high_green = 0,
Id  high_blue = 0 
)

◆ db_grid_write_eclipse()

Id gstlrn::db_grid_write_eclipse ( const char *  filename,
DbGrid db,
Id  icol 
)

◆ db_grid_write_ifpen()

Id gstlrn::db_grid_write_ifpen ( const char *  filename,
DbGrid db,
Id  ncol,
Id icols 
)

◆ db_grid_write_irap()

Id gstlrn::db_grid_write_irap ( const char *  filename,
DbGrid db,
Id  icol,
Id  nsamplex = 1,
Id  nsampley = 1 
)

◆ db_grid_write_XYZ()

Id gstlrn::db_grid_write_XYZ ( const char *  filename,
DbGrid db,
Id  icol 
)

◆ db_grid_write_zycor()

Id gstlrn::db_grid_write_zycor ( const char *  filename,
DbGrid db,
Id  icol 
)

◆ db_locator_attribute_add()

Id gstlrn::db_locator_attribute_add ( Db db,
const ELoc &  locatorType,
Id  number,
Id  r_tem,
double  valinit,
Id iptr 
)

Add and initiate several attributes corresponding to a given locator

Returns
Error return code
Parameters
[in]dbDb structure
[in]locatorTypeRank of the Pointer (ELoc)
[in]numberNumber of locators to be defined
[in]r_temRank of the first item in the pointer
[in]valinitValue to be used for initialization
[out]iptrRank of the first new attribute

◆ db_locators_correct()

void gstlrn::db_locators_correct ( VectorString strings,
const 1 &  current,
Id  flag_locnew 
)

Define the array of locators

Parameters
[in]stringsArray of locators
[in]currentArray of ranks of the last modified locator
[in]flag_locnewReset all locators
Remarks
The elements of the array current are numbered starting from 1

◆ db_merge()

Id gstlrn::db_merge ( Db db,
Id  ncol,
Id cols 
)

Merge a set of variables in a Db

Returns
Error return code
Parameters
[in]dbDb structure
[in]ncolNumber of variables to be merged
[in]colsArray of input variable columns

◆ db_monostat()

void gstlrn::db_monostat ( Db db,
Id  iatt,
double *  wtot,
double *  mean,
double *  var,
double *  mini,
double *  maxi 
)

Monovariate statistics

Parameters
[in]dbDb structure
[in]iattRank of the attribute
[out]wtotSum of the weights
[out]meanMean of the variable
[out]varvariance of the variable
[out]miniMinimum value
[out]maxiMaximum value

◆ db_morpho_angle2D()

void gstlrn::db_morpho_angle2D ( DbGrid dbgrid,
const 1 &  radius,
Id  iptr0 
)

Calculate the gradient orientations of a colored image

◆ db_morpho_calc()

Id gstlrn::db_morpho_calc ( DbGrid dbgrid,
Id  iptr0,
const EMorpho &  oper,
double  vmin,
double  vmax,
Id  option,
const 1 &  radius,
bool  flagDistErode,
bool  verbose 
)

Perform a morphological operation with a DbGrid

◆ db_morpho_gradients()

void gstlrn::db_morpho_gradients ( DbGrid dbgrid,
Id  iptr 
)

Calculate the gradient components of a colord image

◆ db_name_identify()

Id gstlrn::db_name_identify ( Db db,
const String string 
)

Identify the attribute by its name

Returns
Rank of the variable starting from 0 (or -1 if not found)
Parameters
[in]dbDb descriptor
[in]stringattribute name

◆ db_polygon()

void gstlrn::db_polygon ( Db db,
const Polygons polygon,
bool  flag_sel,
bool  flag_period,
bool  flag_nested,
const NamingConvention namconv 
)

Create a selection if the samples of a Db are inside Polygons

Parameters
[in]dbDb structure
[in]polygonPolygons structure
[in]flag_seltrue if previous selection must be taken into account
[in]flag_periodtrue if first coordinate is longitude (in degree) and must be cycled for the check
[in]flag_nestedOption for nested polyelems (see details)
[in]namconvNaming Convention
Remarks
If flag_nested=true, a sample is masked off if the number of
polyelems to which it belongs is odd
If flag_nested=false, a sample is masked off as soon as it
belongs to one polyelem
The Naming Convention locator Type is overwritten to ELoc::SEL

◆ db_prop_read()

Id gstlrn::db_prop_read ( DbGrid db,
Id  ix,
Id  iy,
double *  props 
)

Read the proportions per VPC

Returns
Error return code
Parameters
[in]dbDb structure
[in]ixRank of the cell along X
[in]iyRank of the cell along Y
[out]propsArray of proportions
Remarks
This procedure is meant for a 3-D grid file

◆ db_prop_write()

Id gstlrn::db_prop_write ( DbGrid db,
Id  ix,
Id  iy,
double *  props 
)

Write the proportions (per VPC)

Returns
Error return code
Parameters
[in]dbDb structure
[in]ixRank of the cell along X
[in]iyRank of the cell along Y
[in]propsArray of proportions
Remarks
This procedure is meant for a 3-D grid file

◆ db_proportion()

Id gstlrn::db_proportion ( Db db,
DbGrid dbgrid,
Id  nfac1max,
Id  nfac2max,
Id nclout 
)

Calculates the proportions of facies within a grid

Returns
Error return code
Parameters
[in]dbInput Db structure
[in]dbgridOutput Grid Db structure
[in]nfac1maxMaximum number of facies for the first variable
[in]nfac2maxMaximum number of facies for the second variable
[out]ncloutTotal number of classes
Remarks
This procedure is designed for one or two Z-variables
When used for 2 variables, the proportions are for pairs of
variables

◆ db_proportion_estimate()

Id gstlrn::db_proportion_estimate ( Db dbin,
DbGrid dbout,
Model model,
Id  niter = 100,
bool  verbose = false,
const NamingConvention namconv = NamingConvention("Prop", true, true, true, ELoc::fromKey("P")) 
)

◆ db_read_csv()

Db * gstlrn::db_read_csv ( const String filename,
const CSVformat csvfmt,
bool  verbose = false,
Id  ncol_max = -1,
Id  nrow_max = -1,
bool  flagAddSampleRank = false 
)

◆ db_rule_shadow()

Id gstlrn::db_rule_shadow ( Db db,
Db dbprop,
RuleShadow rule,
Model model,
const 1 &  props,
Id  flag_stat,
Id  nfacies 
)

Apply the Rule transformation to the GRFs of a Db (Shadow case)

Returns
Error return code
Parameters
[in]dbOutput Db structure
[in]dbpropDb structure used for proportions (non-stationary case)
[in]ruleLithotype Rule definition
[in]modelFirst Model structure (only for SHIFT)
[in]propsArray of proportions for the facies
[in]flag_stat1 for stationary; 0 otherwise
[in]nfaciesNumber of facies
Remarks
The input variable must be locatorized as Z or ELoc::SIMU
It will be changed in this function to locator ELoc::SIMU

◆ db_sample_print()

void gstlrn::db_sample_print ( Db db,
Id  iech,
Id  flag_ndim,
Id  flag_nvar,
Id  flag_nerr,
Id  flag_blk 
)

Print a sample

Parameters
[in]dbDb structure
[in]iechRank of the sample
[in]flag_ndim1 if the coordinates must be printed
[in]flag_nvar1 if the variables must be printed
[in]flag_nerr1 if the error measurement variance must be printed
[in]flag_blk1 if the variable block extension must be printed

◆ db_segy()

Id gstlrn::db_segy ( const char *  filesegy,
DbGrid grid3D,
DbGrid surf2D,
const String name_top,
const String name_bot,
double  thickmin,
Id  option,
Id  nz_ss,
Id  verbOption,
Id  iline_min,
Id  iline_max,
Id  xline_min,
Id  xline_max,
double  modif_high,
double  modif_low,
double  modif_scale,
Id  codefmt,
const NamingConvention namconv 
)

Read the contents of a SEGY file

Returns
Error return code
Parameters
[in]filesegyName of the SEGY file
[in]grid3DDb containing the resulting 3-D grid
[in]surf2DDb containing the top, Bottom and Reference surfaces This file is optional
[in]name_topRank of variable containing the Top Surface (or 0)
[in]name_botRank of variable containing the Bottom Surface (or 0)
[in]thickminMinimum thickness (or 0)
[in]optionFlattening option: 0 no flattening; 1 flattening from top; -1 flattening from bottom -2 squeeze and stretch option 2 averaging from 3-D to 2-D
[in]nz_ssDeprecated argument
[in]verbOptionVerbose option
[in]iline_minMinimum Inline number included (if defined)
[in]iline_maxMaximum Inline number included (if defined)
[in]xline_minMinimum Xline number included (if defined)
[in]xline_maxMaximum Xline number included (if defined)
[in]modif_highUpper truncation (when defined)
[in]modif_lowLower truncation (when defined)
[in]modif_scaleScaling value (when defined)
[in]codefmtReading format
[in]namconvNaming convention

: In the case of Squeeze and Stretch (S&S), the number of layers

: is meaningless. It is fixed by the user, unless defined

: by the output grid (if flag_store == 1)

Remarks
For filling the 3-D grid
- 2-D characteristics of the grid are taken into account
- no attention is paid to the vertical mesh value.

◆ db_selhull()

Id gstlrn::db_selhull ( Db db1,
Db db2,
double  dilate,
bool  verbose,
const NamingConvention namconv 
)

Select samples from a file according to the 2-D convex hull computed over the active samples of a second file

Returns
Error returned code
Parameters
[in]db1descriptor of the Db serving for convex hull calculation
[in]db2descriptor of the Db where the mask must be stored
[in]dilateRadius of the dilation
[in]verboseVerbose flag
[in]namconvNaming convention
Remarks
The Naming Convention locator Type is overwritten to ELoc::SEL

◆ db_selref()

Id gstlrn::db_selref ( Id  ndim,
const Id nx,
const Id ref,
const double *  tabin,
double *  tabout 
)

Select a 2-D grid from a Grid Db

Returns
Error returned code
Parameters
[in]ndimSpace dimension of the Db
[in]nxNumber of meshes of the grid
[in]refArray giving the indices of the reference planes
  • Grid indices are counted starting from 1
  • -1 for the directions of interest
[in]tabinInput array
[out]taboutOutput array

◆ db_simulations_to_ce()

Id gstlrn::db_simulations_to_ce ( Db db,
const ELoc &  locatorType,
Id  nbsimu,
Id  nvar,
Id iptr_ce_arg,
Id iptr_cstd_arg 
)

Convert series of simulations to conditional expectation and variance

Returns
Error return code
Parameters
[in]dbDb structure
[in]locatorTypeType of pointer containing the simulations
[in]nbsimuNumber of simulations
[in]nvarNumber of variables
[out]iptr_ce_argPointer to the Conditional Expectation attributes
[out]iptr_cstd_argPointer to the Conditional St. Dev. attributes

◆ db_upscale()

Id gstlrn::db_upscale ( DbGrid dbgrid1,
DbGrid dbgrid2,
Id  orient,
Id  verbose 
)

Upscale one variable from a grid Db into another grid Db

Returns
Error return code
Parameters
[in]dbgrid1Db for the input grid
[in]dbgrid2Db for the output grid
[in]orientUpscaling direction (0 to 2)
[in]verboseVerbose flag

◆ db_vcloud()

DbGrid * gstlrn::db_vcloud ( Db db,
const VarioParam varioparam,
double  lagmax,
double  varmax,
Id  lagnb,
Id  varnb,
const NamingConvention namconv 
)

Evaluate the experimental variogram cloud

Returns
Error return code
Parameters
[in]dbDb descriptor
[in]varioparamVarioParam structure
[in]lagmaxMaximum distance
[in]varmaxMaximum Variance value (see remarks)
[in]lagnbNumber of discretization steps along distance axis
[in]varnbNumber of discretization steps along variance axis
[in]namconvNaming convention
Remarks
If 'lagmax' is not provided, it is set to the diagonal of the area covered by the active samples within 'db'.
If 'varmax' is not defined, it is set to 3 times the experimental variance of the first variable (Z_locator)

◆ db_vmap()

DbGrid * gstlrn::db_vmap ( Db db,
const ECalcVario &  calcul_type,
const 1 &  nxx,
const 1 &  dxx,
Id  radius,
bool  flag_FFT,
const NamingConvention namconv 
)

Calculate the variogram map (integrated function)

Returns
Error return code
Parameters
[in]dbDb containing the data
[in]calcul_typeType of calculation (ECalcVario)
[in]nxxVector of (Half-) number of nodes for Vmap (def:20)
[in]dxxVector of mesh for Vmap (see details)
[in]radiusDilation radius (mooth resulting maps) only on points
[in]flag_FFTUse FFT method (only valid on grid)
[in]namconvNaming convention
Remarks
For calculating the default values:
- for nx: it is set to 20 in all directions
- for dx:
. If 'Db' is a grid, the mesh of the grid is used
- Otherwise, the mesh is set to the field extension / nx

◆ db_well_read_las()

Db * gstlrn::db_well_read_las ( const char *  filename,
double  xwell,
double  ywell,
double  cwell,
Id  verbose = 0 
)

◆ db_write_csv()

Id gstlrn::db_write_csv ( Db db,
const char *  filename,
const CSVformat csv,
Id  flag_allcol = 1,
Id  flag_coor = 1,
bool  flagInteger = false 
)

◆ db_write_vtk()

Id gstlrn::db_write_vtk ( const char *  filename,
DbGrid db,
const 1 &  cols 
)

◆ dbFoldPolyline()

Id gstlrn::dbFoldPolyline ( DbGrid dbin,
Db dbout,
const 1 &  cols,
const PolyLine2D polyline,
const NamingConvention namconv 
)

Fold an input Db into an output Db with respect to a polyline

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]colsVector of the target variable ranks
[in]polylinePolyLine2D structure
[in]namconvNaming convention

◆ dbFromPolylines()

Id gstlrn::dbFromPolylines ( Db db,
const PolyLine2D top,
const PolyLine2D bot,
Id  nb_neigh,
bool  flagMask,
const NamingConvention namconv 
)

Calculate quantities on the Db by comparison with top and bottom polylines

Parameters
dbPointer to the Db where relevant information will be stored
top2-D Polyline defining the Top surface
bot2-D Polyline defining the Bottom surface
nb_neighSize of neighborhood radius (for regularizing the angle calculation)
flagMaskMask if the target is outside the two polylines
namconvNaming convention
Returns
Error return code
Remarks
Three variables are created:
1 - Minimum distance between Target and Polylines
2 - Distance between Polylines at Target location
3 - Average angle of Polylines at Target location

◆ dbg2gCopy()

Id gstlrn::dbg2gCopy ( DbGrid dbin,
DbGrid dbout,
const NamingConvention namconv = NamingConvention(                                "Copy") 
)

◆ dbg2gExpand()

Id gstlrn::dbg2gExpand ( DbGrid dbin,
DbGrid dbout,
const NamingConvention namconv = NamingConvention(                                  "Expand") 
)

◆ dbg2gInterpolate()

Id gstlrn::dbg2gInterpolate ( DbGrid dbin,
DbGrid dbout,
const VectorString tops = VectorString(),
const VectorString bots = VectorString(),
const NamingConvention namconv = NamingConvention(                                       "Interpolation",                                       false) 
)

◆ dbg2gShrink()

Id gstlrn::dbg2gShrink ( DbGrid dbin,
DbGrid dbout,
const NamingConvention namconv = NamingConvention(                                  "Shrink") 
)

◆ dbgridLineSampling()

gstlrn::dbgridLineSampling ( DbGrid dbgrid,
const double *  x1,
const double *  x2,
Id  ndisc,
Id  ncut,
const double *  cuts,
Id nval_ret 
)

Sampling vertices within a Grid between two points

Returns
Array of sampled vertices
Parameters
[in]dbgridreference Grid
[in]x1Array giving the coordinates of the first point
[in]x2Array giving the coordinates of the second point
[in]ndiscNumber of discretized points in the segment
[in]ncutNumber of cutoffs
[in]cutsArray of cutoffs
[out]nval_retNumber of samples in the output array
Remarks
This function considers the segment [x1,x2] and subdivises it
into 'ndisc' intervals. The endpoints of each interval correspond
to two points in the space
At each endpoint, the target variable is interpolated from the grid
If the target variable values cross a cutoff, the coordinates of
the intersection are calculated.
The program returns the list of all these intersection coordinates

◆ dbMorpho()

Id gstlrn::dbMorpho ( DbGrid dbgrid,
const EMorpho &  oper,
double  vmin,
double  vmax,
Id  option,
const 1 &  radius,
bool  flagDistErode,
bool  verbose,
const NamingConvention namconv 
)

Perform a Morphological operation on an image stored in Db

Parameters
dbgridTarget IN/OUT Db (must be a Grid)
operType of morphological operation
vminMinimum threshold value
vmaxMaximum threshold value
optionOption
radiusRadius
verboseVerbose option
flagDistErodeTrue: Inflate the grain; False: Reduce the grain
namconvNaming convention
Returns

◆ dbPolygonDistance()

Id gstlrn::dbPolygonDistance ( Db db,
Polygons polygon,
double  dmax,
Id  scale,
Id  polin,
const NamingConvention namconv 
)

Determine the distance to a polyline

Returns
Error returned code
Parameters
[in]dbDb structure
[in]polygonPolygons structure
[in]dmaxMaximum distance
[in]scaleScaling option 0 : no scaling >0 : scaling between 0 and 1 <0 : scaling between 1 and 0
[in]polinOption for checking against the polygon 0 : no check >0 : if sample is outside polygon, return TEST <0 : if sample is inside polygon, return TEST
[in]namconvNaming convention
Remarks
When patching values with respect to the polygon, when abs(polin):
1 : put NA
2 : put minimum distance
3 : put maximum distance

◆ dbRegression()

Id gstlrn::dbRegression ( Db db1,
const String nameResp,
const VectorString nameAux,
Id  mode = 0,
bool  flagCst = true,
Db db2 = nullptr,
const Model model = nullptr,
const NamingConvention namconv = NamingConvention("Regr") 
)

◆ dbSelectivity()

Id gstlrn::dbSelectivity ( Db db,
const String name,
const 1 &  zcuts,
const NamingConvention namconv = NamingConvention(                                      "Selectivity") 
)

◆ dbSmoother()

Id gstlrn::dbSmoother ( DbGrid dbgrid,
ANeigh neigh,
Id  type,
double  range,
const NamingConvention namconv 
)

Smooth a regular grid

Returns
Error return code
Parameters
[in]dbgridinput and output Db grid structure
[in]neighANeigh structure
[in]type1 for Uniform; 2 for Gaussian
[in]rangeRange (used for Gaussian only)
[in]namconvNaming Convention

◆ dbStatisticsFacies()

gstlrn::dbStatisticsFacies ( Db db)

Considering that the Unique variable is a Facies (positive integer) returns the vector of proportions

Returns
The vector of proportions per Facies
Parameters
[in]dbDb structure

◆ dbStatisticsIndicator()

double gstlrn::dbStatisticsIndicator ( Db db)

Considering that the Unique variable is an Indicator (0 or 1) returns the proportion of 1

Returns
The vector of proportions per Facies
Parameters
[in]dbDb structure

◆ dbStatisticsInGridTool()

Id gstlrn::dbStatisticsInGridTool ( Db db,
DbGrid dbgrid,
const VectorString names,
const EStatOption &  oper,
Id  radius,
Id  iptr0 
)

Calculates the monovariate statistics within cells of a grid

Returns
Error return code
Parameters
[in]dbDb for the points
[in]dbgridDb for the grid
[in]namesVector of target variable names
[in]operA EStatOption item
[in]radiusNeighborhood radius
[in]iptr0Storage address (first variable)

◆ dbStatisticsOnGrid()

Id gstlrn::dbStatisticsOnGrid ( Db db,
DbGrid dbgrid,
const EStatOption &  oper,
Id  radius,
const NamingConvention namconv 
)

Calculates the statistics on variables of an input Db per cell of an output Grid

Returns
Error return code
Parameters
[in]dbInput Db
[in]dbgridOutput DbGrid
[in]operThe statistical calculation
[in]radiusNeighborhood radius
[in]namconvNaming convention

◆ dbUnfoldPolyline()

Id gstlrn::dbUnfoldPolyline ( Db db,
const PolyLine2D polyline,
const NamingConvention namconv 
)

Unfold a 2-D Db with respect to a polyline

Returns
Error return code
Parameters
[in]dbDb structure
[in]polylinePolyLine2D structure
[in]namconvNaming convention

◆ dbVarianceMatrix()

MatrixSymmetric gstlrn::dbVarianceMatrix ( const Db db)

Calculate the variance-covariance matrix on the isotopic data set from the Z-locator variables.

Parameters
dbTarget Data Base

◆ declustering()

Id gstlrn::declustering ( Db dbin,
Model model,
Id  method,
ANeigh neigh,
DbGrid dbgrid,
const 1 &  radius,
const 1 &  ndiscs,
Id  flag_sel,
bool  verbose 
)

Perform the Declustering task

Returns
Error return code
Parameters
[in]dbininput Db structure
[in]modelModel structure
[in]methodMethod for declustering
[in]neighANeigh structure
[in]dbgridGrid auxiliary Db structure
[in]radiusArray of neighborhood radius
[in]ndiscsArray of discretization
[in]flag_sel1 to mask off samples with zero weight
[in]verboseVerbose option

◆ decodeGridSorting()

gstlrn::decodeGridSorting ( const String string,
const 1 &  nx,
bool  verbose 
)

Decode the grid sorting order

Returns
Array describing the order
Parameters
[in]stringName of the sorting string
[in]nxArray giving the number of cells per direction
[in]verboseVerbose flag
Remarks
The value of order[i] gives the dimension of the space along
which sorting takes place at rank "i". This value is positive
for increasing order and negative for decreasing order.
'order' values start from 1 (for first space dimension)
Example: "+x1-x3+x2"

◆ decodeInList()

Id gstlrn::decodeInList ( const VectorString symbols,
const String node,
Id rank,
Id facies,
bool  caseSensitive 
)

Decode the input string 'node' as a one-character keyword followed by an integer rank The keyword must match one of the symbols: its rank is 'rank' The integer rank is returned as 'facies'

Parameters
symbols
node
rank
facies
caseSensitive
Returns
Error returned code

◆ decodeInString()

Id gstlrn::decodeInString ( const String symbol,
const String node,
Id facies,
bool  caseSensitive 
)

Decode the input string 'node' as a one-character keyword followed by an integer rank The keyword must match the symbol. The integer rank is returned as 'facies'

Parameters
symbol
node
facies
caseSensitive
Returns
Error returned code

◆ defineDefaultSpace()

void gstlrn::defineDefaultSpace ( const ESpaceType &  type,
size_t  ndim,
double  param 
)

(Re)Defining the unique default global space

Factory for defining the unique default global space (optional parameter can be used for sphere radius for example)

Parameters
typeSpace type (RN, SN, ...)
ndimNumber of dimensions
paramOptional space parameter (ex: radius of the sphere)

◆ del_keypair()

void gstlrn::del_keypair ( const char *  keyword,
Id  flag_exact 
)

Delete a keypair

Parameters
[in]keywordKeyword to be deleted
[in]flag_exact1 if Exact keyword matching is required

◆ del_keypone()

static void gstlrn::del_keypone ( Id  indice)
static

Delete a keypair

Parameters
[in]indiceIndex of the Keyword to be deleted

◆ diff_2d()

static Id gstlrn::diff_2d ( Id  x,
Id  y,
Id  z,
double  t0,
double  hs0,
double  hs1 
)
static

◆ DisjunctiveKriging()

Id gstlrn::DisjunctiveKriging ( Db db,
AAnam anam,
Selectivity selectivity,
const VectorString name_est,
const VectorString name_std,
const NamingConvention namconv 
)

Calculate the recoveries (z,T,Q,m,B) starting from the factors

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]anamPoint anamorphosis
[in]selectivitySelectivity structure
[in]name_estArray of variable names for factor estimation
[in]name_stdArray of variable names for factor St. Dev.
[in]namconvNaming convention

◆ distance_grid()

double gstlrn::distance_grid ( DbGrid db,
Id  flag_moins1,
Id  iech1,
Id  iech2,
double *  dist_vect 
)

Calculates the distance between two points in the same grid Db

Returns
The calculated distance
Parameters
[in]dbDb structure
[in]flag_moins11 to use the cell center
[in]iech1rank of the first sample
[in]iech2rank of the second sample
[out]dist_vectIf the output vector is provided. Returns the distance as a vector

◆ distance_inter()

double gstlrn::distance_inter ( const Db db1,
const Db db2,
Id  iech1,
Id  iech2,
double *  dist_vect 
)

Calculates the distance between two points

Returns
The calculated distance or TEST if one coordinate not defined
Parameters
[in]db1Db structure for the first sample
[in]db2Db structure for the second sample
[in]iech1rank of the first sample
[in]iech2rank of the second sample
[out]dist_vectIf the output vector is provided. Returns the distance as a vector
Remarks
: If both Data Bases do not share the same Space Dimension
: the test is performed on their minimum.
: The returned array 'vect' must be dimension to that value

◆ distance_intra()

double gstlrn::distance_intra ( const Db db,
Id  iech1,
Id  iech2,
double *  dist_vect 
)

Calculates the distance between two points in the same Db

Returns
The calculated distance or TEST if one coordinate not defined
Parameters
[in]dbDb structure
[in]iech1rank of the first sample
[in]iech2rank of the second sample
[out]dist_vectIf the output vector is provided. Returns the distance as a vector

◆ distanceBetweenPolylines()

double gstlrn::distanceBetweenPolylines ( const PolyLine2D poly1,
const PolyLine2D poly2,
const PolyPoint2D pldist1,
const PolyPoint2D pldist2 
)

◆ dsinc()

static double gstlrn::dsinc ( double  x)
static

Function for tabulating dsinc()

Returns
Value of the dsinc() function
Parameters
[in]xArgument of the function

◆ dual_swap()

void gstlrn::dual_swap ( double *  darr,
Id iarr,
Id  i1,
Id  i2 
)

◆ dumpMeshes()

void gstlrn::dumpMeshes ( const VectorMeshes meshes)

◆ edge_diff()

static Id gstlrn::edge_diff ( Id  x,
Id  y,
Id  z,
double  t0,
double  t1,
double  hs0 
)
static

◆ end_line()

static void gstlrn::end_line ( void  )
static

◆ enumerate()

template<typename T >
auto gstlrn::enumerate ( T &  container)

◆ erase()

String gstlrn::erase ( const String s,
const String t = SPACES 
)

◆ error()

static void gstlrn::error ( Id  flag)
static

◆ euclidean_distance()

double gstlrn::euclidean_distance ( const double *  x1,
const double *  x2,
Id  n_features 
)

Returns the Standard Euclidean distance between two points

Parameters
x1Vector of coordinates for the first point
x2Vector of coordinates for the second point
n_featuresNumber of coordinates
Returns

◆ evalCovFFTSpatial()

Array gstlrn::evalCovFFTSpatial ( const 1 &  hmax,
Id  N,
const std::function< double(const 1 &)> &  funcSpectrum 
)

◆ evalCovFFTTimeSlice()

Array gstlrn::evalCovFFTTimeSlice ( const 1 &  hmax,
double  time,
Id  N,
const std::function< std::complex< double >(1, double)> &  funcSpectrum 
)

perform the FFT transform for a First-Order Space Time evolution equation

Parameters
hmaxMaximum spatial distances (Dimension: spatial ndim)
timeTime of the covariance slice
NDiscretization number (in each spatial dimension)
funcSpectrumExternal adequate spectrum evaluation function
Returns
Array of spatio-temporal covariance

◆ exact_delay()

static double gstlrn::exact_delay ( double  vx,
double  vy,
double  vz,
Id  xm,
Id  ym,
Id  zm 
)
static

◆ exit_extern()

void gstlrn::exit_extern ( )

External function to provoke an exit of API This call comes from AStringable where initial mes_abort() has been moved

◆ expand_point_to_coor()

Id gstlrn::expand_point_to_coor ( const Db db1,
Id  iatt,
const 1 &  coords,
1 &  tab 
)

Expands a variable from one point Db into a variable at points defined by coordinate vectors (maximum 3D)

Returns
Error return code
Parameters
[in]db1descriptor of the input parameters
[in]iattrank of the input attribute
[in]coordsArray of coordinates
[out]tabOutput array (Dimension: number of discretized points)

◆ expandList() [1/2]

VectorString gstlrn::expandList ( const VectorString list,
const String match,
bool  onlyOne 
)

Returns the list of matching names

Parameters
listList of eligible names
matchName to be expanded
onlyOneTrue if the expanded list may only contain a single name
Returns
The list of matching possibilities
Note
The returned list is empty if no match has been found or if several matches have been found but onlyOne flag is True (message issued).
Remarks
Example: expandList(["x", "y", "xcol"], "x.*") -> ("x", "xcol")

◆ expandList() [2/2]

VectorString gstlrn::expandList ( const VectorString list,
const VectorString matches 
)

◆ expandPointToCoor()

Id gstlrn::expandPointToCoor ( const Db db1,
Id  iatt,
const 1 &  coords,
1 &  tab 
)

Expands a variable from one point Db into a variable at points defined by coordinate vectors (maximum 3D)

Returns
Error return code
Parameters
[in]db1descriptor of the input parameters
[in]iattrank of the input attribute
[in]coordsArray of coordinates
[out]tabOutput array (Dimension: number of discretized points)

◆ expandPointToGrid()

Id gstlrn::expandPointToGrid ( Db db_point,
DbGrid db_grid,
Id  iatt,
Id  iatt_time,
Id  iatt_angle,
Id  iatt_scaleu,
Id  iatt_scalev,
Id  iatt_scalew,
Id  flag_index,
Id  distType,
const 1 &  dmax,
1 &  tab 
)

Expands a variable from the point structure into a variable in the grid structure

Returns
Error return code
Parameters
[in]db_pointDescriptor of the point parameters
[in]db_gridDescriptor of the grid parameters
[in]iattRank of the point attribute
[in]iatt_timeOptional variable for Time shift
[in]iatt_angleOptional variable for anisotropy angle (around Z)
[in]iatt_scaleuOptional variable for anisotropy scale factor (U)
[in]iatt_scalevOptional variable for anisotropy scale factor (V)
[in]iatt_scalewOptional variable for anisotropy scale factor (W)
[in]flag_index1 if the Index must be assigned to grid node 0 the 'iatt' attribute is assigned instead
[in]distTypeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[out]tabOutput array
Remarks
When a Time Shift is present, this corresponds to Johnson-Mehl
The Time Shift is an optional variable which increases the
distance (the time-to-distance conversion is assumed to be 1)
Only positive Time Shifts are considered

◆ extend_grid()

gstlrn::extend_grid ( DbGrid db,
const 1 &  gext,
Id nout 
)

Extend a Grid by gext

Returns
The coordinates of the extension points (Dimension: number * ndim)
Parameters
[in]dbOutput Db grid structure
[in]gextArray of domain dilation
[out]noutNumber of extension points
Remarks
The returned array 'ext' must be freed by the calling function

◆ extend_point()

gstlrn::extend_point ( Db db,
const 1 &  gext,
Id nout 
)

Extend a Point Domain by gext

Returns
The coordinates of the extension points (Dimension: number * ndim)
Parameters
[in]dbOutput Db grid structure
[in]gextArray of domain dilation
[out]noutNumber of extension points
Remarks
The returned array 'ext' must be freed by the calling function

◆ factorize()

static Id gstlrn::factorize ( Id  nPass,
Id kt 
)
static

◆ FFFF()

bool gstlrn::FFFF ( double  value)

Checks if a double value is TEST

Returns
true if a TEST value is encountered; 0 otherwise
Parameters
[in]valueValue to be tested

◆ fft_free()

static void gstlrn::fft_free ( void  )
static

Free the arrays allocated for FFT

◆ FFTn()

Id gstlrn::FFTn ( Id  ndim,
const 1 &  dims,
1 &  Re,
1 &  Im,
Id  iSign,
double  scaling 
)

Calculate the FFT in a space of dimension N

Returns
Error return code

◆ fftn()

Id gstlrn::fftn ( Id  ndim,
const Id  dims[],
double  Re[],
double  Im[],
Id  iSign,
double  scaling 
)

Calculate the FFT in a space of dimension N

Returns
Error return code

◆ fftradix()

static Id gstlrn::fftradix ( double  Re[],
double  Im[],
size_t  nTotal,
size_t  nPass,
size_t  nSpan,
Id  iSign,
Id  maxFactors,
Id  maxPerm 
)
static

◆ fftshift()

void gstlrn::fftshift ( const 1 &  dims,
1 &  data 
)

◆ fillLegendreMatrix()

MatrixDense gstlrn::fillLegendreMatrix ( const 1 &  r,
Id  legendreOrder 
)

◆ find_node_split_dim()

Id gstlrn::find_node_split_dim ( const MatrixT< double > &  data,
const 1 &  node_indices,
Id  n_features,
Id  n_points 
)

◆ findNN()

MatrixT< Id > gstlrn::findNN ( const Db dbin,
const Db dbout = nullptr,
Id  nb_neigh = 3,
bool  flagShuffle = false,
bool  verbose = false,
Id  leaf_size = 10,
Id  default_distance_function = 1 
)

◆ fluid_extract()

MatrixDense gstlrn::fluid_extract ( DbGrid dbgrid,
const String name_facies,
const String name_fluid,
const String name_poro,
const String name_date,
Id  nfacies,
Id  nfluids,
Id  facies0,
Id  fluid0,
Id  ntime,
double  time0,
double  dtime,
bool  verbose 
)

Extract time charts from the fluid propagation block

Returns
The returned matrix
Parameters
[in]dbgridDb grid structure
[in]name_faciesName of variable containing Facies
[in]name_fluidName of variable containing Fluid
[in]name_poroName of variable containing Porosity (optional)
[in]name_dateName of variable containing Date
[in]nfaciesnumber of facies (facies 0 excluded)
[in]nfluidsnumber of fluids
[in]facies0Value of the target facies
[in]fluid0Value of the target fluid
[in]ntimeNumber of Time intervals
[in]time0Starting time
[in]dtimeTime interval
[in]verbose1 for a verbose option

◆ fluid_propagation()

Id gstlrn::fluid_propagation ( DbGrid dbgrid,
const String name_facies,
const String name_fluid,
const String name_perm,
const String name_poro,
Id  nfacies,
Id  nfluids,
Id  niter,
const 1 &  speeds,
bool  show_fluid,
double  number_max,
double  volume_max,
Id  seed,
bool  verbose,
const NamingConvention namconv 
)

Multivariate multiphase propagation into a set of components constrained by initial conditions and fluid densities

Returns
Error return code : 1 no fluid to propagate
Parameters
[in]dbgridDb grid structure
[in]name_faciesName of the variable containing the Facies
[in]name_fluidName of the variable containing the Fluid
[in]name_permName of the variable containing the Permeability
[in]name_poroName of the variable containing the Porosity
[in]nfaciesnumber of facies (facies 0 excluded)
[in]nfluidsnumber of fluids
[in]niterNumber of iterations
[in]speedsArray containing the travel speeds
[in]show_fluid1 for modifying the value of the cells to show
  • the initial valid fluid information
  • the cork (different from shale)
[in]number_maxMaximum count of cells invaded (or TEST)
[in]volume_maxMaximum volume invaded (or TEST)
[in]seedSeed for random number generator (or 0)
[in]verbose1 for a verbose option
[in]namconvNaming convention
Remarks
Directions are ordered as follows :
0: +X; 1: -X; 2: +Y; 3: -Y; 4: +Z(up); 5: -Z(down)
The coding of the matrix is:
facies + nfacies * fluid
Facies: 0 (Shale), 1 to nfacies, -1 (Cork)
Fluids: 0 (undefined), 1 to nfluids, -1 (No Fluid)
Fluids should be ordered by increasing weight
A Permeability variable is a value (>=1) which divides
the velocities. This variable is optional.
A Porosity variable is a value (in [0,1]) which multiplies
the velocities. This variable is optional.
the volumes. This variable is optional.
Volume_max represents the volumic part of the invaded area:
it is always <= number of cells invaded.

◆ force_big_endian()

static void gstlrn::force_big_endian ( unsigned char *  bytes)
static

◆ foxleg_f()

Id gstlrn::foxleg_f ( Id  ndat,
Id  npar,
Id  ncont,
const MatrixDense acont,
1 &  param,
1 &  lower,
1 &  upper,
1 &  scale,
const Option_AutoFit mauto,
Id  flag_title,
void(*)(Id ndat, Id npar, 1 &param, 1 &work)  func_evaluate,
1 &  tabexp,
1 &  tabwgt 
)

Foxleg algorithm

Returns
Error returned code
0 : Correct termination
-1 : The convergence has not been reached
1 : Core problem
Parameters
[in]ndatNumber of control points
[in]nparNumber of parameters to estimate
[in]ncontNumber of additional constraints
[in]acontMatrix of additional constraints (Dimension = ncont * npar)
[in]paramCurrent values of the parameters
[in]lowerArray of lower values
[in]upperArray of upper values
[in]scaleArray of scale
[in]mautoOption_AutoFit structure
[in]flag_titlePrint the title after func_evaluate()
[in]func_evaluateFunction for evaluating the model
[in]tabexpArray of values at control points
[in]tabwgtArray of weights at control points
Remarks
The evaluation function func_evaluate() is called with the
following arguments:
ndat : Number of control points
npar : Number of parameters
param : Vector of current values for the parameters
work : Output vector for the values at control points
evaluated using the current parameter values
Some additional constraints may be applied on the parameters
When not used, we must set: ncont=0, acont=empty()

◆ free_ptrs()

static void gstlrn::free_ptrs ( )
static

◆ generateMultipleNames()

VectorString gstlrn::generateMultipleNames ( const String radix,
Id  number,
const String delim = "-" 
)

◆ get_db_extension()

gstlrn::get_db_extension ( Db dbin,
Db dbout,
Id nout 
)

Define the maximum extension between dbin and/or dbout

Returns
Array of extensions
Parameters
[in]dbinDb input (optional)
[in]dboutDb output (optional)
[out]noutNumber of extension points
Remarks
The calling function must free the returned array 'ext'
with its dimension: ndim * 2^ndim

◆ get_grid_value()

double gstlrn::get_grid_value ( DbGrid dbgrid,
Id  iptr,
1 &  indg,
Id  ix,
Id  iy,
Id  iz 
)

Returns a value from the a 3-D (maximum) grid

Returns
Returned value
Parameters
[in]dbgridDb Grid structure
[in]iptrRank of the column
[in]indgWorking index array (Dimension: get_NDIM(dbgrid))
[in]ixRank of the node along first dimension
[in]iyRank of the node along second dimension
[in]izRank of the node along third dimension

◆ get_keypair()

Id gstlrn::get_keypair ( const char *  keyword,
Id nrow,
Id ncol,
1 &  values 
)

Inquiry the keypair

Returns
Error returned code
Parameters
[in]keywordKeyword
[out]nrowNumber of rows
[out]ncolNumber of columns
[out]valuesArray of values attached to the keyword
Remarks
The returned array must be freed by the calling function

◆ get_keypair_int()

Id gstlrn::get_keypair_int ( const char *  keyword,
Id nrow,
Id ncol,
1 &  values 
)

Inquiry the keypair (integer values)

Returns
Error returned code
Parameters
[in]keywordKeyword
[out]nrowNumber of rows
[out]ncolNumber of columns
[out]valuesArray of values attached to the keyword
Remarks
The returned array must be freed by the calling function

◆ get_keypone()

double gstlrn::get_keypone ( const char *  keyword,
double  valdef 
)

Inquiry the keypair (for a single value)

Returns
Returned value
Parameters
[in]keywordKeyword
[in]valdefFactory setting value
Remarks
This function will returns systematically the default value
if the targeted keypair contains more than a single value

◆ get_LOCATOR_NITEM()

Id gstlrn::get_LOCATOR_NITEM ( const Db db,
const ELoc &  locatorType 
)

Returns the number of items for a given locator in the Db

Returns
Number of items
Parameters
[in]dbDb descriptor
[in]locatorTypeRank of the pointer (ELoc)

◆ get_rank_from_propdef()

Id gstlrn::get_rank_from_propdef ( PropDef propdef,
Id  ipgs,
Id  igrf 
)

Give the rank of a "variable" for a given GRF and PGS

Returns
Returned rank
Parameters
[in]propdefPropDef structure
[in]ipgsRank of the GS
[in]igrfRank of the Gaussian

◆ get_rule_extreme()

double gstlrn::get_rule_extreme ( Id  mode)

Get the lower or upper bound

Returns
Lower of Upper Bound
Parameters
[in]mode<0 for lower bound; >0 for upper bound

◆ get_rule_mode()

Id gstlrn::get_rule_mode ( void  )

Get the current Rule Mode

Returns
Returns the current mode (1 for Gaussian; 0 for Raw)

◆ getChangeSupport()

gstlrn::getChangeSupport ( DbGrid db,
ModelGeneric model,
const SimuFFTParam param,
const 1 &  sigma,
Id  seed,
bool  verbose 
)

Calculate the change of support coefficients by FFT method in the lognormal case on a grid

Returns
r^2 coefficients for the different logarithmic variances
Parameters
[in]dbDb structure
[in]modelModelGeneric structure
[in]paramSimuFFTParam structure
[in]sigmaArray of logarithmic variances
[in]seedSeed for random number generator
[in]verboseVerbose flag

◆ getClosestInteger()

Id gstlrn::getClosestInteger ( double  value)

◆ getDefaultSpace()

const ASpace * gstlrn::getDefaultSpace ( )

◆ getDefaultSpaceDimension()

Id gstlrn::getDefaultSpaceDimension ( )

◆ getDefaultSpaceSh()

ASpaceSharedPtr gstlrn::getDefaultSpaceSh ( )

◆ getDefaultSpaceType()

ESpaceType gstlrn::getDefaultSpaceType ( )

Return a clone of the unique default global space.

◆ getFlagMatrixCheck()

bool gstlrn::getFlagMatrixCheck ( )

◆ getITEST()

Id gstlrn::getITEST ( )

◆ getListActiveToAbsolute()

gstlrn::getListActiveToAbsolute ( const 1 &  sel)

Returns the list of absolute indices for the only active samples A sample is active if its 'sel' value is equal to 1

Parameters
selVector giving the status of all samples (Dimension: absolute)
Returns

◆ getLocatorMultiples()

gstlrn::getLocatorMultiples ( )

◆ getLocatorName()

String gstlrn::getLocatorName ( const ELoc &  locatorType,
Id  locatorIndex 
)

Return the name of Locator

Parameters
locatorTypeType of the Locator (can be negative for 'Rank')
locatorIndexRank within the locator starting from 1 (can be <0 for the keyword only)
Returns

◆ getLocatorNames()

VectorString gstlrn::getLocatorNames ( )

◆ getLocatorTypeFromName()

Id gstlrn::getLocatorTypeFromName ( const String name_type)

◆ getMapAbsoluteToRelative()

std::map< Id, Id > gstlrn::getMapAbsoluteToRelative ( const 1 &  sel,
bool  verbose 
)

Returns the map such that MAP[iabs] = iact. A sample is active if its 'sel' value is equal to 1

Parameters
selVector giving the status of all samples (Dimension: absolute)
verboseVerbose flag
Returns
The map (dimension: nrel)

◆ getMax()

double gstlrn::getMax ( double  val1,
double  val2 
)

◆ getMaxStringSize()

Id gstlrn::getMaxStringSize ( const VectorString list)

Returns the maximum string size of a list of strings

Parameters
listList of strings
Returns
The maximum number of characters

◆ getMin()

double gstlrn::getMin ( double  val1,
double  val2 
)

◆ getMultiThread()

I32 gstlrn::getMultiThread ( )

◆ getNA() [1/5]

template<typename T >
T gstlrn::getNA ( )
inline

◆ getNA() [2/5]

template<>
double gstlrn::getNA ( )
inline

◆ getNA() [3/5]

template<>
Id gstlrn::getNA ( )
inline

◆ getNA() [4/5]

template<>
String gstlrn::getNA ( )
inline

◆ getNA() [5/5]

template<>
float gstlrn::getNA ( )
inline

◆ getRankInList()

Id gstlrn::getRankInList ( const VectorString list,
const String match,
bool  caseSensitive 
)

Return the rank of the (first) item in 'list' which matches 'match'

Parameters
listList of keywords used for search
matchSearched pattern
caseSensitiveCase Sensitive flag
Returns
The index of the matching item or -1

◆ getRankMapAbsoluteToRelative()

Id gstlrn::getRankMapAbsoluteToRelative ( const std::map< Id, Id > &  map,
Id  iabs 
)

Returns the rank of the relative grid node from its absolute index using the Map

Parameters
mapThe <Id,Id> map
iabsAbsolute rank of the grid node
Returns
Rank of the corresponding active (relative) grid node (or -1 is not found)

◆ getRankMapRelativeToAbsolute()

Id gstlrn::getRankMapRelativeToAbsolute ( const std::map< Id, Id > &  map,
Id  irel 
)

◆ getTEST()

double gstlrn::getTEST ( )

◆ getTotalSystemMemory()

unsigned long long gstlrn::getTotalSystemMemory ( )

◆ gibbs_sampler()

Id gstlrn::gibbs_sampler ( Db dbin,
Model model,
Id  nbsimu,
Id  seed,
Id  gibbs_nburn,
Id  gibbs_niter,
bool  flag_moving,
bool  flag_norm,
bool  flag_multi_mono,
bool  flag_propagation,
bool  flag_sym_neigh,
Id  gibbs_optstats,
double  percent,
bool  flag_ce,
bool  flag_cstd,
bool  verbose,
const NamingConvention namconv 
)

Perform the Gibbs sampler

Returns
Error return code
Parameters
[in]dbinDb structure
[in]modelModel structure
[in]nbsimuNumber of simulations
[in]seedSeed for random number generator
[in]gibbs_nburnInitial number of iterations for bootstrapping
[in]gibbs_niterMaximum number of iterations
[in]flag_moving1 for Moving
[in]flag_norm1 if the Model must be normalized
[in]flag_multi_mono1 for the Multi_mono algorithm
[in]flag_propagation1 for the propagation algorithm
[in]flag_sym_neighDeprecated argument
[in]gibbs_optstats0: No stats - 1: Print - 2: Save Neutral file
[in]percentAmount of nugget effect added to too continuous model (expressed in percentage of total variance)
[in]flag_ce1 if the conditional expectation should be returned instead of simulations
[in]flag_cstd1 if the conditional standard deviation should be returned instead of simulations
[in]verboseVerbose flag
[in]namconvNaming convention

◆ global_arithmetic()

Global_Result gstlrn::global_arithmetic ( Db dbin,
DbGrid dbgrid,
ModelGeneric model,
Id  ivar0 = 0,
bool  verbose = false 
)

◆ global_kriging()

Global_Result gstlrn::global_kriging ( Db dbin,
Db dbout,
ModelGeneric model,
Id  ivar0 = 0,
bool  verbose = false 
)

◆ global_transitive()

Id gstlrn::global_transitive ( DbGrid dbgrid,
Model model,
Id  flag_verbose,
Id  flag_regular,
Id  ndisc,
double *  abundance,
double *  sse,
double *  cvtrans 
)

Estimation of the variance by transitive method

Returns
Error return code
Parameters
[in]dbgridDb structure containing the dicretization grid
[in]modelModel structure
[in]flag_verbose1 for a verbose output
[in]flag_regular1 for regular; 0 for stratified
[in]ndiscNumber of Discretization steps
[out]abundanceGlobal estimated abundance
[out]sseGlobal standard deviation
[out]cvtransCV transitive

◆ golden_search()

double gstlrn::golden_search ( double(*)(double test, void *user_data)  func_evaluate,
void *  user_data,
double  tolstop,
double  a0,
double  c0,
double *  test_loc,
double *  niter 
)

Golden Search algorithm

Returns
The estimated value
Parameters
[in]func_evaluateEvaluating function
[in]user_dataUser Data
[in]tolstopTolerance parameter
[in]a0Initial value for lower bound of interval
[in]c0Initial value for upper bound of interval
[out]test_locFinal value of the evaluating function
[out]niterNumber of iterations

◆ grid_iterator_init()

void gstlrn::grid_iterator_init ( Grid grid,
const 1 &  order 
)

Initialize the Grid iterator

◆ grid_iterator_next()

gstlrn::grid_iterator_next ( Grid grid)

Returns 1 when the last element of the iteration is reached

Increment the Grid iterator

◆ gslBaseName()

String gstlrn::gslBaseName ( const String path,
bool  keepExtension = false 
)

◆ gslFileExist() [1/2]

bool gstlrn::gslFileExist ( const char *  path,
const char *  mode 
)

◆ gslFileExist() [2/2]

bool gstlrn::gslFileExist ( const String path,
const String mode 
)

◆ gslFopen() [1/2]

FILE * gstlrn::gslFopen ( const char *  path,
const char *  mode 
)

◆ gslFopen() [2/2]

FILE * gstlrn::gslFopen ( const String path,
const String mode 
)

◆ gslGetEnv()

String gstlrn::gslGetEnv ( const String name)

◆ gslSafeGetline()

std::istream & gstlrn::gslSafeGetline ( std::istream &  is,
String t 
)

Get line from an input text stream whatever the end of line convention. Thanks to: https://stackoverflow.com/a/6089413

◆ gslScanf()

Id gstlrn::gslScanf ( const char *  fmt,
  ... 
)

◆ gslSPrintf() [1/2]

Id gstlrn::gslSPrintf ( char *  dst,
Id  n,
const char *  fmt,
  ... 
)

◆ gslSPrintf() [2/2]

Id gstlrn::gslSPrintf ( String dst,
const char *  fmt,
  ... 
)

◆ gslSPrintfCat()

Id gstlrn::gslSPrintfCat ( String dst,
const char *  fmt,
  ... 
)

◆ gslSScanf()

Id gstlrn::gslSScanf ( const char *  str,
const char *  fmt,
  ... 
)

◆ gslStrcat() [1/3]

char * gstlrn::gslStrcat ( char *  dst,
Id  n,
const char *  src 
)

◆ gslStrcat() [2/3]

void gstlrn::gslStrcat ( String dst,
const char *  src 
)

◆ gslStrcat() [3/3]

void gstlrn::gslStrcat ( String dst,
const String src 
)

◆ gslStrcpy() [1/3]

char * gstlrn::gslStrcpy ( char *  dst,
Id  n,
const char *  src 
)

◆ gslStrcpy() [2/3]

void gstlrn::gslStrcpy ( String dst,
const char *  src 
)

◆ gslStrcpy() [3/3]

void gstlrn::gslStrcpy ( String dst,
const String src 
)

◆ gslStrtok()

char * gstlrn::gslStrtok ( char *  str,
const char *  delim 
)

◆ haveCompatibleNVar()

bool gstlrn::haveCompatibleNVar ( const Db db1,
const Db db2,
Id nvar 
)

Given two Dbs, check that they have same Variable Number (locator Z) The first or the second Db must be undefined When both are undefined, FALSE if returned When both are defined, return the Maximum value.

Parameters
db1
db2
nvarCommon number of variables
Returns
true
false

◆ haveSameNDim()

bool gstlrn::haveSameNDim ( const Db db1,
const Db db2,
Id ndim 
)

Given two Dbs, check that they have same Space Dimension The first or the second Db must be undefined When both are undefined, FALSE if returned.

Parameters
db1
db2
ndimCommon space dimension
Returns
true
false

◆ hermiteCoefIndicator()

gstlrn::hermiteCoefIndicator ( double  yc,
Id  nbpoly 
)
Parameters
ycCutoff Value
nbpolyNumber of Hermite polynomials
Returns
The vector of coefficients of the Indicator

◆ hermiteCoefLower()

gstlrn::hermiteCoefLower ( double  y,
Id  nbpoly 
)

Returns the vector of Hermite coefficients of the gaussian floored at 'y'

Parameters
yFloor value
nbpolyNumber of Polynomial functions
Returns
Hermite Coefficients

◆ hermiteCoefMetal()

gstlrn::hermiteCoefMetal ( double  yc,
const 1 &  phi 
)
Parameters
ycCutoff Value
phiCoefficients of Hermite polynomial
Returns
The vector of coefficients of the Metal Quantity

◆ hermiteCondExp()

gstlrn::hermiteCondExp ( krigest,
krigstd,
const 1 &  phi 
)

Calculate the Conditional Expectation: E[Z | Z1=z1, Z2=z2, ..., Zn=zn] = Id Phi(y_kk + s_k u) g(u) du

Parameters
krigestVector of Kriging estimates
krigstdVector of Kriging standard deviations
phiArray of Hermite coefficients
Returns
Conditional Expectation

◆ hermiteCondExpElement()

double gstlrn::hermiteCondExpElement ( double  krigest,
double  krigstd,
const 1 &  phi 
)

◆ hermiteCondStd()

gstlrn::hermiteCondStd ( krigest,
krigstd,
const 1 &  phi 
)

Vector of conditional variances (same dimension as krigest and krigstd)

Parameters
krigestVector of Kriging estimate
krigstdVector of Kriging standard deviations
phiArray of Hermite coefficients
Returns

◆ hermiteCondStdElement()

double gstlrn::hermiteCondStdElement ( double  krigest,
double  krigstd,
const 1 &  phi 
)

◆ hermiteIncompleteIntegral()

MatrixSquare gstlrn::hermiteIncompleteIntegral ( double  yc,
Id  nbpoly 
)
Parameters
ycCutoff Value
nbpolyNumber of Hermite polynomials
Returns
The matrix of Incomplete Integral (Dimension: nbpoly * nbpoly)

◆ hermiteIndicator()

gstlrn::hermiteIndicator ( double  yc,
krigest,
krigstd 
)
Parameters
ycCutoff Value
krigestEstimation
krigstdStandard deviation of estimation error
Returns
The indicator above Cutoff

◆ hermiteIndicatorElement()

double gstlrn::hermiteIndicatorElement ( double  yc,
double  krigest,
double  krigstd 
)

◆ hermiteIndicatorLower()

gstlrn::hermiteIndicatorLower ( double  y,
Id  nbpoly 
)

◆ hermiteIndicatorStd()

gstlrn::hermiteIndicatorStd ( double  yc,
krigest,
krigstd 
)

◆ hermiteIndicatorStdElement()

double gstlrn::hermiteIndicatorStdElement ( double  yc,
double  krigest,
double  krigstd 
)

◆ hermiteLognormal()

gstlrn::hermiteLognormal ( double  mean,
double  sigma,
Id  nbpoly 
)

Hermite coefficient for a lognormal transform mean * exp(sigma * Y + 1/2 * sigma^2)

Parameters
meanMean value
sigmaStandard deviation
nbpolyNumber of Hermite polynomials
Returns
The array of coefficients

◆ hermiteMetal()

gstlrn::hermiteMetal ( double  yc,
krigest,
krigstd,
const 1 &  phi 
)
Parameters
ycCutoff Value
krigestEstimation
krigstdStandard deviation of estimation error
phiHermite coefficients
Returns
The Metal

◆ hermiteMetalElement()

double gstlrn::hermiteMetalElement ( double  yc,
double  krigest,
double  krigstd,
const 1 &  phi 
)

◆ hermiteMetalStd()

gstlrn::hermiteMetalStd ( double  yc,
krigest,
krigstd,
const 1 &  phi 
)

◆ hermiteMetalStdElement()

double gstlrn::hermiteMetalStdElement ( double  yc,
double  krigest,
double  krigstd,
const 1 &  phi 
)

◆ hermitePolynomials() [1/2]

gstlrn::hermitePolynomials ( double  y,
double  r,
const 1 &  ifacs 
)

Returns the vector of Hermite Polynomials selected by ranks

Parameters
yTarget variable
rChange of support coefficient
ifacsVector of ranks (staring from 0)
Returns
The vector of Hi(y) where 'i' is in 'ifacs'

◆ hermitePolynomials() [2/2]

gstlrn::hermitePolynomials ( double  y,
double  r,
Id  nbpoly 
)

Calculation of the Hermite Polynomials for a given value

Parameters
yGaussian value for which the Hermite polynomials are calculated
rChange of support coefficient
nbpolyNumber of Hermite polynomials
Returns
The vector of polynomials (Dimension: nbpoly)

◆ hermiteSeries()

double gstlrn::hermiteSeries ( const 1 &  an,
const 1 &  hn 
)

Evaluate the Hermite expansion

Parameters
anSeries of coefficients of the Hermite polynomials
hnHermite polynomial values
Returns
The result of the expansion

◆ hscatterPairs()

gstlrn::hscatterPairs ( Db db,
const String name1,
const String name2,
VarioParam varioparam,
Id  ilag,
Id  idir,
bool  verbose 
)

Evaluate the shifted correlation calculated as follows: Correl(Z1(x) , Z2(x+h))

Returns
Vector of indices (or VectorVectorInt())
Parameters
[in]dbDb descriptor
[in]name1Name of the first variable
[in]name2Name of the second variable
[in]varioparampointer to a VarioParam structure
[in]ilagRank of the lag of interest
[in]idirRank of the direction of interest (within VarioParam)
[in]verboseVerbose flag
Remarks
The returned Vector of Vector of integer 'indices' contain
the set of indices of the pairs of samples.
Its contents is i1,j1,i2,j2,...
The indices are numbered starting from 1

◆ IFFFF()

bool gstlrn::IFFFF ( Id  value)

Checks if an integer value is TEST

Returns
true if a ITEST value is encountered; 0 otherwise
Parameters
[in]valueValue to be tested

◆ incrementStringVersion()

String gstlrn::incrementStringVersion ( const String string,
Id  rank = 1,
const String delim = "." 
)

◆ index_point_to_grid()

Id gstlrn::index_point_to_grid ( const Db dbin,
Id  iech,
Id  flag_outside,
const DbGrid dbout,
double *  coor 
)

Find the index of the output grid file which is the closest to the sample of the input file

Returns
Error return code
>= index of the grid node
-1 if the point is outside the grid
Parameters
[in]dbindescriptor of the input file
[in]iechIndex of the data point
[in]flag_outsidevalue returned for the point outside the grid
  • 1 the index is set to the closest grid node
  • 0 the index is set to -1
  • -1 do not correct the index
[in]dboutdescriptor of the output grid file
[out]coorWorking array (dimension: ndim)

◆ inhomogeneous_kriging()

Id gstlrn::inhomogeneous_kriging ( Db dbdat,
Db dbsrc,
Db dbout,
double  power,
Id  flag_source,
Model model_dat,
Model model_src 
)

Inhomogeneous Kriging with Sources

Returns
Error return code
Parameters
[in]dbdatDb structure containing Data
[in]dbsrcDb structure containing Sources
[in]dboutOutput Db structure
[in]powerPower of the Distance decay
[in]flag_sourceIf the result is the source, rather than diffusion
[in]model_datModel structure for the data
[in]model_srcModel structure for the sources

◆ init_cell()

static void gstlrn::init_cell ( double  vx,
double  vy,
double  vz,
Id  xl,
Id  yl,
Id  zl 
)
static

◆ init_cellh()

static double gstlrn::init_cellh ( double  vh,
double  vv,
double  hsc,
double  hsn 
)
static

◆ init_nearest()

static void gstlrn::init_nearest ( void  )
static

◆ init_point()

static Id gstlrn::init_point ( void  )
static

◆ integralGaussHermite()

double gstlrn::integralGaussHermite ( double  yc,
double  r,
const 1 &  psi 
)

Calculate: Id phi(r*y + u * sqrt(1-r^2)) g(u) du

Parameters
ycCutoff value
rChange of support coefficient
psiVector of Hermite coefficients
Returns
Vector of returned values for all Hermite coefficients

◆ interpolateVariableToPoint()

Id gstlrn::interpolateVariableToPoint ( DbGrid db_grid,
Id  iatt,
Id  np,
const double *  xp,
const double *  yp,
const double *  zp,
double *  tab 
)

Interpolate a variable from a grid Db on discretization points

Parameters
[in]db_gridDescriptor of the grid parameters
[in]iattRank of the attribute in db_grid
[in]npNumber of discretized points
[in]xpArray of first coordinates
[in]ypArray of second coordinates
[in]zpArray of third coordinates
[out]tabOutput array
Remarks
The arguments 'xp', 'yp' and 'zp' must be defined in accordance
with the space dimension in argument 'db_grid'
A point which does not lie between two valuated grid nodes
(in all space dimensions) is always set to FFFF

◆ inverseDistance()

Id gstlrn::inverseDistance ( Db dbin,
Db dbout,
double  exponent,
bool  flag_expand,
double  dmax,
bool  flag_est,
bool  flag_std,
Model model,
const NamingConvention namconv 
)

Inverse distance estimation

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]exponentexponent of the inverse distance
[in]flag_expandTrue for expansion option (if dbin is Grid)
[in]dmaxMaximum search radius (if dbin is Points)
[in]flag_estTrue if the estimation must be calculated
[in]flag_stdTrue if the St. Dev. must be calculated
[in]modelModel structure (used for St. Dev.)
[in]namconvNaming convention

◆ invgen()

static Id gstlrn::invgen ( MatrixSymmetric a,
MatrixSymmetric tabout 
)
static

Calculate the generalized inverse of a square symmetric matrix

Returns
Error returned code
Parameters
[in]aMatrix to be inverted
[out]taboutInverted matrix

◆ is_grid_multiple()

Id gstlrn::is_grid_multiple ( DbGrid db1,
DbGrid db2 
)

Check if a grid is a multiple of the other grid

Returns
1 if the two grid are multiple; 0 otherwise
Parameters
[in]db1Db1 small grid structure
[in]db2Db1 coarse grid structure

◆ isDefaultSpaceSphere()

bool gstlrn::isDefaultSpaceSphere ( )

◆ isEqual()

bool gstlrn::isEqual ( double  v1,
double  v2,
double  eps = EPSILON10 
)

◆ isEqualExtended()

bool gstlrn::isEqualExtended ( double  v1,
double  v2,
double  eps,
bool  flagRelative,
bool  flagAbsolute,
const String string 
)

Function checking that two values are equal This verbose method is essentially used in tests.

Parameters
v1First value to be compared
v2Second value to be compared
epsTolerance used for comparison
flagRelativewhen True, the values are compared without paying attention to their sign
flagAbsolutewhen True, test is run on absolute difference
stringMessage to be displayed when the vectors are not similar
Returns
Boolean

◆ isEven()

bool gstlrn::isEven ( Id  number)

◆ isInteger()

bool gstlrn::isInteger ( double  value,
double  eps = EPSILON10 
)

◆ isLocatorTypeValid()

bool gstlrn::isLocatorTypeValid ( const ELoc &  locatorType,
bool  unknownValid 
)

Check if the Locator type is valid or not Note that the locator type is returned as -1 for non identified locator (such as rank)

Parameters
locatorTypeThe locator type to be identified
unknownValidTrue if ELoc::UNKNOWN is considered as valid
Returns

◆ isMultiple()

bool gstlrn::isMultiple ( Id  nbig,
Id  nsmall 
)

◆ isMultiThread()

bool gstlrn::isMultiThread ( )

◆ isNA() [1/5]

template<>
bool gstlrn::isNA ( const double &  v)
inline

◆ isNA() [2/5]

template<>
bool gstlrn::isNA ( const float &  v)
inline

◆ isNA() [3/5]

template<>
bool gstlrn::isNA ( const Id v)
inline

◆ isNA() [4/5]

template<>
bool gstlrn::isNA ( const String v)
inline

◆ isNA() [5/5]

template<typename T >
bool gstlrn::isNA ( const T &  v)
inline

◆ isOdd()

bool gstlrn::isOdd ( Id  number)

◆ isOne()

bool gstlrn::isOne ( double  value,
double  eps = EPSILON10 
)

◆ isTurbo()

bool gstlrn::isTurbo ( const VectorMeshes meshes)

Check if a series of Meshes (included in 'meshes') are Turbo.

Parameters
meshes
Returns
True if ALL meshes are TURBO

◆ isZero()

bool gstlrn::isZero ( double  value,
double  eps = EPSILON10 
)

◆ kclusters()

gstlrn::kclusters ( const 1 &  data,
Id  nvar,
Id  nech,
Id  nclusters,
Id  npass,
Id  mode,
Id  verbose 
)

Perform k-means clustering on a given set of variables. The number of clusters is given in input

Returns
Array of cluster coordinates
Parameters
[in]dataArray of values
[in]nvarNumber of samples
[in]nechNumber of variables
[in]nclustersNumber if clusters
[in]npassNumber of times clustering is performed
[in]mode0 for k-means and 1 for k-medians
[in]verboseVerbose option

◆ KeysToStatOptions()

std::vector< EStatOption > gstlrn::KeysToStatOptions ( const VectorString opers)

◆ kmedoids()

gstlrn::kmedoids ( const 1 &  data,
Id  nvar,
Id  nech,
Id  nclusters,
Id  npass,
Id  verbose 
)

Perform k-medoids clustering on a given set of variables. The number of clusters is given in input

Returns
Array of cluster indices
Parameters
[in]dataArray of values
[in]nvarNumber of samples
[in]nechNumber of variables
[in]nclustersNumber if clusters
[in]npassNumber of times clustering is performed
[in]verboseVerbose option

◆ kribayes()

Id gstlrn::kribayes ( Db dbin,
Db dbout,
ModelGeneric model,
ANeigh neigh,
const 1 &  prior_mean,
const MatrixSymmetric prior_cov,
bool  flag_est,
bool  flag_std,
const NamingConvention namconv 
)

Estimation with Bayesian Drift

Returns
Error return code
Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure
[in]modelModelGeneric structure
[in]neighANeigh structure
[in]prior_meanArray giving the prior means for the drift terms
[in]prior_covArray containing the prior covariance matrix for the drift terms
[in]flag_estPointer for the storing the estimation
[in]flag_stdPointer for the storing the standard deviation
[in]namconvNaming convention

◆ krigcell()

Id gstlrn::krigcell ( Db dbin,
Db dbout,
ModelGeneric model,
ANeigh neigh,
bool  flag_est,
bool  flag_std,
const KrigOpt krigopt,
const NamingConvention namconv 
)

Standard Block Kriging with variable cell dimension

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModelGeneric structure
[in]neighANeigh structure
[in]flag_estOption for the storing the estimation
[in]flag_stdOption for the storing the standard deviation
[in]krigoptKrigOpt structure
[in]namconvNaming convention

◆ krige_koption_manage()

Id gstlrn::krige_koption_manage ( Id  mode,
Id  flag_check,
const EKrigOpt &  calcul,
Id  flag_rand,
const 1 &  ndiscs 
)

Management of Kriging option

Returns
Error return code
Parameters
[in]mode1 for allocation; -1 for deallocation
[in]flag_check1 if the file should be checked
[in]calculType of calculation (EKrigOpt)
[in]flag_rand0 if the second discretization is regular 1 if the second point must be randomized
[in]ndiscsDiscretization parameters (or NULL)
Remarks
This function manages the global structure KOPTION

◆ krige_lhs_print()

void gstlrn::krige_lhs_print ( Id  nech,
Id  neq,
Id  nred,
const Id flag,
const double *  lhs 
)

Print the L.H.S. matrix

Parameters
[in]nechNumber of active points (optional)
[in]neqNumber of equations
[in]nredReduced number of equations
[in]flagFlag array (optional)
[in]lhsKriging L.H.S

◆ krige_rhs_print()

void gstlrn::krige_rhs_print ( Id  nvar,
Id  nech,
Id  neq,
Id  nred,
const Id flag,
double *  rhs 
)

Print the R.H.S. matrix

Parameters
[in]nvarNumber of variables
[in]nechNumber of active points (optional)
[in]neqNumber of equations
[in]nredReduced number of equations
[in]flagFlag array (optional)
[in]rhsKriging R.H.S. matrix

◆ kriggam()

Id gstlrn::kriggam ( Db dbin,
Db dbout,
ModelGeneric model,
ANeigh neigh,
AAnam anam,
const NamingConvention namconv 
)

Punctual Kriging in the Anamorphosed Gaussian Model

Returns
Error return code
Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure
[in]modelModelGeneric structure
[in]neighANeigh structure
[in]anamAAnam structure
[in]namconvNaming convention

◆ kriging()

Id gstlrn::kriging ( Db dbin,
Db dbout,
ModelGeneric model,
ANeigh neigh,
bool  flag_est,
bool  flag_std,
bool  flag_varz,
const KrigOpt krigopt,
const NamingConvention namconv 
)

Standard Kriging

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModelGeneric structure
[in]neighANeigh structure
[in]flag_estOption for storing the estimation
[in]flag_stdOption for storing the standard deviation
[in]flag_varzOption for storing the variance of the estimator (only available for stationary model)
[in]krigoptKrigOpt structure
[in]namconvNaming convention

◆ krigingFactors()

Id gstlrn::krigingFactors ( Db dbin,
Db dbout,
Model model,
ANeigh neigh,
bool  flag_est,
bool  flag_std,
const KrigOpt krigopt,
const NamingConvention namconv 
)

Disjunctive Kriging

Returns
Error return code
Parameters
[in]dbininput Db structure (containing the factors)
[in]dboutoutput Grid Db structure
[in]modelModel structure
[in]neighANeigh structure
[in]flag_estOption for the storing the estimation
[in]flag_stdOption for the storing the standard deviation
[in]krigoptKrigopt structure
[in]namconvNaming convention
Remarks
When the change of support is defined through the Anamorphosis
the 'calcul' option must be set to POINT and 'ndisc' does not
have to be defined

◆ krigingSPDE()

Id gstlrn::krigingSPDE ( Db dbin,
Db dbout,
Model model,
bool  flag_est,
bool  flag_std,
Id  useCholesky,
const VectorMeshes meshesK,
const ProjMultiMatrix projInK,
const VectorMeshes meshesS,
const ProjMultiMatrix projInS,
const ProjMultiMatrix projOutK,
const ProjMultiMatrix projOutS,
const SPDEParam params,
bool  verbose,
const NamingConvention namconv 
)

Perform the estimation by KRIGING under the SPDE framework

Parameters
dbinInput Db (must contain the variable to be estimated)
dboutOutput Db where the estimation must be performed
modelModel definition
flag_estTrue for the estimation
flag_stdTrue for the standard deviation of estimation error
useCholeskyDefine the choice regarding Cholesky (see _defineCholesky)
meshesKMeshes description (optional)
projInKMatrix of projection (optional)
meshesSMeshes used for Variance calulcation (optional)
projInSMatrix of projection used for Variance calculation (optional)
projOutKMatrix of projection on dbout used for Kriging (optional)
projOutSMatrix of projection on dbout used for Simulations (optional)
paramsSet of SPDE parameters
verboseVerbose flag
namconvNaming convention
Returns
Returned vector
Remarks
Algorithm for 'meshesK' or 'mesheS' and 'projInK' or 'projInS':
  • Each one of the previous arguments is considered individually and sequentially.
  • For 'meshes' in general ('meshesK' or 'meshesS'):
    • If it is not defined, it is created from 'model' and so as to cover both 'dbin' and 'dbout' (if provided).
    • If is already exist, the number of meshes must be equal:
      • either to 1: the same mesh is used for all structures
      • or to the number of structures (nugget discarded)
    • Otherwise an error is raised
  • For 'projIn' in general ('projInK' or 'projInS'):
    • If it is not defined, it is created from 'meshesK'
    • If it is already exist, the number of projectors must be equal to the number of meshes
    • Otherwise an error is raised
  • If 'mesheS' does not exist, 'meshesK' is used instead
  • If 'projInS' does not exist, 'projInK' is used instead

'meshesS' and 'projInS' are used only if 'flag_std' is true and useCholesky=0

◆ krigingVecchia()

Id gstlrn::krigingVecchia ( Db dbin,
Db dbout,
ModelGeneric model,
Id  nb_neigh = 5,
bool  verbose = false,
const NamingConvention namconv = NamingConvention("Vecchia") 
)

◆ krigsampling_f()

Id gstlrn::krigsampling_f ( Db dbin,
Db dbout,
Model model,
double  beta,
1 &  ranks1,
1 &  ranks2,
bool  flag_std,
Id  verbose 
)

Perform the Kriging procedure using the parcimonious search within the whole input data set

Returns
Error retun code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModel structure
[in]betaThresholding value
[in]ranks1Ranks of exact pivots
[in]ranks2Ranks of ACP pivots
[in]flag_stdOption for storing the standard deviation
[in]verboseVerbose flag

◆ krigsum()

Id gstlrn::krigsum ( Db dbin,
Db dbout,
Model model,
ANeigh neigh,
bool  flag_positive,
const NamingConvention namconv 
)

Punctual Multivariate Kriging under a constraint

Returns
Error return code
Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure
[in]modelModel structure (univariate)
[in]neighANeigh structure
[in]flag_positive1 for a positive constraints
[in]namconvNaming convention
Remarks
All the variables are estimated using the same model
In this procedure, we assume that:
- the problem is multivariate ("z" variables)
- the constraints is stored in "sum" (only used in dbout)

◆ krigtest()

Krigtest_Res gstlrn::krigtest ( Db dbin,
Db dbout,
ModelGeneric model,
ANeigh neigh,
Id  iech0,
const KrigOpt krigopt,
bool  verbose 
)

Perform kriging and return the calculation elements

Returns
A Krigtest_Res structure
Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure
[in]modelModelGeneric structure
[in]neighANeigh structure
[in]iech0Rank of the target sample
[in]krigoptKrigOpt structure
[in]verboseWhen TRUE, the full debugging flag is switched ON (the current status is reset after the run)

◆ krimage()

Id gstlrn::krimage ( DbGrid dbgrid,
Model model,
ANeigh neigh,
bool  flagFFT,
bool  verbose,
Id  seed,
const NamingConvention namconv 
)

Kriging (Factorial) a regular grid

Returns
Error return code
Parameters
[in]dbgridinput and output Db grid structure
[in]modelModel structure
[in]neighANeigh structure
[in]flagFFTTrue if the FFT version is to be used
[in]verboseVerbose flag
[in]seedSeed used for random number generation
[in]namconvNaming Convention

◆ law_beta1()

double gstlrn::law_beta1 ( double  parameter1,
double  parameter2 
)

Generate random numbers according to a beta distribution (first kind)

Returns
Beta random value (first kind)
Parameters
[in]parameter1first parameter of the beta distribution
[in]parameter2first parameter of the beta distribution

◆ law_beta2()

double gstlrn::law_beta2 ( double  parameter1,
double  parameter2 
)

Generate random numbers according to a beta distribution (second kind)

Returns
Beta random value (second kind)
Parameters
[in]parameter1first parameter of the beta distribution
[in]parameter2first parameter of the beta distribution

◆ law_binomial()

Id gstlrn::law_binomial ( Id  n,
double  p 
)

Generates a binomial value

Returns
The binomial value
Parameters
[in]nNumber of trials
[in]pEvent probability

◆ law_cdf_gaussian()

double gstlrn::law_cdf_gaussian ( double  value)

Cumulated density function of a gaussian distribution

Returns
Gaussian cumulated density function
Parameters
[in]valueraw value
Remarks
Handbook P932 (26.2.17) precision <7.5 E-08

◆ law_df_bigaussian()

double gstlrn::law_df_bigaussian ( 1 &  vect,
1 &  mean,
MatrixSymmetric correl 
)

Density function of a bigaussian distribution

Returns
Gaussian density function
Parameters
[in]vectArray of values (Dimension = 2)
[in]meanArray of means (Dimension = 2)
[in]correlCorrelation matrix (Dimension: 2*2)

◆ law_df_gaussian()

double gstlrn::law_df_gaussian ( double  value)

Density function of a gaussian distribution

Returns
Gaussian density function
Parameters
[in]valueraw value

◆ law_df_multigaussian()

double gstlrn::law_df_multigaussian ( 1 &  vect,
MatrixSymmetric correl 
)

Density function of a multigaussian distribution

Returns
Gaussian density function
Parameters
[in]vectArray of values (Dimension = nvar)
[in]correlCorrelation matrix (Dimension: nvar*nvar)

◆ law_df_poisson()

double gstlrn::law_df_poisson ( Id  i,
double  parameter 
)

◆ law_df_poisson_vec()

gstlrn::law_df_poisson_vec ( is,
double  parameter 
)

◆ law_df_quadgaussian()

double gstlrn::law_df_quadgaussian ( 1 &  vect,
MatrixSymmetric correl 
)

Density function of a quadrigaussian distribution

Returns
Gaussian density function
Parameters
[in]vectArray of values (Dimension = nvar)
[in]correlCorrelation matrix (Dimension: nvar*nvar)

◆ law_dnorm()

double gstlrn::law_dnorm ( double  value,
double  mean,
double  std 
)

Density function of a (non-normalized) gaussian distribution

Returns
Gaussian density function
Parameters
[in]valueRaw value
[in]meanMean value
[in]stdStandard deviation

◆ law_exp_sample()

gstlrn::law_exp_sample ( const double *  tabin,
Id  mode,
Id  nvar,
Id  nechin,
Id  nechout,
Id  niter,
Id  nconst,
double *  consts,
Id  seed,
double  percent 
)

Sample a multivariate empirical distribution

Returns
Address to the newly created array
Parameters
[in]tabinInput array
[in]modeDescribes the way 'tabin' and 'tabout' are filled 1: by column; 2: by row
[in]nvarNumber of variables (input and output)
[in]nechinNumber of samples in the input array
[in]nechoutNumber of created samples
[in]niterMaximum number of iterations
[in]nconstNumber of constraints
[in]constsArray of constraints (optional) (Dimension: nconst * (nvar+1)) This array is entered by line
[in]seedValue for the seed generator
[in]percentDimension of the convolution kernel expressed as a percentage of the dispersion st. dev. Should be between 0 and 100
Remarks
The input array must be isotopic (otherwise, an error is issued)
The resulting VectorDouble if dimensionned to nvar * nechout
Consider nvar1 = nvar + 1
Sample temp[1:nvar1] is authorized for Constraint 'iconst' if:
Sum_ivar1^{1:nvar1) consts[iconst,ivar1) * temp[ivar1] > 0

◆ law_exponential()

double gstlrn::law_exponential ( double  lambda)

Generate random numbers according to exponential distribution

Returns
Exponential random value
Parameters
[in]lambdaParameter of exponential distribution

◆ law_gamma()

double gstlrn::law_gamma ( double  alpha,
double  beta 
)

Generate random numbers according to a gamma distribution

Returns
Gamma random value
Parameters
[in]alphaparameter of the gamma distribution
[in]betaSecond parameter of the Gamma distribution

◆ law_gaussian()

double gstlrn::law_gaussian ( double  mean,
double  sigma 
)

Generate random numbers according to a gaussian distribution

Returns
Gaussian random value
Parameters
[in]meanMean of the Normal Distribution
[in]sigmaStandard deviation of the Normal Distribution

◆ law_gaussian_between_bounds()

double gstlrn::law_gaussian_between_bounds ( double  binf,
double  bsup 
)

Generates a gaussian value which lies in an interval

Returns
The gaussian value
Parameters
[in]binflower bound of the interval
[in]bsupupper bound of the interval

◆ law_get_random_seed()

Id gstlrn::law_get_random_seed ( void  )

read the seed for the random number generator

Returns
The current value of the seed (integer)

◆ law_int_uniform()

Id gstlrn::law_int_uniform ( Id  mini,
Id  maxi 
)

Draw an integer random number according to a uniform distribution

Returns
Integer Uniform random value within an interval
Parameters
[in]miniminimum value
[in]maximaximum value

◆ law_invcdf_gaussian()

double gstlrn::law_invcdf_gaussian ( double  value)

Inverse cumulated density function of a gaussian distribution

Returns
Inverse of gaussian cumulated density function
Parameters
[in]valuecumulative density

◆ law_poisson()

Id gstlrn::law_poisson ( double  parameter)

Generate random number according to a poisson distribution

Returns
Poisson random value
Parameters
[in]parameterparameter of the Poisson distribution
Remarks
Method Ahrens-Dieter (1973)

◆ law_random_path()

gstlrn::law_random_path ( Id  nech)

Define a random path

Parameters
[in]nech: Number of samples

◆ law_set_old_style()

void gstlrn::law_set_old_style ( bool  style)

Set the type of Usage for Random Number Generation

Parameters
styletrue for using Old Style; false for using New Style

◆ law_set_random_seed()

void gstlrn::law_set_random_seed ( Id  seed)

Sets the seed for the random number generator

Parameters
[in]seedthe new value given to the seed

◆ law_stable()

double gstlrn::law_stable ( double  alpha,
double  beta,
double  gamma,
double  delta 
)

Generate random numbers according to a stable distribution

Returns
Stable value with unit parameters
Parameters
[in]alphavalue of the alpha parameter
[in]betavalue of the beta parameter
[in]gammavalue of the gamma parameter
[in]deltavalue of the delta parameter

◆ law_stable_a()

double gstlrn::law_stable_a ( double  alpha,
double  beta,
double  gamma,
double  delta 
)

Generate random numbers according to a stable distribution (alpha != 1)

Returns
Stable value with unit parameters
Parameters
[in]alphavalue of the alpha parameter
[in]betavalue of the beta parameter
[in]gammavalue of the gamma parameter
[in]deltavalue of the delta parameter

◆ law_stable_a1()

double gstlrn::law_stable_a1 ( double  beta,
double  gamma,
double  delta 
)

Generate random numbers according to a stable distribution (alpha=1)

Returns
Stable value with unit parameters
Parameters
[in]betavalue of the beta parameter
[in]gammavalue of the gamma parameter
[in]deltavalue of the delta parameter

◆ law_stable_standard_a1gd()

double gstlrn::law_stable_standard_a1gd ( double  beta)

Generate random numbers according to a standard stable distribution (alpha=1)

Returns
Stable value with standard parameters (alpha=gamma=1,delta=0)
Parameters
[in]betavalue of the beta parameter

◆ law_stable_standard_abgd()

double gstlrn::law_stable_standard_abgd ( double  alpha)

Generate random numbers according to a standard stable distribution

Returns
Stable value with std. parameters (beta=gamma=1,delta=0,alpha!=1)
Parameters
[in]alphavalue of the alpha parameter

◆ law_stable_standard_agd()

double gstlrn::law_stable_standard_agd ( double  alpha,
double  beta 
)

Generate random numbers according to a standard stable distribution

Returns
Stable value with standard parameters (gamma=1,delta=0,alpha!=1)
Parameters
[in]alphavalue of the alpha parameter
[in]betavalue of the beta parameter

◆ law_uniform()

double gstlrn::law_uniform ( double  mini,
double  maxi 
)

Draw a random number according to a uniform distribution

Returns
Uniform random value within an interval
Parameters
[in]miniminimum value
[in]maximaximum value

◆ leastSquares()

Id gstlrn::leastSquares ( Db dbin,
Db dbout,
ANeigh neigh,
Id  order,
const NamingConvention namconv 
)

Polynomial estimation using Least Squares

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]neighANeigh structure
[in]orderOrder of the polynomial
[in]namconvNaming Convention

◆ lmlayers_alloc()

static LMlayers * gstlrn::lmlayers_alloc ( Id  flag_same,
Id  flag_vel,
Id  flag_cumul,
Id  flag_ext,
Id  flag_z,
Id  colrefd,
Id  colreft,
Id  colrefb,
Id  irf_rank,
Id  match_time,
Id  nlayers 
)
static

Allocate the Multi-Layers internal structure

Returns
Pointer to the allocated structure
Parameters
[in]flag_same1 if input and output files coincide
[in]flag_vel1 if work is performed in Velocity, 0 for Depth
[in]flag_cumul1 if work must be done on Depth; 0 on Thickness
[in]flag_ext1 if external drift must be used; 0 otherwise
[in]flag_z1 if the output must be provided in depth
[in]colrefdRank of the reference depth variable
[in]colreftRank of the reference Time variable in Dbout
[in]colrefbRank of the reference Bottom Depth variable
[in]irf_rankRank of the Intrinsic Random Function (0 or 1)
[in]match_timePointer to the Time pointer (1 if defined as ELoc::F or 0 for ELoc::TIME)
[in]nlayersNumber of layers

◆ lmlayers_free()

static LMlayers * gstlrn::lmlayers_free ( LMlayers lmlayers)
static

Free the Multi-Layers internal structure

Returns
Pointer to the freed structure
Parameters
[in]lmlayersPointer to the LMlayers structure to be freed

◆ lmlayers_print()

static void gstlrn::lmlayers_print ( LMlayers lmlayers)
static

Print the Multi-Layers internal structure

Parameters
[in]lmlayersPointer to the LMlayers structure

◆ locatorIdentify()

Id gstlrn::locatorIdentify ( String  string,
ELoc *  ret_locatorType,
Id ret_locatorIndex,
Id ret_mult 
)

Given a locator string, extract its characteristics

Parameters
stringLocator string
ret_locatorTypeResulting Locator type
ret_locatorIndexResulting Locator rank (starting from 0)
ret_multResulting Locator multiplicity (1: unique; 0: multiple)
Returns
Error code

◆ loggamma()

double gstlrn::loggamma ( double  parameter)

Calculation of the logarithm of the gamma function

Returns
Logarithm of the gamma function
Parameters
[in]parameterraw value

◆ logLikelihood()

double gstlrn::logLikelihood ( const Db db,
ModelGeneric model,
bool  verbose 
)

◆ logLikelihoodSPDE()

double gstlrn::logLikelihoodSPDE ( Db dbin,
Model model,
Id  useCholesky,
const VectorMeshes meshes,
const ProjMultiMatrix projIn,
const SPDEParam params,
bool  verbose 
)

Calculate the Log-Likelihood under the SPDE framework

Parameters
dbinInput Db (must contain the variable to be estimated)
modelModel definition
useCholeskyDefine the choice regarding Cholesky (see _defineCholesky)
meshesMeshes description (optional)
projInMatrix of projection (optional)
paramsSet of SPDE parameters
verboseTrue for verbose output
Returns
Returned value

◆ logLikelihoodVecchia()

double gstlrn::logLikelihoodVecchia ( const Db db,
ModelGeneric model,
Id  nb_neigh,
bool  verbose 
)

Compute the log-likelihood (based on Vecchia approximation for covMat)

Parameters
dbDb structure where variable are loaded from
modelModelGeneric structure used for the calculation
nb_neighNumber of neighbors to consider in the Vecchia approximation
verboseVerbose flag
Remarks
The calculation considers all the active samples.
It can work in multivariate case with or without drift conditions (linked or not)
The algorithm is stopped (with a message) in the heterotopic case

◆ manageExternalInformation()

Id gstlrn::manageExternalInformation ( Id  mode,
const ELoc &  locatorType,
Db dbin,
Db dbout,
bool *  flag_created 
)

Derive the external information(s) from the Output db (if Grid) to the Input Db

Returns
Error return code
Parameters
[in]mode1 for allocation; -1 for deallocation
[in]locatorTypeType of the pointer (ELoc)
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[out]flag_createdTrue if variables have been created
Remarks
This function only functions when the Output Db is a grid
However, in case of a Point output Db, this function should not
be used: the external drift functions should already be present
in the output Db.
If this is not the case, an error is issued.

◆ manhattan_distance()

double gstlrn::manhattan_distance ( const double *  x1,
const double *  x2,
Id  n_features 
)

Returns the Manhattan distance between two points

Parameters
x1Vector of coordinates for the first point
x2Vector of coordinates for the second point
n_featuresNumber of coordinates
Returns

◆ matchKeyword()

bool gstlrn::matchKeyword ( const String string1,
const String string2,
bool  caseSensitive 
)

Check if two keywords are similar, up to their case

Parameters
string1First keyword
string2Second keyword
caseSensitivetrue if the case of both strings should be considered Otherwise, both strings are converted into upper case before comparison
Returns
true if both keywords are identical; false otherwise

◆ matchRegexp()

bool gstlrn::matchRegexp ( const String string1,
const String string2,
bool  caseSensitive 
)

Check if two keywords match up to "Regular Expression" on the second string and their case

Parameters
string1First keyword
string2Second keyword (through Regular Expression interpretation)
caseSensitivetrue if the case of both strings should be considered Otherwise, both strings are converted into upper case before comparison
Returns
true if both keywords are identical; false otherwise

◆ matrix_cholesky_decompose()

Id gstlrn::matrix_cholesky_decompose ( const double *  a,
double *  tl,
Id  neq 
)

Performs the Cholesky triangular decomposition of a definite positive symmetric matrix A = t(TL) * TL

Returns
Return code: >0 rank of zero pivot or 0 if no error
Parameters
[in]asymmetric matrix
[in]neqnumber of equations in the system
[out]tlLower triangular matrix defined by column
Remarks
the matrix a[] is destroyed during the calculations

◆ matrix_combine()

void gstlrn::matrix_combine ( Id  nval,
double  coeffa,
const double *  a,
double  coeffb,
const double *  b,
double *  c 
)

Perform a linear combination of matrices or vectors [C] = 'coeffa' * [A] + 'coeffb' * [B]

Parameters
[in]nvalNumber of elements of the matrices or vectors
[in]coeffaCoefficient applied to the first matrix or vector
[in]aFirst matrix or vector (not used if NULL)
[in]coeffbCoefficient applied to the second matrix or vector
[in]bSecond matrix or vector (not used if NULL)
[out]cResulting matrix or vector
Remarks
No test is performed to check that the three matrices or vectors
have the same dimensions
Matrix c[] can coincide with matrices a[] or b[]

◆ matrix_determinant()

double gstlrn::matrix_determinant ( Id  neq,
const 1 &  b 
)

Calculate the determinant of the square matrix (full storage)

Returns
Value of the determinant
Parameters
[in]neqSize of the matrix
[in]bSquare matrix to be checked

◆ matrix_invert()

Id gstlrn::matrix_invert ( double *  a,
Id  neq,
Id  rank 
)

Invert a symmetric square matrix Pivots are assumed to be located on the diagonal

Returns
Return code: 0 no error; k if the k-th pivot is zero
Parameters
[in,out]ainput matrix, destroyed in computation and replaced by resultant inverse
[in]neqnumber of equations in the matrix 'a'
[in]rankType of message when inversion problem is encountered >=0: message involves 'rank+1' -1: neutral message -2: no message
Remarks
It is unnecessary to edit a message if inversion problem occurs

◆ matrix_prod_norme()

Id gstlrn::matrix_prod_norme ( Id  transpose,
Id  n1,
Id  n2,
const double *  v1,
const double *  a,
double *  w 
)

Performs the product t(G) %*% A %*% G or G %*% A %*% t(G)

Returns
Error return code
Parameters
[in]transposetransposition mode -1 : transpose the first term +1 : transpose the last term
[in]n1matrix dimension
[in]n2matrix dimension
[in]v1rectangular matrix (n1,n2)
[in]asquare matrix (optional)
[out]wsquare matrix
Remarks
According to the value of 'transpose':
-1: the output array has dimension (n2,n2)
+1: the output array has dimension (n1,n1)
According to the value of 'transpose':
-1: the optional array A has dimension (n1,n1)
+1: the optional array A has dimension (n2,n2)

◆ matrix_product_safe()

void gstlrn::matrix_product_safe ( Id  n1,
Id  n2,
Id  n3,
const double *  v1,
const double *  v2,
double *  v3 
)

Performs the product of two matrices

Parameters
[in]n1matrix dimension
[in]n2matrix dimension
[in]n3matrix dimension
[in]v1rectangular matrix (n1,n2)
[in]v2rectangular matrix (n2,n3)
[out]v3rectangular matrix (n1,n3)
Remarks
The matrix v3[] may NOT coincide with one of the two initial ones

◆ matrix_transpose()

void gstlrn::matrix_transpose ( Id  n1,
Id  n2,
1 &  v1,
1 &  w1 
)

Transpose a (square or rectangular) matrix

Parameters
[in]n1matrix dimension
[in]n2matrix dimension
[in]v1rectangular matrix (n1,n2)
[out]w1rectangular matrix (n2,n1)
Remarks
The matrix w1[] may NOT coincide with v1[]

◆ MCCondExp()

gstlrn::MCCondExp ( krigest,
krigstd,
const 1 &  psi,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCCondExpElement()

double gstlrn::MCCondExpElement ( double  krigest,
double  krigstd,
const 1 &  psi,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCCondStd()

gstlrn::MCCondStd ( krigest,
krigstd,
const 1 &  psi,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCCondStdElement()

double gstlrn::MCCondStdElement ( double  krigest,
double  krigstd,
const 1 &  psi,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCIndicator()

gstlrn::MCIndicator ( double  yc,
krigest,
krigstd,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCIndicatorElement()

double gstlrn::MCIndicatorElement ( double  yc,
double  krigest,
double  krigstd,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCIndicatorStd()

gstlrn::MCIndicatorStd ( double  yc,
const 1 &  krigest,
const 1 &  krigstd,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCIndicatorStdElement()

double gstlrn::MCIndicatorStdElement ( double  yc,
double  krigest,
double  krigstd,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCMetal()

gstlrn::MCMetal ( double  yc,
krigest,
krigstd,
const 1 &  psi,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCMetalElement()

double gstlrn::MCMetalElement ( double  yc,
double  krigest,
double  krigstd,
const 1 &  psi,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCMetalStd()

gstlrn::MCMetalStd ( double  yc,
krigest,
krigstd,
const 1 &  psi,
Id  nbsimu = NBSIMU_DEF 
)

◆ MCMetalStdElement()

double gstlrn::MCMetalStdElement ( double  yc,
double  krigest,
double  krigstd,
const 1 &  psi,
Id  nbsimu = NBSIMU_DEF 
)

◆ mem_alloc_()

char * gstlrn::mem_alloc_ ( const char *  call_file,
size_t  call_line,
Id  size,
Id  flag_fatal 
)

◆ mem_calloc_()

char * gstlrn::mem_calloc_ ( const char *  call_file,
size_t  call_line,
Id  size_t,
Id  size,
Id  flag_fatal 
)

◆ mem_copy_()

char * gstlrn::mem_copy_ ( const char *  call_file,
size_t  call_line,
char *  tabin,
Id  size,
Id  flag_fatal 
)

◆ mem_error()

void gstlrn::mem_error ( Id  nbyte)

Problem in memory allocation

Parameters
[in]nbytenumber of bytes to be allocated

◆ mem_free_()

char * gstlrn::mem_free_ ( const char *  call_file,
size_t  call_line,
char *  tab 
)

◆ mem_realloc_()

char * gstlrn::mem_realloc_ ( const char *  call_file,
size_t  call_line,
char *  tab,
Id  size,
Id  flag_fatal 
)

◆ mem_tab_alloc()

double ** gstlrn::mem_tab_alloc ( Id  nvar,
Id  size,
Id  flag_fatal 
)

◆ mem_tab_free()

double ** gstlrn::mem_tab_free ( double **  tab,
Id  nvar 
)

◆ mes_process()

void gstlrn::mes_process ( const char *  string,
Id  ntot,
Id  iech 
)

Conditionally print the progress of a procedure

Parameters
stringString to be printed
ntotTotal number of samples
iechRank of the current sample
Remarks
The value 'nproc' designates the quantile such that,
when changed, the printout is provoked.

◆ mesArg()

void gstlrn::mesArg ( const char *  title,
Id  current,
Id  nmax 
)

Print a standard Error Message if an argument does not lie in Interval

Parameters
titleTitle to be printed
currentCurrent value of the argument
nmaxMaximum (inclusive) possible value

◆ mesh_stats()

void gstlrn::mesh_stats ( Id  ndim,
Id  ncorner,
Id  nmesh,
const I32 meshes,
const double *  points 
)

Calculate the statistics on a set of meshes

Parameters
[in]ndimSpace dimension
[in]ncornerNumber of corners for each mesh
[in]nmeshNumber of meshes
[in]meshesArray of vertex indices for each mesh
[in]pointsArray of 'ndim' coordinates for mesh vertex

◆ meshes_2D_sph_create()

Id gstlrn::meshes_2D_sph_create ( Id  verbose,
SphTriangle t 
)

Perform the spherical triangulation

Returns
Error return code
Parameters
[in]verboseVerbose option
[in]tSphTriangle structure

◆ meshes_2D_sph_free()

void gstlrn::meshes_2D_sph_free ( SphTriangle t,
Id  mode 
)

Free the structure for triangles on a sphere

Parameters
[in]tPointer to the SphTriangle structure to be freed
[in]mode1 for partial deallocation 0 for total deallocation

◆ meshes_2D_sph_from_auxiliary()

Id gstlrn::meshes_2D_sph_from_auxiliary ( const String triswitch,
SphTriangle t 
)

Add auxiliary random points

Parameters
[in]triswitchTriangulation option
[in]tSphTriangle structure
Remarks
This function adds the vertices to an existing SphTriangle structure

◆ meshes_2D_sph_from_db()

Id gstlrn::meshes_2D_sph_from_db ( Db db,
SphTriangle t 
)

Define the memory areas by reading information from Db

Parameters
[in]dbDb structure where data are located
[in]tPointer to the SphTriangle structure to be loaded
Remarks
This function adds vertices to an existing SphTriangle structure
A conversion is launched to convert the 2-D information
(longitude,latitude) into 3-D coordinates

◆ meshes_2D_sph_from_points()

Id gstlrn::meshes_2D_sph_from_points ( Id  nech,
double *  x,
double *  y,
SphTriangle t 
)

Add fixed points to modify the SphTriangle structure

Parameters
[in]nechNumber of added samples
[in]x,yArray containing the coordinates of added points
[in]tPointer to the SphTriangle structure to be loaded
Remarks
This function adds the vertices to an existing
SphTriangle structure

◆ meshes_2D_sph_init()

void gstlrn::meshes_2D_sph_init ( SphTriangle t)

Initialize the structure for triangles on a sphere

Parameters
[in]tPointer to the SphTriangle structure to be initialized

◆ meshes_2D_sph_print()

void gstlrn::meshes_2D_sph_print ( SphTriangle t,
Id  brief 
)

Print the contents of the SphTriangle structure

Parameters
[in]tPointer to the SphTriangle structure to be printed
[in]brief1 for a brief output; 0 otherwise

◆ meshes_2D_write()

Id gstlrn::meshes_2D_write ( const char *  file_name,
const char *  obj_name,
Id  verbose,
Id  ndim,
Id  ncode,
Id  ntri,
Id  npoints,
const 1 &  ntcode,
const 1 &  triangles,
const 1 &  points 
)

Dump the contents of a triangulation in an ASCII file according to the STL format

Parameters
[in]file_nameNmae of the created ASCII file
[in]obj_nameName assigned to the object
[in]verboseVerbose flag
[in]ndimSpace dimension
[in]ncodeNumber of different codes
[in]ntriNumber of triangles (expected)
[in]npointsNumber of poins (expected)
[in]ntcodeArray of number of triangles per code
[in]trianglesArray of vertex indices for each triangle
[in]pointsArray of 3-D coordinates for triangle vertices

◆ meshes_turbo_1D_grid_build()

AMesh * gstlrn::meshes_turbo_1D_grid_build ( DbGrid dbgrid)

Build the regular meshing from a 1-D grid

Returns
The newly created AMesh structure
Parameters
[in]dbgridDb structure

◆ meshes_turbo_2D_grid_build()

AMesh * gstlrn::meshes_turbo_2D_grid_build ( DbGrid dbgrid)

Build the regular 2-D grid meshing

Returns
Pointer to the newly created AMesh structure
Parameters
[in]dbgridDb structure

◆ meshes_turbo_3D_grid_build()

AMesh * gstlrn::meshes_turbo_3D_grid_build ( DbGrid dbgrid)

Build the regular 3-D grid meshing

Returns
Pointer to the newly created AMesh structure
Parameters
[in]dbgridDb structure

◆ message()

void gstlrn::message ( const char *  format,
  ... 
)

Print a formatted message

Parameters
formatOutput format
...Additional arguments

◆ message_extern()

void gstlrn::message_extern ( const char *  string)

Print a message This call comes from AStringable where initial message() has been moved

Parameters
[in]stringString to be displayed

◆ messageAbort()

void gstlrn::messageAbort ( const char *  format,
  ... 
)

Function for aborting the API

Parameters
formatFatal error format
...Additional arguments

◆ messageFlush()

void gstlrn::messageFlush ( const String string)

When message has been collected as a String, this function produces it out without passing through useless internal buffering

Parameters
stringString to be printed out

◆ messageNoDiff()

void gstlrn::messageNoDiff ( const char *  format,
  ... 
)

Print a formatted message (with "#NO_DIFF#" prefix)

Parameters
formatOutput format
...Additional arguments

◆ messerr()

void gstlrn::messerr ( const char *  format,
  ... 
)

Print Error message

Parameters
formatOutput format
...Additional arguments

◆ messerrFlush()

void gstlrn::messerrFlush ( const String string)

When the error message has been collected as a String, this function produces it out without passing through useless internal buffering

Parameters
stringString to be produced
Remarks
This function is similar to messageFlush but dedicated to Errors

◆ mestitle()

void gstlrn::mestitle ( Id  level,
const char *  format,
  ... 
)

Print a message and underlines it with various formats

Parameters
levelLevel of the title
formatOutput format
...Additional arguments

◆ migrate()

Id gstlrn::migrate ( Db dbin,
Db dbout,
const String name,
Id  dist_type,
const 1 &  dmax,
bool  flag_fill,
bool  flag_inter,
bool  flag_ball,
const NamingConvention namconv 
)

Migrates a variable from one Db to another one

Returns
Error return code
Parameters
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[in]nameName of the attribute to be migrated
[in]dist_typeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]flag_fillFilling option
[in]flag_interInterpolation
[in]flag_ballUse BallTree sorting algorithm when available
[in]namconvNaming convention

◆ migrateByAttribute()

Id gstlrn::migrateByAttribute ( Db dbin,
Db dbout,
const 1 &  atts,
Id  dist_type,
const 1 &  dmax,
bool  flag_fill,
bool  flag_inter,
bool  flag_ball,
const NamingConvention namconv 
)

Migrates a variable from one Db to another one

Returns
Error return code
Parameters
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[in]attsArray of attributes to be migrated
[in]dist_typeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]flag_fillFilling option
[in]flag_interInterpolation
[in]flag_ballUse BallTree sorting algorithm when available
[in]namconvNaming Convention

◆ migrateByLocator()

Id gstlrn::migrateByLocator ( Db dbin,
Db dbout,
const ELoc &  locatorType,
Id  dist_type,
const 1 &  dmax,
bool  flag_fill,
bool  flag_inter,
bool  flag_ball,
const NamingConvention namconv 
)

Migrates all z-locator variables from one Db to another one

Returns
Error return code
Parameters
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[in]locatorTypeLocator Type
[in]dist_typeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]flag_fillFilling option
[in]flag_interInterpolation
[in]flag_ballUse BallTree sorting algorithm when available
[in]namconvNaming convention
Remarks
The output variable receive the same locator as the input variables

◆ migrateGridToCoor()

Id gstlrn::migrateGridToCoor ( const DbGrid db_grid,
Id  iatt,
const 1 &  coords,
1 &  tab 
)

Migrates a variable from the grid structure into a variable at points defined by coordinate vectors

Returns
Error return code
Parameters
[in]db_griddescriptor of the grid parameters
[in]iattrank of the grid attribute
[in]coordsArray of coordinates (dimension: ndim, np)
[out]tabOutput array (Dimension: number of discretized points)

◆ migrateMulti()

Id gstlrn::migrateMulti ( Db dbin,
Db dbout,
const VectorString names,
Id  dist_type,
const 1 &  dmax,
bool  flag_fill,
bool  flag_inter,
bool  flag_ball,
const NamingConvention namconv 
)

Migrates a set of variables from one Db to another one

Returns
Error return code
Parameters
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[in]namesName of the attribute to be migrated
[in]dist_typeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]flag_fillFilling option
[in]flag_interInterpolation
[in]flag_ballUse BallTree sorting algorithm when available
[in]namconvNaming convention

◆ model_auto_fit()

Id gstlrn::model_auto_fit ( Vario vario,
Model model,
bool  verbose = false,
const Option_AutoFit mauto_arg = Option_AutoFit(),
const Constraints cons_arg = Constraints(),
const Option_VarioFit optvar_arg = Option_VarioFit() 
)

◆ model_combine()

Model * gstlrn::model_combine ( const Model model1,
const Model model2,
double  r 
)

Combine two monovariate models into a bivariate model (residuals model)

Returns
Pointer to the newly created Model structure
Parameters
[in]model1First input Model
[in]model2Second input Model
[in]rCorrelation coefficient
Remarks
: The drift is not copied into the new model
: It has been extended to the case where only one model is defined

◆ model_cova_characteristics()

void gstlrn::model_cova_characteristics ( const ECov &  type,
char  cov_name[STRING_LENGTH],
Id flag_range,
Id flag_param,
Id min_order,
Id max_ndim,
Id flag_int_1d,
Id flag_int_2d,
Id flag_aniso,
Id flag_rotation,
double *  scale,
double *  parmax 
)

Returns the characteristics of the covariance

Parameters
[in]typeType of the covariance
[out]cov_nameName of the covariance
[out]flag_rangerange definition
  • +1 if the range is defined
  • -1 if the range is redundant with the sill
[out]flag_param1 if the third parameter is defined
[out]min_orderMinimum IRF order for validity
[out]max_ndimMaximum dimension for validity
[out]flag_int_1dIntegral range in 1-D
[out]flag_int_2dIntegral range in 2-D
[out]flag_aniso1 if anisotropy is meaningful
[out]flag_rotation1 if an anisotropy rotation is meaningful
[out]scaleScaling parameter
[out]parmaxMaximum value for the third parameter

◆ model_covmat_inchol()

Id gstlrn::model_covmat_inchol ( Id  verbose,
Db db,
Model model,
double  eta,
Id  npivot_max,
Id  nsize1,
const Id ranks1,
const double *  center,
Id  flag_sort,
Id npivot_arg,
1 &  pvec,
1 &  Gmatrix,
const CovCalcMode mode 
)

Establish and invert a covariance matrix using Incomplete Cholesky method

Parameters
[in]verboseVerbose option
[in]dbDb structure
[in]modelModel structure
[in]npivot_maxMaximum number of pivots (or 0)
[in]etaPrecision (or TEST)
[in]nsize1Number of pivots already selected
[in]ranks1Ranks of pivots already selected
[in]centerOptional Centering point (for increments)
[in]flag_sortReordering flag (see remarks)
[in]modeCovCalcMode structure
[out]npivot_argNumber of pivots
[out]pvecArray of indices of the retained samples (from 1) Dimension: nech
[out]GmatrixRectangular matrix Dimension: nech * npivot_arg
Remarks
The output arrays Pret and Gret should be freed by calling function
The array G contains as many lines as there are samples
If flag_sort = FALSE, the first lines concentrate on pivots,
and the other points are located afterwards
If flag_sort = TRUE, the lines are sorted in the same order as the
initial set of samples
The incomplete Cholsky algorithm stops when either the next pivot
value is below 'eta' or when maximum number of pivots 'npivot_max'
has been reached
If the center point is provided in 'center', the calculations
of covariance of increments are calculated instead. Then 'center'
must provide the coordinates of the origin point.

◆ model_duplicate_for_gradient()

Model * gstlrn::model_duplicate_for_gradient ( const Model model,
double  ball_radius 
)

Duplicates a Model from another Model for Gradients

Returns
The modified Model structure
Parameters
[in]modelInput Model
[in]ball_radiusRadius for Gradient calculation

◆ model_pgs()

Vario * gstlrn::model_pgs ( Db db,
const VarioParam varioparam,
const RuleProp ruleprop,
const Model model1,
const Model model2 
)

Evaluate the experimental variogram of indicators in PluriGaussian case

Returns
Error return code
Parameters
[in]dbDb descriptor
[in]varioparamVarioParam structure
[in]rulepropRuleProp structure
[in]model1First Model structure
[in]model2Second Model structure (optional)

◆ model_rule_combine()

Model * gstlrn::model_rule_combine ( const Model model1,
const Model model2,
const Rule rule 
)

Combine two basic models into a bivariate model (residuals model)

Returns
The newly Model structure
Parameters
[in]model1First input Model
[in]model2Second input Model
[in]ruleRule
Remarks
: The drift is not copied into the new model

◆ modify_constraints_on_sill()

Id gstlrn::modify_constraints_on_sill ( Constraints constraints)

If a constraint concerns a sill, take its square root as it corresponds to a constraints on AIC (not on a sill directly) due to the fact that it will be processed in FOXLEG (not in GOULARD) This transform only makes sense for MONOVARIATE case (the test should have been performed beforehand)

Returns
Error code (if the sill constraint is negative)
Parameters
[in]constraintsConstraints structure

◆ modifyOperator()

double gstlrn::modifyOperator ( const EOperator &  oper,
double  oldval,
double  value 
)

Update an Old by a New value according to 'oper'

Parameters
operA keywork of EOperator enum
oldvalOld value
valueNew value

◆ movingAverage()

Id gstlrn::movingAverage ( Db dbin,
Db dbout,
ANeigh neigh,
bool  flag_est,
bool  flag_std,
Model model,
const NamingConvention namconv 
)

Moving Average estimation

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]neighANeigh structure
[in]flag_estTrue if the estimation must be calculated
[in]flag_stdTrue if the St. Dev. must be calculated
[in]modelModel structure (used for St. Dev.)
[in]namconvNaming convention

◆ movingMedian()

Id gstlrn::movingMedian ( Db dbin,
Db dbout,
ANeigh neigh,
bool  flag_est,
bool  flag_std,
Model model,
const NamingConvention namconv 
)

Moving Median estimation

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]neighANeigh structure
[in]flag_estTrue if the estimation must be calculated
[in]flag_stdTrue if the St. Dev. must be calculated
[in]modelModel structure (used for St. Dev.)
[in]namconvNaming convention

◆ MSS()

Id gstlrn::MSS ( Id  ndim,
Id  ipol,
Id  icas,
Id  icorn,
Id  idim 
)

Returns the shift value for the apex('icorn')

Returns
Shift value
Parameters
[in]ndimSpace dimension (1, 2 or 3)
[in]ipolRank of the polarization (starting from 0)
[in]icasRank of the case (starting from 0)
[in]icornRank of the corner (starting from 0)
[in]idimRank of the coordinate (starting from 0)
Remarks
This function returns the shift value to be applied to each
coordinate index, for each apex for each mesh which constitutes
the partition of a cell into meshes (using Turbo facility)
When 'ndim' is provided as negative, a special case is programmed

◆ multilayers_get_prior()

Id gstlrn::multilayers_get_prior ( Db dbin,
DbGrid dbout,
Model model,
Id  flag_same,
Id  flag_vel,
Id  flag_ext,
Id  irf_rank,
Id  match_time,
Id  colrefd,
Id  colreft,
Id  colrefb,
Id  verbose,
Id npar_arg,
1 &  mean,
1 &  vars 
)

Multi-layers get the mean and prior matrices for Bayesian prior

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModel structure
[in]flag_same1 if input and output files coincide
[in]flag_vel1 if work is performed in Velocity, 0 for Depth
[in]flag_ext1 if external drift must be used; 0 otherwise
[in]irf_rankRank of the Intrinsic Random Function (0 or 1)
[in]match_time1 if external drift matches time; 0 otherwise
[in]colrefdRank of the reference Depth variable in Dbout
[in]colreftRank of the reference Time variable in Dbout
[in]colrefbRank of the Bottom Depth variable in Dbout (or -1)
[in]verboseVerbose option
[out]npar_argNumber of drift terms
[out]meanArray of means
[out]varsArray of variances

◆ multilayers_kriging()

Id gstlrn::multilayers_kriging ( Db dbin,
DbGrid dbout,
Model model,
ANeigh neigh,
Id  flag_same,
Id  flag_z,
Id  flag_vel,
Id  flag_cumul,
Id  flag_ext,
Id  flag_std,
Id  flag_bayes,
Id  irf_rank,
Id  match_time,
Id  dim_prior,
double *  prior_mean,
double *  prior_vars,
Id  colrefd,
Id  colreft,
Id  colrefb,
Id  verbose 
)

Multi-layers architecture estimation

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModel structure
[in]neighANeigh structure
[in]flag_same1 if input and output files coincide
[in]flag_z1 if the output must be converted back into depth
[in]flag_vel1 if work is performed in Velocity, 0 for Depth
[in]flag_cumul1 if work is performed in Depth; 0 in Thickness
[in]flag_ext1 if external drift must be used; 0 otherwise
[in]flag_std1 if the estimation error must be calculated
[in]flag_bayes1 if the Bayesian hypothesis is used on drift coeffs
[in]irf_rankRank of the Intrinsic Random Function (0 or 1)
[in]match_time1 if external drift matches time; 0 otherwise
[in]dim_priorDimension of the prior information (for verification)
[in]prior_meanVector of prior means for drift coefficients
[in]prior_varsVector of prior variances for drift coefficients
[in]colrefdRank of the reference Depth variable in Dbout
[in]colreftRank of the reference Time variable in Dbout
[in]colrefbRank of the Bottom Depth variable in Dbout (or -1)
[in]verboseVerbose option

◆ multilayers_vario()

Id gstlrn::multilayers_vario ( Db dbin,
DbGrid dbout,
Vario vario,
Id  nlayers,
Id  flag_vel,
Id  flag_ext,
Id  irf_rank,
Id  match_time,
Id  colrefd,
Id  colreft,
Id  verbose 
)

Multi-layers architecture experimental variogram

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]varioVario structure
[in]nlayersNumber of layers
[in]flag_vel1 if work is performed in Velocity, 0 for Depth
[in]flag_ext1 if external drift must be used; 0 otherwise
[in]irf_rankRank of the Intrinsic Random Function (0 or 1)
[in]match_time1 if external drift matches time; 0 otherwise
[in]colrefdRank of the reference Depth variable in Dbout
[in]colreftRank of the reference Time variable in Dbout
[in]verbose1 for a verbose option

◆ mvndst()

void gstlrn::mvndst ( Id  n,
double *  lower,
double *  upper,
Id infin,
double *  correl,
Id  maxpts,
double  abseps,
double  releps,
double *  error,
double *  value,
Id inform 
)

Multivariate Normal Probability

Parameters
[in]nNumber of variables
[in]lowerArray of lower integration limits
[in]upperArray of upper integration limits
[in]infinArray of integration limit flags
  • <0 for ]-Infinity; +Infinity[
  • =0 for ]-Infinity; upper]
  • =1 for [lower; +Infinity[
  • =2 for [lower; upper]
[in]correlArray of correlation coefficients
[in]maxptsMaximum number of function values allowed
[in]absepsAbsolute error tolerance
[in]relepsRelative error tolerance
[out]errorEstimated absolute error with 90% confidence level
[out]valueEstimated value for the integral
[out]informReturned code
Remarks
The array correl must be entered as the non-diagonal upper part
of the correlation matrix, entered by line
This subroutine uses an algorithm given in the paper:
"Numerical Computation of Multivariate Normal Probabilities", in
J. of Computational and Graphical Stat., 1(1992), pp. 141-149, by
Alan Genz
Department of Mathematics
Washington State University
Pullman, WA 99164-3113
Email : AlanG.nosp@m.enz@.nosp@m.wsu.e.nosp@m.du

◆ mvndst2n()

void gstlrn::mvndst2n ( const double *  lower,
const double *  upper,
const double *  means,
double *  correl,
Id  maxpts,
double  abseps,
double  releps,
double *  error,
double *  value,
Id inform 
)

Calculate the multigaussian integral (non-normalized)

Parameters
[in]lowerArray of lower bounds (Dimension: nvar)
[in]upperArray of upper bounds (Dimension: nvar)
[in]meansArray of means (Dimension: 2)
[in]correlCorrelation matrix (Dimension: 2*2)
[in]maxptsMaximum number of function values allowed
[in]absepsAbsolute error tolerance
[in]relepsRelative error tolerance
[out]errorEstimated absolute error with 90% confidence level
[out]valueEstimated value for the integral
[out]informReturned code

◆ mvndst4()

void gstlrn::mvndst4 ( double *  lower,
double *  upper,
const double *  correl,
Id  maxpts,
double  abseps,
double  releps,
double *  error,
double *  value,
Id inform 
)

Calculate the quadri-variable gaussian integral

Parameters
[in]lowerArray of lower bounds
[in]upperArray of upper bounds
[in]correlCorrelation matrix (Dimension: 4*4)
[in]maxptsMaximum number of function values allowed
[in]absepsAbsolute error tolerance
[in]relepsRelative error tolerance
[out]errorEstimated absolute error with 90% confidence level
[out]valueEstimated value for the integral
[out]informReturned code

◆ mvndst_infin()

Id gstlrn::mvndst_infin ( double  low,
double  sup 
)

Set the flags for the bound of numerical integration

Returns
Flag for the bound
Parameters
[in]lowLower integration bound
[in]supUpper integration bound

◆ nearestNeighbor()

Id gstlrn::nearestNeighbor ( Db dbin,
Db dbout,
bool  flag_est,
bool  flag_std,
Model model,
const NamingConvention namconv 
)

Nearest Neighbor estimation

Returns
Error return code
Parameters
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]flag_estTrue if the estimation must be calculated
[in]flag_stdTrue if the St. Dev. must be calculated
[in]modelModel structure (used for St. Dev.)
[in]namconvNaming convention

◆ new_section()

static void gstlrn::new_section ( void  )
static

◆ normalizeResults() [1/2]

void gstlrn::normalizeResults ( Id  nbsimu,
double &  valest 
)

◆ normalizeResults() [2/2]

void gstlrn::normalizeResults ( Id  nbsimu,
double &  valest,
double &  valstd 
)

◆ num_points_for_cell()

static Id gstlrn::num_points_for_cell ( Id  celltype)
static

◆ open_file()

static void gstlrn::open_file ( const char *  filename)
static

◆ operate_Identify()

operate_function gstlrn::operate_Identify ( Id  oper)

Identify the pointer to a function with following functionality: y = f(x)

Parameters
operGives the type of operation to be performed 1: returns the value itslef (no change) -1: returns its inverse 2: returns the squared value -2: returns the inverse of the squared value 3: returns its square root -3: returns the inverse of the square root
Returns
Pointer to the specified function

◆ operate_Identity()

double gstlrn::operate_Identity ( double  x)

◆ operate_Inverse()

double gstlrn::operate_Inverse ( double  x)

◆ operate_InverseSqrt()

double gstlrn::operate_InverseSqrt ( double  x)

◆ operate_InverseSquare()

double gstlrn::operate_InverseSquare ( double  x)

◆ operate_Sqrt()

double gstlrn::operate_Sqrt ( double  x)

◆ operate_Square()

double gstlrn::operate_Square ( double  x)

◆ operator<<() [1/2]

template<typename T >
std::ostream & gstlrn::operator<< ( std::ostream &  os,
const VectorT< T > &  vec 
)

◆ operator<<() [2/2]

template<typename T >
std::ostream & gstlrn::operator<< ( std::ostream &  os,
const VectorT< VectorNumT< T > > &  vec 
)

◆ partial_inverse()

template<typename SpChol , typename SpMat >
SpChol::MatrixType gstlrn::partial_inverse ( const SpChol &  llt,
const SpMat &  pattern 
)

◆ partition_node_indices()

Id gstlrn::partition_node_indices ( const MatrixT< double > &  data,
Id node_indices,
Id  split_dim,
Id  n_points,
Id  split_index 
)

◆ point_diff()

static Id gstlrn::point_diff ( Id  x,
Id  y,
Id  z,
double  t0,
double  hs0 
)
static

◆ point_inside_grid()

Id gstlrn::point_inside_grid ( Db db,
Id  iech,
const DbGrid dbgrid 
)

Check if a sample of a Db lies within a Grid Db

Returns
1 if the point lies within the grid; 0 otherwise
Parameters
[in]dbDb structure
[in]iechRank of the target sample
[in]dbgridGrid Db structure

◆ point_to_bench()

Id gstlrn::point_to_bench ( const DbGrid db,
double *  coor,
Id  flag_outside,
Id indb 
)

Converts from point coordinates to index of the bench to which it belongs

Returns
Error return code
0 if the point is inside the grid
1 if the point is outside the grid
-1 if one coordinate is undefined
-2 if the grid is defined in space less than 3D
Parameters
[in]dbdescriptor of the grid parameters
[in]coorarray of coordinates of the point
[in]flag_outsidevalue returned for the point outside the grid
  • 1 the index is set to the closest grid node
  • 0 the index is set to -1
  • -1 do not correct the index
[out]indbindex of the bench
Remarks
The bench corresponds to the third dimension of the grid provided
as reference

◆ point_to_grid()

Id gstlrn::point_to_grid ( const DbGrid db,
const double *  coor,
Id  flag_outside,
Id indg 
)

Converts from point coordinates to nearest grid node indices

Returns
Error return code
0 if the point is inside the grid
1 if the point is outside the grid
-1 if one coordinate is undefined
Parameters
[in]dbdescriptor of the grid parameters
[in]coorarray of coordinates of the point
[in]flag_outsidevalue returned for the point outside the grid
  • 1 the index is set to the closest grid node
  • 0 the index is set to -1
  • -1 do not correct the index
[out]indgindices of the closest grid node

◆ point_to_point()

Id gstlrn::point_to_point ( Db db,
const double *  coor 
)

Returns the rank of the closest isolated point

Returns
Output index
Parameters
[in]dbdescriptor of the Db
[in]coorarray of coordinates of the point

◆ pointToBlock()

Id gstlrn::pointToBlock ( Db dbpoint,
DbGrid dbgrid,
Id  option,
Id  flag_size,
Id  iatt_time,
Id  iatt_size,
Id  iatt_angle,
Id  iatt_scaleu,
Id  iatt_scalev,
Id  iatt_scalew 
)

Plunge a set of isolated points within a discretization grid in order to compute the voronoi of the points and derive:

  • the statistics on the volume and perimeter of the cells
  • the edge between cells
Returns
Error return code
Parameters
[in]dbpointDescriptor of the point parameters
[in]dbgridDescriptor of the grid parameters
[in]optionConnectivity option (0 for cross and 1 for block)
[in]flag_sizeWhen 1, the border pixels report the border thickness When 0, the border pixels are painted in 1
[in]iatt_timeAttribute of 'dbpoint'for Time shift (optional)
[in]iatt_sizeAttribute of 'dbpoint' giving size (optional)
[in]iatt_angleOptional variable for anisotropy angle (around Z)
[in]iatt_scaleuOptional variable for anisotropy scale factor (U)
[in]iatt_scalevOptional variable for anisotropy scale factor (V)
[in]iatt_scalewOptional variable for anisotropy scale factor (W)
Remarks
The value of 'flag_index' can be turned on for assigning
the sample index to the grid cell (instead of the 'iatt' value)
using: set_keypair("PTB_flag_index")

◆ potential_cov()

Id gstlrn::potential_cov ( Model model,
bool  verbose,
Id  type1,
const 1 &  x10,
const 1 &  x1p,
const 1 &  tx1,
Id  type2,
const 1 &  x20,
const 1 &  x2p,
const 1 &  tx2,
1 &  covtab 
)

◆ potential_kriging()

Id gstlrn::potential_kriging ( Db db,
Db dbgrd,
Db dbtgt,
DbGrid dbout,
Model model,
ANeigh neigh,
double  nugget_grd = 0.,
double  nugget_tgt = 0.,
bool  flag_pot = true,
bool  flag_grad = false,
bool  flag_trans = false,
bool  flag_save_data = false,
Id  opt_part = 0,
bool  verbose = false 
)

◆ potential_simulate()

Id gstlrn::potential_simulate ( Db dbiso,
Db dbgrd,
Db dbtgt,
DbGrid dbout,
Model model,
ANeigh neigh,
double  nugget_grd = 0.,
double  nugget_tgt = 0.,
double  dist_tempere = TEST,
bool  flag_trans = false,
Id  seed = 135674,
Id  nbsimu = 1,
Id  nbtuba = 100,
bool  verbose = false 
)

◆ potential_xvalid()

Id gstlrn::potential_xvalid ( Db dbiso,
Db dbgrd,
Db dbtgt,
Model model,
ANeigh neigh,
double  nugget_grd = 0.,
double  nugget_tgt = 0.,
bool  flag_dist_conv = false,
bool  verbose = false 
)

◆ pre_init()

static Id gstlrn::pre_init ( void  )
static

◆ print_current_line()

void gstlrn::print_current_line ( void  )

Print the current line read from an ASCII file

◆ print_imatrix()

void gstlrn::print_imatrix ( const char *  title,
Id  flag_limit,
Id  bycol,
Id  nx,
Id  ny,
const double *  sel,
const Id tab 
)

Tabulated printout of a matrix (integer version)

Parameters
[in]titleTitle (Optional)
[in]flag_limitoption for the limits
  • 1 if limits must be applied
  • 0 if the whole matrix is printed
[in]bycol1 if values in 'tab' are sorted by column, 0 otherwise
[in]nxnumber of columns in the matrix
[in]nynumber of rows in the matrix
[in]selarray of selection or NULL
[in]tabarray containing the matrix

◆ print_ivector() [1/2]

void gstlrn::print_ivector ( const char *  title,
Id  flag_limit,
Id  ntab,
const 1 &  itab 
)

◆ print_ivector() [2/2]

void gstlrn::print_ivector ( const char *  title,
Id  flag_limit,
Id  ntab,
const Id itab 
)

Print a vector of integer values in a matrix form

Parameters
[in]titleTitle (Optional)
[in]flag_limit1 if NTCOL is used; 0 otherwise
[in]ntabNumber of elements in the array
[in]itabArray to be printed

◆ print_keypair()

void gstlrn::print_keypair ( Id  flag_short)

Print the list of keypairs

Parameters
[in]flag_short1 for a short output

◆ print_matrix() [1/2]

void gstlrn::print_matrix ( const char *  title,
Id  flag_limit,
const AMatrix mat 
)

◆ print_matrix() [2/2]

void gstlrn::print_matrix ( const char *  title,
Id  flag_limit,
Id  bycol,
Id  nx,
Id  ny,
const double *  sel,
const double *  tab 
)

Tabulated printout of a matrix

Parameters
[in]titleTitle (Optional)
[in]flag_limitoption for the limits
  • 1 if limits must be applied
  • 0 if the whole matrix is printed
[in]bycol1 if values in 'tab' are sorted by column, 0 otherwise
[in]nxnumber of columns in the matrix
[in]nynumber of rows in the matrix
[in]selarray of selection or NULL
[in]tabarray containing the matrix
Remarks
The order of the dimension (nx,ny) is opposite
of the one used in R-packages where dim[1]=nrow and dim[2]=ncol

◆ print_range()

void gstlrn::print_range ( const char *  title,
Id  ntab,
const double *  tab,
const double *  sel 
)

Print the range of values in an array

Parameters
[in]titleoptional title (NULL if not defined)
[in]ntabnumber of values
[in]tabarray of values
[in]sel(optional) selection

◆ print_trimat()

void gstlrn::print_trimat ( const char *  title,
Id  mode,
Id  neq,
const double *  tl 
)

Tabulated printout of a upper triangular matrix

Parameters
[in]titleTitle (Optional)
[in]mode1 if the matrix is stored linewise 2 if the matrix is stored columnwise
[in]neqsize of the matrix
[in]tlarray containing the upper triangular matrix
Remarks
The ordering (compatible with matrix_solve is mode==2)

◆ print_vector() [1/2]

void gstlrn::print_vector ( const char *  title,
Id  flag_limit,
Id  ntab,
const 1 &  tab 
)

◆ print_vector() [2/2]

void gstlrn::print_vector ( const char *  title,
Id  flag_limit,
Id  ntab,
const double *  tab 
)

Print a vector of real values in a matrix form

Parameters
[in]titleTitle (Optional)
[in]flag_limit1 if NTCOL is used; 0 otherwise
[in]ntabNumber of elements in the array
[in]tabArray to be printed

◆ printLocatorList()

void gstlrn::printLocatorList ( )

◆ prodNormDiagVec()

MatrixSparse * gstlrn::prodNormDiagVec ( const MatrixSparse a,
const 1 &  vec,
Id  oper_choice = 1 
)

Product 'Diag(vec)' %*% 'A' %*% 'Diag(vec)'

◆ prodNormMat() [1/2]

MatrixSquare * gstlrn::prodNormMat ( const MatrixDense a,
bool  transpose = false 
)

Product 't(A)' %*% 'A' or 'A' %*% 't(A)'

◆ prodNormMat() [2/2]

MatrixSparse * gstlrn::prodNormMat ( const MatrixSparse a,
bool  transpose = false 
)

Product 't(A)' %*% 'A' or 'A' %*% 't(A)' stored in 'this'

◆ prodNormMatMat() [1/2]

MatrixSquare * gstlrn::prodNormMatMat ( const MatrixDense a,
const MatrixDense m,
bool  transpose = false 
)

Product 't(A)' %*% 'M' %*% 'A' or 'A' %*% 'M' %*% 't(A)'

◆ prodNormMatMat() [2/2]

MatrixSparse * gstlrn::prodNormMatMat ( const MatrixSparse a,
const MatrixSparse m,
bool  transpose = false 
)

Product 't(A)' %*% 'M' %*% 'A' or 'A' %*% 'M' %*% 't(A)'

◆ prodNormMatVec() [1/2]

MatrixSquare * gstlrn::prodNormMatVec ( const MatrixDense a,
const 1 &  vec,
bool  transpose = false 
)

Product 't(A)' %*% 'vec' %*% 'A' or 'A' %*% 'vec' %*% 't(A)'

◆ prodNormMatVec() [2/2]

MatrixSparse * gstlrn::prodNormMatVec ( const MatrixSparse a,
const 1 &  vec,
bool  transpose = false 
)

Product 't(A)' %*% 'vec' %*% 'A' or 'A' %*% 'vec' %*% 't(A)' stored in 'this'

◆ propagate_point()

static Id gstlrn::propagate_point ( Id  start)
static

◆ propdef_reset()

void gstlrn::propdef_reset ( PropDef propdef)

Set memory proportion so as to provoke the update at first usage

Parameters
[in]propdefPointer to Propdef structure

◆ proportion_manage()

PropDef * gstlrn::proportion_manage ( Id  mode,
Id  flag_facies,
Id  flag_stat,
Id  ngrf1,
Id  ngrf2,
Id  nfac1,
Id  nfac2,
Db db,
const Db dbprop,
const 1 &  propcst,
PropDef proploc 
)

Allocate or deallocate a proportion array

Returns
Pointer on the returned PropDef structure
Parameters
[in]mode1 for allocation; -1 for deallocation
[in]flag_facies1 if Gibbs is used for facies
[in]flag_stat1 if the proportions are stationary
[in]ngrf1Number of GRFs for the first PGS
[in]ngrf2Number of GRFs for the second PGS
[in]nfac1Number of facies for the first PGS
[in]nfac2Number of facies for the second PGS
[in]dbDb structure containing the data
[in]dbpropDb structure containing the proportions (only used in the non-stationary case)
[in]propcstConstant set of proportions (used if flag_stat)
[in]proplocPropDef structure (used for mode<0)

◆ proportion_print()

void gstlrn::proportion_print ( PropDef propdef)

Print the (non-stationary) proportions

Parameters
[in]propdefPropDef structure

◆ proportion_rule_process()

void gstlrn::proportion_rule_process ( PropDef propdef,
const EProcessOper &  mode 
)

Set the method to compute Proportions

Parameters
[in]propdefPropDef structure
[in]modeType of operation (EProcessOper)

◆ range2scale()

double gstlrn::range2scale ( const ECov &  type,
double  range,
double  param = 1. 
)

◆ record_close()

void gstlrn::record_close ( void  )

◆ recursive_init()

static Id gstlrn::recursive_init ( void  )
static

◆ redefine_error()

void gstlrn::redefine_error ( void(*)(const char *)  warn_func)

Redefine the IO routine for printing error message

Parameters
[in]warn_funcWarning function

◆ redefine_exit()

void gstlrn::redefine_exit ( void(*)(void)  exit_func)

Redefine the exiting routine

Parameters
[in]exit_funcExiting function

◆ redefine_message()

void gstlrn::redefine_message ( void(*)(const char *)  write_func)

Redefine the IO routine for printing message

Parameters
[in]write_funcWriting function

◆ redefine_read()

void gstlrn::redefine_read ( void(*)(const char *, char *)  read_func)

Redefine the IO routine for Reading

Parameters
[in]read_funcReading function

◆ regression()

Regression gstlrn::regression ( Db db1,
const String nameResp,
const VectorString nameAux,
Id  mode,
bool  flagCst,
Db db2,
const Model model 
)

Evaluate the regression

Returns
Error return code
Parameters
[in,out]db1Db descriptor (for target variable)
[in]nameRespName of the target variable
[in]nameAuxVector of names of the explanatory variables
[in]modeType of calculation
  • 0 : standard multivariate case
  • 1 : using external drifts
  • 2 : using standard drift functions (in 'model')
[in]flagCstThe constant is added as explanatory variable
[in]db2Db descriptor (for auxiliary variables)
[in]modelModel (only used for Drift functions if mode==2)
Remarks
The flag_mode indicates the type of regression calculation:
0 : V[icol] as a function of V[icols[i]]
1 : Z1 as a function of the different Fi's

◆ regressionDeming()

gstlrn::regressionDeming ( const 1 &  x,
const 1 &  y,
double  delta 
)

Calculate the coefficients of the Deming regression (with 2 variables)

Parameters
xVector for the first variable
yVector for the second variable
deltaratio of error variances (s_y^2 / s_x^2)
Returns
Vector of coefficients for the equation
y = beta[0] + beta[1] * x
Remarks
Both input vectors are assumed to contain valid values
From: https://en.wikipedia.org/wiki/Deming_regression

◆ roundZero()

double gstlrn::roundZero ( double  value,
double  eps 
)

Round off the value if close enough to zero. This ensures that the printout of a very small value does not come out with a non-significant negative sign This trick should only serve to make printouts similar on different platforms.

Parameters
valueInput value
epsTolerance to check that the value is considered as small
Returns
The value itself or a very small positive value if the input value is too small.

◆ rule_free()

Rule * gstlrn::rule_free ( const Rule rule)

Free a Rule structure

Returns
Pointer to the newly freed Rule structure
Parameters
[in]ruleRule structure to be freed

◆ rule_thresh_define()

Id gstlrn::rule_thresh_define ( PropDef propdef,
Db db,
const Rule rule,
Id  facies,
Id  iech,
Id  isimu,
Id  nbsimu,
Id  flag_check,
double *  t1min,
double *  t1max,
double *  t2min,
double *  t2max 
)

Set the (non-stationary) proportions and define thresholds

Returns
Error return code
Parameters
[in]propdefPropDef structure
[in]dbDb input structure
[in]ruleRule structure
[in]faciesFacies of interest (or ITEST) starting from 1
[in]iechRank of the data in the input Db
[in]isimuRank of the simulation (EProcessOper::CONDITIONAL)
[in]nbsimuNumber of simulations
[in]flag_check1 if the consistency check with the actual proportion of the current facies must be done
[out]t1minMinimum threshold for Y1
[out]t1maxMaximum threshold for Y1
[out]t2minMinimum threshold for Y2
[out]t2maxMaximum threshold for Y2

◆ rule_thresh_define_shadow()

Id gstlrn::rule_thresh_define_shadow ( PropDef propdef,
Db db,
const RuleShadow rule,
Id  facies,
Id  iech,
Id  isimu,
Id  nbsimu,
double *  t1min,
double *  t1max,
double *  t2min,
double *  t2max,
double *  sh_dsup,
double *  sh_down 
)

Set the (non-stationary) proportions and define thresholds (for shadow only)

Returns
Error return code
Parameters
[in]propdefPropDef structure
[in]dbDb input structure
[in]ruleRule structure
[in]faciesFacies of interest (or GV_ITEST)
[in]iechRank of the data in the input Db
[in]isimuRank of the simulation (EProcessOper::CONDITIONAL)
[in]nbsimuNumber of simulations (EProcessOper::CONDITIONAL)
[out]t1minMinimum threshold for Y1
[out]t1maxMaximum threshold for Y1
[out]t2minMinimum threshold for Y2
[out]t2maxMaximum threshold for Y2
[out]sh_dsupLocal or global upwards shift (shadow)
[out]sh_downLocal or global downwards shift (shadow)

◆ sampleInteger()

Id gstlrn::sampleInteger ( Id  mini,
Id  maxi 
)

Returns an integer sampled uniformly wihtin the interval [mini, maxi]

Parameters
miniLower bound (included)
maxiUpper bound (included)

◆ sampling_f()

Id gstlrn::sampling_f ( Db db,
Model model,
double  beta,
Id  method1,
Id  nsize1_max,
1 &  ranks1,
Id  method2,
Id  nsize2_max,
1 &  ranks2,
Id  verbose 
)

Optimize the sampling design

Returns
Error retun code
Parameters
[in]dbDb structure
[in]modelModel structure
[in]betaThresholding value
[in]method1Criterion for choosing exact pivots 1 : Local evaluation 2 : Global evaluation
[in]nsize1_maxMaximum number of exact pivots
[in]ranks1Ranks of exact pivots
[in]method2Criterion for choosing ACP pivots 1 : Local evaluation 2 : Global evaluation
[in]nsize2_maxMaximum number of ACP pivots
[in]ranks2Ranks of ACP pivots
[in]verbose1 for a verbose output

◆ scale2range()

double gstlrn::scale2range ( const ECov &  type,
double  scale,
double  param = 1. 
)

◆ scan_x_bb()

static Id gstlrn::scan_x_bb ( Id  y_begin,
Id  y_start,
Id  z_begin,
Id  z_start,
Id  x0,
Id  x,
Id  x_s 
)
static

◆ scan_x_bf()

static Id gstlrn::scan_x_bf ( Id  y_begin,
Id  y_start,
Id  z_start,
Id  z_end,
Id  x0,
Id  x,
Id  x_s 
)
static

◆ scan_x_fb()

static Id gstlrn::scan_x_fb ( Id  y_start,
Id  y_end,
Id  z_begin,
Id  z_start,
Id  x0,
Id  x,
Id  x_s 
)
static

◆ scan_x_ff()

static Id gstlrn::scan_x_ff ( Id  y_start,
Id  y_end,
Id  z_start,
Id  z_end,
Id  x0,
Id  x,
Id  x_s 
)
static

◆ scan_y_bb()

static Id gstlrn::scan_y_bb ( Id  x_begin,
Id  x_start,
Id  z_begin,
Id  z_start,
Id  y0,
Id  y,
Id  y_s 
)
static

◆ scan_y_bf()

static Id gstlrn::scan_y_bf ( Id  x_begin,
Id  x_start,
Id  z_start,
Id  z_end,
Id  y0,
Id  y,
Id  y_s 
)
static

◆ scan_y_fb()

static Id gstlrn::scan_y_fb ( Id  x_start,
Id  x_end,
Id  z_begin,
Id  z_start,
Id  y0,
Id  y,
Id  y_s 
)
static

◆ scan_y_ff()

static Id gstlrn::scan_y_ff ( Id  x_start,
Id  x_end,
Id  z_start,
Id  z_end,
Id  y0,
Id  y,
Id  y_s 
)
static

◆ scan_z_bb()

static Id gstlrn::scan_z_bb ( Id  x_begin,
Id  x_start,
Id  y_begin,
Id  y_start,
Id  z0,
Id  z,
Id  z_s 
)
static

◆ scan_z_bf()

static Id gstlrn::scan_z_bf ( Id  x_begin,
Id  x_start,
Id  y_start,
Id  y_end,
Id  z0,
Id  z,
Id  z_s 
)
static

◆ scan_z_fb()

static Id gstlrn::scan_z_fb ( Id  x_start,
Id  x_end,
Id  y_begin,
Id  y_start,
Id  z0,
Id  z,
Id  z_s 
)
static

◆ scan_z_ff()

static Id gstlrn::scan_z_ff ( Id  x_start,
Id  x_end,
Id  y_start,
Id  y_end,
Id  z0,
Id  z,
Id  z_s 
)
static

◆ segy_array()

SegYArg gstlrn::segy_array ( const char *  filesegy,
DbGrid surf2D,
const String top_name,
const String bot_name,
const String top_aux,
const String bot_aux,
double  thickmin,
Id  option,
Id  nz_ss,
Id  verbOption,
Id  iline_min,
Id  iline_max,
Id  xline_min,
Id  xline_max,
double  modif_high,
double  modif_low,
double  modif_scale,
Id  codefmt 
)

Read the contents of a SEGY file

Returns
A SegYArg structure which contains:
- a vector of trace vectors
- a vector of trace descriptors
The Descriptor for each trace contains:
0: Absolute rank for the trace number
1: Cross-Line number
2: In-Line number
3: Coordinate along X
4: Coordinate along Y
5: Minimum Elevation
6: Maximum Elevation
7: Minimum Value
8: Maximum value
9: Thickness
10: Number of values
11: Minimum Elevation of Auxiliary surface
12: Maximum Elevation of Auxiliary surface
Parameters
[in]filesegyName of the SEGY file
[in]surf2DDb containing the top, Bottom and Reference surfaces This file is optional
[in]top_nameName of variable containing the Top Surface (or "")
[in]bot_nameName of variable containing the Bottom Surface (or "")
[in]top_auxName of auxiliary variable containing a Top (or "")
[in]bot_auxName of auxiliary variable containing a Top (or "")
[in]thickminMinimum thickness (or 0)
[in]optionFlattening option: 0 no flattening; 1 flattening from top; -1 flattening from bottom -2 squeeze and stretch option 2 averaging from 3-D to 2-D
[in]nz_ssNumber of layers for different options (see details)
[in]verbOptionVerbose option
[in]iline_minMinimum Inline number included (if defined)
[in]iline_maxMaximum Inline number included (if defined)
[in]xline_minMinimum Xline number included (if defined)
[in]xline_maxMaximum Xline number included (if defined)
[in]modif_highUpper truncation (when defined)
[in]modif_lowLower truncation (when defined)
[in]modif_scaleScaling value (when defined)
[in]codefmtReading format

In the case of Squeeze and Stretch (S&S), the number of layers

is meaningless. It is fixed by the user.

◆ segy_summary()

Grid gstlrn::segy_summary ( const char *  filesegy,
DbGrid surf2D,
const String name_top,
const String name_bot,
double  thickmin,
Id  option,
Id  nz_ss,
Id  verbOption,
Id  iline_min,
Id  iline_max,
Id  xline_min,
Id  xline_max,
double  modif_high,
double  modif_low,
double  modif_scale,
Id  codefmt 
)

Read the contents of a SEGY file and returns the structure SegyRead which captures the main characteristics of the SEGY grid

Parameters
[in]filesegyName of the SEGY file
[in]surf2DDb containing the top, Bottom and Reference surfaces This file is optional
[in]name_topRank of variable containing the Top Surface (or 0)
[in]name_botRank of variable containing the Bottom Surface (or 0)
[in]thickminMinimum thickness (or 0)
[in]optionFlattening option: 0 no flattening; 1 flattening from top; -1 flattening from bottom -2 squeeze and stretch option 2 averaging from 3-D to 2-D
[in]nz_ssNumber of layers for different options (see details)
[in]verbOptionVerbose option
[in]iline_minMinimum Inline number included (if defined)
[in]iline_maxMaximum Inline number included (if defined)
[in]xline_minMinimum Xline number included (if defined)
[in]xline_maxMaximum Xline number included (if defined)
[in]modif_highUpper truncation (when defined)
[in]modif_lowLower truncation (when defined)
[in]modif_scaleScaling value (when defined)
[in]codefmtReading format

: In the case of Squeeze and Stretch (S&S), the number of layers

: is meaningless. It is fixed by the user, unless defined

: by the output grid (if flag_store == 1)

◆ seismic_convolve()

Id gstlrn::seismic_convolve ( DbGrid db,
Id  flag_operate,
Id  flag_contrast,
Id  type,
Id  ntw,
Id  option,
Id  tindex,
double  fpeak,
double  period,
double  amplitude,
double  distort,
double  val_before,
double  val_middle,
double  val_after,
1 &  wavelet 
)

Convolve with a given wavelet

Returns
Array containing the discretized wavelet, allocated here
Parameters
[in]dbDb structure
[in]flag_operate1 to perform the convolution; 0 otherwise
[in]flag_contrast1 to perform contrast; 0 otherwise
[in]typeType of the wavelet (ENUM_WAVELETS)
[in]ntwhalf-length of the wavelet excluding center (samples)
[in]optionoption used to perform the convolution
  • -1 : erode the edge (on ntw pixels)
  • 0 : truncate the wavelet on the edge
  • +1 : extend the trace with padding before convolution
  • +2 : extend the trace with the last informed values
[in]tindextime index to locate the spike (Spike)
[in]fpeakpeak frequency of the Ricker wavelet
[in]periodwavelet period (s) (Ricker)
[in]amplitudewavelet amplitude (Ricker)
[in]distortwavelet distortion factor (Ricker)
[in]val_beforeReplacement value for undefined element before first defined sample
[in]val_middleReplacement value for undefined element between defined samples
[in]val_afterReplacement value for undefined element after last defined sample
[in]waveletWavelet defined as input (Dimension: 2*ntw+1)

◆ seismic_estimate_XZ()

Id gstlrn::seismic_estimate_XZ ( DbGrid db,
Model model,
Id  nbench,
Id  nv2max,
Id  flag_ks,
Id  flag_std,
Id  flag_sort,
Id  flag_stat 
)

Perform a bivariate estimation on a grid

Returns
Error return code
Parameters
[in,out]dbGrid Db structure
[in]modelModel structure
[in]nbenchVertical Radius of the neighborhood (center excluded)
[in]nv2maxMaximum number of traces of second variable on each side of the target trace
[in]flag_ks1 for a Simple Kriging; otherwise Ordinary Kriging
[in]flag_std1 for the calculation of the St. Dev.
[in]flag_sort1 if the traces to be treated are sorted by increasing distance to trace where first variable is defined
[in]flag_stat1 for producing final statistics

◆ seismic_operate()

Id gstlrn::seismic_operate ( DbGrid db,
Id  oper 
)

Do unary arithmetic operation on traces

Returns
Error return code
Parameters
[in]dbDb structure
[in]operOperator flag (ENUM_SEISMICS)
Remarks
Operations inv, slog and slog10 are "punctuated", meaning that if,
the input contains 0 values, 0 values are returned.

◆ seismic_simulate_XZ()

Id gstlrn::seismic_simulate_XZ ( DbGrid db,
Model model,
Id  nbench,
Id  nv2max,
Id  nbsimu,
Id  seed,
Id  flag_ks,
Id  flag_sort,
Id  flag_stat 
)

Perform a bivariate cosimulation on a grid

Returns
Error return code
Parameters
[in,out]dbGrid Db structure
[in]modelModel structure
[in]nbenchVertical Radius of the neighborhood (center excluded)
[in]nv2maxMaximum number of traces of second variable on each side of the target trace
[in]nbsimuNumber of simulations
[in]seedSeed for the random number generator
[in]flag_ks1 for a Simple Kriging; otherwise Ordinary Kriging
[in]flag_sort1 if the traces to be treated are sorted by increasing distance to trace where first variable is defined
[in]flag_stat1 for producing final statistics

◆ seismic_t2z_convert()

Id gstlrn::seismic_t2z_convert ( DbGrid db_t,
Id  iatt_v,
DbGrid db_z 
)

Resample from time to depth

Returns
Error return code
Parameters
[in]db_tTime Grid structure
[in]iatt_vAddress of the Velocity variable (in Time grid)
[out]db_zDepth Grid structure
Remarks
Linear interpolation and constant extrapolation is used to
determine interval velocities at times not specified.

◆ seismic_t2z_grid()

Id gstlrn::seismic_t2z_grid ( Id  verbose,
DbGrid db_t,
Id  iatt_v,
Id nx,
double *  x0,
double *  dx 
)

Define the Depth Grid characteristics from the Time Grid

Returns
Error return code
Parameters
[in]verboseVerbose flag
[in]db_tTime Grid structure
[in]iatt_vAttribute address of the Velocity (in Time grid)
[out]nxNumber of grid nodes along each direction
[out]x0Origin of the grid along each direction
[out]dxMesh of the grid along each direction

◆ seismic_z2t_convert()

Id gstlrn::seismic_z2t_convert ( DbGrid db_z,
Id  iatt_v,
DbGrid db_t 
)

Resample from depth to time

Returns
Error return code
Parameters
[in]db_zDepth Grid structure
[in]iatt_vAddress of the Velocity variable (in Depth grid)
[out]db_tTime Grid structure
Remarks
Linear interpolation and constant extrapolation is used to
determine interval velocities at times not specified.

◆ seismic_z2t_grid()

Id gstlrn::seismic_z2t_grid ( Id  verbose,
DbGrid db_z,
Id  iatt_v,
Id nx,
double *  x0,
double *  dx 
)

Define the Time Grid characteristics from the Depth Grid

Returns
Error return code
Parameters
[in]verboseVerbose flag
[in]db_zDepth Grid structure
[in]iatt_vAttribute address of the Velocity (Id Depth Grid)
[out]nxNumber of grid nodes along each direction
[out]x0Origin of the grid along each direction
[out]dxMesh of the grid along each direction

◆ separateKeywords()

VectorString gstlrn::separateKeywords ( const String code)

Separate keywords in the input string The keywords are identified when switching between alpha, digit and other

Parameters
codeString to be split
Returns

◆ set_DBIN()

void gstlrn::set_DBIN ( Db dbin)

‍****************************************************************************‍/ *!

‍****************************************************************************‍/ *!

◆ set_DBOUT()

void gstlrn::set_DBOUT ( Db dbout)

◆ set_grid_value()

void gstlrn::set_grid_value ( DbGrid dbgrid,
Id  iptr,
1 &  indg,
Id  ix,
Id  iy,
Id  iz,
double  value 
)

Set the value in the a 3-D (maximum) grid

Parameters
[in]dbgridDb Grid structure
[in]iptrRank of the column
[in]indgWorking index array (Dimension: get_NDIM(dbgrid))
[in]ixRank of the node along first dimension
[in]iyRank of the node along second dimension
[in]izRank of the node along third dimension
[in]valueAssigned value

◆ set_keypair()

void gstlrn::set_keypair ( const char *  keyword,
Id  origin,
Id  nrow,
Id  ncol,
const double *  values 
)

Deposit a keypair (double values)

Parameters
[in]keywordKeyword
[in]origin1 from C; 2 from R
[in]nrowNumber of rows
[in]ncolNumber of columns
[in]valuesArray of values (Dimension: nrow * ncol)

◆ set_keypair_int()

void gstlrn::set_keypair_int ( const char *  keyword,
Id  origin,
Id  nrow,
Id  ncol,
Id values 
)

Deposit a keypair (integer values)

Parameters
[in]keywordKeyword
[in]origin1 from C; 2 from R
[in]nrowNumber of rows
[in]ncolNumber of columns
[in]valuesArray of values (Dimension: nrow * ncol)

◆ set_rule_mode()

void gstlrn::set_rule_mode ( Id  rule_mode)

Set the Rule Mode

Parameters
[in]rule_mode1 for Gaussian; 0 for absence of conversion
Remarks
The absence of conversion is used in order to evaluate the
real thresholds along the rule for representing the rule
by proportions rather than in gaussian scale

◆ set_test_discrete()

void gstlrn::set_test_discrete ( bool  flag_discret)

◆ setDefaultSpace()

void gstlrn::setDefaultSpace ( const ASpaceSharedPtr space)

Set the unique default global space from another one.

Defining the default space from another one.

Parameters
space

◆ setFlagMatrixCheck()

void gstlrn::setFlagMatrixCheck ( bool  flag)

◆ setMultiThread()

void gstlrn::setMultiThread ( I32  nthreads)

◆ simbayes()

Id gstlrn::simbayes ( Db dbin,
Db dbout,
Model model,
ANeigh neigh,
Id  nbsimu,
Id  seed,
const 1 &  dmean,
const MatrixSymmetric dcov,
Id  nbtuba,
bool  flag_check,
const NamingConvention namconv 
)

Perform the conditional or non-conditional simulation with Bayesian Drift

Returns
Error return code
Parameters
[in]dbinInput Db structure (optional)
[in]dboutOutput Db structure
[in]modelModel structure
[in]neighANeigh structure (optional)
[in]nbsimuNumber of simulations
[in]seedSeed for random number generator
[in]dmeanArray giving the prior means for the drift terms
[in]dcovArray containing the prior covariance matrix for the drift terms
[in]nbtubaNumber of turning bands
[in]flag_check1 to check the proximity in Gaussian scale
[in]namconvNaming convention
Remarks
The arguments 'dbin' and 'neigh' are optional: they must
be defined only for conditional simulations

◆ simbipgs()

Id gstlrn::simbipgs ( Db dbin,
Db dbout,
RuleProp ruleprop,
Model model11,
Model model12,
Model model21,
Model model22,
ANeigh neigh,
Id  nbsimu,
Id  seed,
Id  flag_gaus,
Id  flag_prop,
Id  flag_check,
Id  flag_show,
Id  nbtuba,
Id  gibbs_nburn,
Id  gibbs_niter,
double  percent,
const NamingConvention namconv 
)

Perform the conditional or non-conditional Bi Pluri-gaussian simulations

Returns
Error return code
Parameters
[in]dbinInput Db structure (optional)
[in]dboutOutput Db structure
[in]rulepropRuleprop definition
[in]model11First Model structure for First Lithotype Rule
[in]model12Second Model structure for First Lithotype Rule
[in]model21First Model structure for Second Lithotype Rule
[in]model22Second Model structure for Second Lithotype Rule
[in]neighANeigh structure
[in]nbsimuNumber of simulations
[in]seedSeed for random number generator
[in]flag_gaus1 gaussian results; otherwise facies
[in]flag_prop1 for facies proportion
[in]flag_check1 if the facies at data must be checked against the closest simulated grid node
[in]flag_show1 if the grid node which coincides with the data should be represented with the data facies (only if flag_cond && !flag_gaus)
[in]nbtubaNumber of turning bands
[in]gibbs_nburnNumber of bootstrap iterations
[in]gibbs_niterMaximum number of iterations
[in]percentAmount of nugget effect added to too continuous model (expressed in percentage of the total variance)
[in]namconvNaming convention
Remarks
When conditional, the two first variables in the input Db
should correspond to the two facies indices (starting from 1)
The argument 'dbin' is optional: it must be defined only for
conditional simulations
The proportions (nfac1 * nfac2) must be ordered as follows:
f1af2a, f1bf2a, f1cf2a, ..., f1bf2a, f1bf2b, ..., f1nf2m

◆ simbool()

Id gstlrn::simbool ( Db dbin,
DbGrid dbout,
ModelBoolean tokens,
const SimuBooleanParam boolparam,
Id  seed,
bool  flag_simu,
bool  flag_rank,
bool  verbose,
const NamingConvention namconv 
)

Performs the boolean simulation

Returns
Error return code
Parameters
[in]dbinDb structure containing the data (optional)
[in]dboutDbGrid structure containing the simulated grid
[in]tokensTokens structure
[in]boolparamSimuBooleanParam structure
[in]seedSeed for the random number generator
[in]flag_simuStore the boolean simulation
[in]flag_rankStore the object rank
[in]verbose1 for a verbose output
[in]namconvNaming convention

◆ simcond()

Id gstlrn::simcond ( Db dbin,
Db dbout,
Model model,
Id  seed,
Id  nbsimu,
Id  nbtuba,
Id  gibbs_nburn,
Id  gibbs_niter,
Id  flag_check,
Id  flag_ce,
Id  flag_cstd,
Id  verbose 
)

Perform the conditional simulations under inequality constraints

Returns
Error return code
Parameters
[in]dbinInput Db structure (optional)
[in]dboutOutput Db structure
[in]modelModel structure
[in]seedSeed for random number generator
[in]nbsimuNumber of simulations
[in]nbtubaNumber of turning bands
[in]gibbs_nburnInitial number of iterations for bootstrapping
[in]gibbs_niterMaximum number of iterations
[in]flag_check1 to check the proximity in Gaussian scale
[in]flag_ce1 if the conditional expectation should be returned instead of simulations
[in]flag_cstd1 if the conditional standard deviation should be returned instead of simulations
[in]verboseVerbose flag
Remarks
The Neighborhood does not have to be defined as this method
only functions using a Unique Neighborhood. For consistency
it is generated internally.

◆ simfft()

Id gstlrn::simfft ( DbGrid db,
ModelGeneric model,
SimuFFTParam param,
Id  nbsimu,
Id  seed,
Id  verbose,
const NamingConvention namconv 
)

Perform the non-conditional simulation by FFT method on a grid

Returns
Error return code
Parameters
[in]dbDb structure
[in]modelModelGeneric structure
[in]paramSimuFFTParam structure
[in]nbsimuNumber of simulations
[in]seedValue of the seed
[in]verboseVerbose flag
[in]namconvNaming Convention

◆ simmaxstable()

Id gstlrn::simmaxstable ( Db dbout,
Model model,
double  ratio,
Id  seed,
Id  nbtuba,
Id  flag_simu,
Id  flag_rank,
Id  verbose 
)

Perform the non-conditional simulation of the Max-Stable Model

Returns
Error return code
Parameters
[in]dboutOutput Db structure
[in]modelModel structure
[in]ratioRatio modifying the range at each iteration
[in]seedSeed for random number generator
[in]nbtubaNumber of turning bands
[in]flag_simu1 if the simulation must be stored
[in]flag_rank1 if the iteration rank must be stored
[in]verboseVerbose flag
Remarks
This function uses a threshold that can be defined using
keypair mechanism with keyword "MaxStableThresh".

◆ simpgs()

Id gstlrn::simpgs ( Db dbin,
Db dbout,
RuleProp ruleprop,
Model model1,
Model model2,
ANeigh neigh,
Id  nbsimu,
Id  seed,
Id  flag_gaus,
Id  flag_prop,
Id  flag_check,
Id  flag_show,
Id  nbtuba,
Id  gibbs_nburn,
Id  gibbs_niter,
double  percent,
const NamingConvention namconv 
)

Perform the conditional or non-conditional Pluri-gaussian simulations

Returns
Error return code
Parameters
[in]dbinInput Db structure (optional)
[in]dboutOutput Db structure
[in]rulepropRuleProp structure
[in]model1First Model structure
[in]model2Second Model structure (optional)
[in]neighANeigh structure
[in]nbsimuNumber of simulations
[in]seedSeed for random number generator
[in]flag_gaus1 if results must be gaussian; otherwise facies
[in]flag_prop1 for facies proportion
[in]flag_check1 if the facies at data must be checked against the closest simulated grid node
[in]flag_show1 if the grid node which coincides with the data should be represented with the data facies (only if flag_cond && !flag_gaus)
[in]nbtubaNumber of turning bands
[in]gibbs_nburnNumber of bootstrap iterations
[in]gibbs_niterMaximum number of iterations
[in]percentAmount of nugget effect added to too much continous model (expressed in percentage of the total variance)
[in]namconvNaming convention
Remarks
The argument 'dbin' is optional: it must be defined only for
conditional simulations.
When conditional, the unique variable in the input Db structure
should correspond to the facies index (starting from 1)

◆ simPGSSPDE()

Id gstlrn::simPGSSPDE ( Db dbin,
Db dbout,
Model model,
const RuleProp ruleprop,
Id  nbsimu,
Id  useCholesky,
const VectorMeshes meshesK,
const ProjMultiMatrix projInK,
const VectorMeshes meshesS,
const ProjMultiMatrix projInS,
const ProjMultiMatrix projOutK,
const ProjMultiMatrix projOutS,
const SPDEParam params,
bool  verbose,
const NamingConvention namconv 
)

Perform the conditional SIMULATIONs using PGS technique in the SPDE framework

Parameters
dbinInput Db (variable to be estimated). Only for conditional simulations
dboutOutput Db where the estimation must be performed
modelModel definition
rulepropRuleProp structure describing the Rule and the Proportions
nbsimuNumber of simulations
useCholeskyDefine the choice regarding Cholesky (see _defineCholesky)
meshesKMeshes used for Kriging (optional)
projInKMatrix of projection used for Kriging (optional)
meshesSMeshes used for Simulations (optional)
projInSMatrix of projection used for Simulations (optional)
projOutKMatrix of projection on dbout used for Kriging (optional)
projOutSMatrix of projection on dbout used for Simulations (optional)
paramsSet of SPDE parameters
verboseVerbose flag
namconvsee NamingConvention
Returns
Error returned code
Remarks
Algorithm for 'meshesK', 'projInK', 'meshesS' and 'projInS':
  • Each one of the previous arguments is considered individually and sequentially.
  • For 'meshes' in general ('meshesK' or 'meshesS'):
    • If it is not defined, it is created from 'model' and so as to cover both 'dbin' and 'dbout' (if provided).
    • If is already exist, the number of meshes must be equal:
      • either to 1: the same mesh is used for all structures
      • or to the number of structures (nugget discarded)
    • Otherwise an error is raised
  • For 'projIn' in general ('projInK' or 'projInS'):
    • If it is not defined, it is created from 'meshes'
    • If it is already exist, the number of projectors must be equal to the number of meshes
    • Otherwise an error is raised
  • If 'mesheS' does not exist, 'meshesK' is used instead
  • If 'projInS' does not exist, 'projInK' is used instead
Note that, at this stage of development of this method, the data must be provided in Gaussian scale.

◆ simRI()

Id gstlrn::simRI ( Db dbout,
Model model,
Id  ncut,
double *  zcut,
double *  wcut,
Id  seed,
Id  nbtuba,
Id  verbose 
)

Perform the non-conditional simulation of the Orthogonal Residual Model

Returns
Error return code
Parameters
[in]dboutOutput Db structure
[in]modelModel structure
[in]ncutNumber of cutoffs
[in]zcutArray of cutoffs
[in]wcutArray of weights
[in]seedSeed for random number generator
[in]nbtubaNumber of turning bands
[in]verboseVerbose flag

◆ simsph()

Id gstlrn::simsph ( DbGrid db,
Model model,
const SimuSphericalParam sphepar,
Id  seed,
bool  verbose,
const NamingConvention namconv 
)

Simulates the random function on the sphere

Parameters
[in]dbData base containing the coordinates of target points These coordinates must be expressed in long/lat
[in]modelModel (defined in Euclidean space) to be used
[in]spheparSimuSphericalParam structure
[in]seedSeed for random number generation
[in]verboseVerbose flag
[in]namconvNaming convention

◆ simsph_mesh()

gstlrn::simsph_mesh ( MeshSpherical mesh,
Model model,
const SimuSphericalParam sphepar,
Id  seed,
Id  verbose 
)

Simulates the random function on the sphere

Returns
The Vector simulated values
Parameters
[in]meshMeshSpherical object
[in]modelModel (defined in Euclidean space) to be used
[in]spheparSimuSphericalParam structure
[in]seedSeed for random number generation
[in]verboseVerbose flag

◆ simtub()

Id gstlrn::simtub ( Db dbin,
Db dbout,
Model model,
ANeigh neigh,
Id  nbsimu,
Id  seed,
Id  nbtuba,
bool  flag_dgm,
bool  flag_check,
const NamingConvention namconv 
)

Perform the conditional or non-conditional simulation

Returns
Error return code
Parameters
[in]dbinInput Db structure (optional)
[in]dboutOutput Db structure
[in]modelModel structure
[in]neighANeigh structure (optional)
[in]nbsimuNumber of simulations
[in]seedSeed for random number generator
[in]nbtubaNumber of turning bands
[in]flag_dgm1 for Direct Block Simulation
[in]flag_check1 to check the proximity in Gaussian scale
[in]namconvNaming convention
Remarks
The arguments 'dbin' and 'neigh' are optional: they must
be defined only for conditional simulations

◆ simtub_constraints()

Id gstlrn::simtub_constraints ( Db dbin,
Db dbout,
Model model,
ANeigh neigh,
Id  seed,
Id  nbtuba,
Id  nbsimu_min,
Id  nbsimu_quant,
Id  niter_max,
1 &  cols,
Id(*)(Id flag_grid, Id nDim, Id nech, Id *nx, double *dx, double *x0, double nonval, double percent, 1 &tab)  func_valid 
)

Perform a set of valid conditional or non-conditional simulations

Returns
Error return code
Parameters
[in]dbinInput Db structure (optional)
[in]dboutOutput Db structure
[in]modelModel structure
[in]neighANeigh structure (optional)
[in]seedSeed for random number generator
[in]nbtubaNumber of turning bands
[in]nbsimu_minMinimum number of simulations
[in]nbsimu_quantAdditional quantum of simulations
[in]niter_maxMaximum number of iterations
[in]colsVector of column indices
[in]func_validTesting function
Remarks
This function calls a simulation outcome.
It provides a return code:
-1: the simulation outcome is not valid and the process must be
interrupted gently with no error (case of non-convergence)
0: the simulation outcome is not valid
1: the simulation outcome is valid and must be kept
2: the simulation outcome is valid and its returned version
must be kept (this is usefull if func_valid() has modified it).
The func_valid prototype has the following arguments:
  • ndim Space dimension
  • nx Array of number of grid meshes along all space direction
  • dx Array of grid mesh along all space direction
  • x0 Array of grid origin along all space direction
  • nonval Value corresponding to a missing grid value
  • percent Percentage of the simulations already validated
  • tab Array containing the simulated outcome
The following lines give an example of func_valid() which considers
a simulation outcome as valid if more than 50% of the valid samples
have a positive value.
Id func_valid(Id flag_grid,Id ndim,Id nech,
Id *nx,double *dx,double *x0,
double nonval, double percent, double *tab)
{
double ratio;
Id i,npositive,nvalid;
for (i=0; i<nech; i++)
{
if (tab[i] == nonval) continue;
nvalid++;
if (tab[i] > 10.) npositive++;
}
ratio = (nvalid > 0) ? npositive / nvalid : 0.;
return(ratio > 0.5);
}
long Id
Main type for gstlearn 64-bits integers, to be used in priority when an integer is needed.
Definition geoslib_define.h:31

◆ simu_func_categorical_scale()

void gstlrn::simu_func_categorical_scale ( Db db,
Id  verbose,
Id  nbsimu 
)

Scaling function for the Modification categorical case

Parameters
[in]dbDb structure
[in]verbose1 for the verbose flag
[in]nbsimuNumber of simulations

◆ simu_func_categorical_transf()

void gstlrn::simu_func_categorical_transf ( Db db,
Id  verbose,
Id  isimu,
Id  nbsimu 
)

Transformation function for the Modification categorical case

Parameters
[in]dbDb structure
[in]verbose1 for the verbose flag
[in]isimuRank of the current simulation
[in]nbsimuNumber of simulations

◆ simu_func_categorical_update()

void gstlrn::simu_func_categorical_update ( Db db,
Id  verbose,
Id  isimu,
Id  nbsimu 
)

Updating function for the Modification categorical case

Parameters
[in]dbDb structure
[in]verbose1 for the verbose flag
[in]isimuRank of the current simulation
[in]nbsimuNumber of simulations (stored)

◆ simu_func_continuous_scale()

void gstlrn::simu_func_continuous_scale ( Db db,
Id  verbose,
Id  nbsimu 
)

Scaling function for the Modification continuous case

Parameters
[in]dbDb structure
[in]verbose1 for the verbose flag
[in]nbsimuNumber of simulations

◆ simu_func_continuous_update()

void gstlrn::simu_func_continuous_update ( Db db,
Id  verbose,
Id  isimu,
Id  nbsimu 
)

Updating function for the Modification continuous case

Parameters
[in]dbDb structure
[in]verbose1 for the verbose flag
[in]isimuRank of the current simulation
[in]nbsimuNumber of simulations (stored)

◆ simulateSPDE()

Id gstlrn::simulateSPDE ( Db dbin,
Db dbout,
Model model,
Id  nbsimu,
Id  useCholesky,
const VectorMeshes meshesK,
const ProjMultiMatrix projInK,
const VectorMeshes meshesS,
const ProjMultiMatrix projInS,
const ProjMultiMatrix projOutK,
const ProjMultiMatrix projOutS,
const SPDEParam params,
bool  verbose,
const NamingConvention namconv 
)

Perform the conditional SIMULATIONs in the SPDE framework

Parameters
dbinInput Db (variable to be estimated). Only for conditional simulations
dboutOutput Db where the estimation must be performed
modelModel definition
nbsimuNumber of simulations
useCholeskyDefine the choice regarding Cholesky (see _defineCholesky)
meshesKMeshes used for Kriging (optional)
projInKMatrix of projection used for Kriging (optional)
meshesSMeshes used for Simulations (optional)
projInSMatrix of projection used for Simulations (optional)
projOutKMatrix of projection on dbout used for Kriging (optional)
projOutSMatrix of projection on dbout used for Simulations (optional)
paramsSet of SPDE parameters
verboseVerbose flag
namconvsee NamingConvention
Returns
Error returned code
Remarks
Algorithm for 'meshesK', 'projInK', 'meshesS' and 'projInS':
  • Each one of the previous arguments is considered individually and sequentially.
  • For 'meshes' in general ('meshesK' or 'meshesS'):
    • If it is not defined, it is created from 'model' and so as to cover both 'dbin' and 'dbout' (if provided).
    • If is already exist, the number of meshes must be equal:
      • either to 1: the same mesh is used for all structures
      • or to the number of structures (nugget discarded)
    • Otherwise an error is raised
  • For 'projIn' in general ('projInK' or 'projInS'):
    • If it is not defined, it is created from 'meshes'
    • If it is already exist, the number of projectors must be equal to the number of meshes
    • Otherwise an error is raised
  • If 'mesheS' does not exist, 'meshesK' is used instead
  • If 'projInS' does not exist, 'projInK' is used instead

◆ simulation_refine()

DbGrid * gstlrn::simulation_refine ( DbGrid dbin,
Model model,
const SimuRefineParam param,
Id  seed,
const NamingConvention namconv 
)

Refine the simulation

Returns
Newly refined Grid.
Parameters
[in]dbinInput grid Db structure
[in]modelModel structure
[in]paramSimuRefineParam structure
[in]seedSeed for the random number generator
[in]namconvNaming convention
Remarks
For each dimension of the space, if N stands for the number of
nodes in the input grid, the number of nodes of the output grid
will be (N-1) * 2^p + 1 where p is the param.getNmult()

◆ simultaneous_sort()

void gstlrn::simultaneous_sort ( double *  dist,
Id idx,
Id  size 
)

◆ simuPost()

Id gstlrn::simuPost ( Db dbin,
DbGrid dbout,
const VectorString names,
bool  flag_match,
const EPostUpscale &  upscale,
const std::vector< EPostStat > &  stats,
bool  verbose,
const 1 &  check_targets,
Id  check_level,
const NamingConvention namconv 
)
Parameters
dbinInput data base
dboutOutput data base (must be a Grid)
namesVector of simulation names
flag_matchTrue if the ranks of simulations must match; otherwise: product
upscaleOption within EPostUpscale
statsVector of options within EPostStat
verboseVerbose flag
check_targetsRank (1-based) of the target element to be checked (0: None; -1: All)
check_level0: Statistics; 1: Sample Selection; 2: Iteration definition
namconvNaming convention
Returns
Error code
Remarks
  • N : number of variables in 'dbin' defined by 'names' (index 'n')
  • k_1, ..., k_N : number of outcomes for each variable
  • K : number of multivariate simulations according to 'flag_match' (index 'k')
  • Transformation function 'F' from Z in R_N to Y in R_P (index 'p')

Description of the Flow Chart:

  1. Loop over cells of 'dbout' (index 'C')
  2. Loop over the simulations (index 'k')
  3. Find the active samples of 'dbin' in 'C' (index 's') and build table of Z_n^{k}(s)
  4. Apply the Transform function to table: Y_p^{k}(s)
  5. Upscale to the target cell according to upscaling rule '_upscale': up_Y_p^{k}(C)
  6. Compute statistics according to stat rule '_stats'

◆ simuPostDemo()

Id gstlrn::simuPostDemo ( Db dbin,
DbGrid dbout,
const VectorString names,
bool  flag_match,
const EPostUpscale &  upscale,
const std::vector< EPostStat > &  stats,
bool  verbose,
const 1 &  check_targets,
Id  check_level,
const NamingConvention namconv 
)

This is a particular use of Simulation Post-Processing functions.

Its specificity is an embedded transformation function which transforms the multivariate simulation vector (combining the one outcome of each variable, and for a given sample) This transformation (which is provided as an example here):

  • uses the multivariate simulation vector in input (N elements)
  • produces an output vector (Dimension 2) with the mean and the standard deviation of the values of the input vector

For a detailed list of arguments, see simuPost

◆ simuPostPropByLayer()

Id gstlrn::simuPostPropByLayer ( Db dbin,
DbGrid dbout,
const VectorString names,
bool  flag_match,
bool  flag_topToBase,
const EPostUpscale &  upscale,
const std::vector< EPostStat > &  stats,
bool  verbose,
const 1 &  check_targets,
Id  check_level,
const NamingConvention namconv 
)

This is a particular use of Simulation Post-Processing functions. Its specificity comes from its transformation function.

It is assumed that each input variable corresponds to the thickness of ordered layers. This function receives a vector of multivariate information (for each combination of simulation outcome and for each sample of the input 'db').

If N designates the number of elements of the input vector, the transformation returns a vector of N+1 elements. This vector corresponds to the percentage of each layer within the target block

Remarks
: Coding Rule
: - code = 0 -Inf < z <= H1
: - code = 1 H1 < z <= H1 + H2
: - code = 2 H1 + H2 < z <= H1 + H2 + H3
: - code = 3 H1 + H2 + ... < z <= + Inf

For a detailed list of arguments, see simuPost

◆ simuSpectral()

Id gstlrn::simuSpectral ( Db dbin,
Db dbout,
Model model,
Id  nbsimu,
Id  seed,
Id  ns,
Id  nd,
bool  verbose,
const NamingConvention namconv 
)

Perform a series of simulations (on Rn or on the Spehere) using Spectral Method

Parameters
dbinInput Db where the conditioning data are read
dboutOutput Db where the results are stored
modelModel (should only contain covariances that can cope with spectral method)
nsNumber of spectral components
nbsimuNumber of simulations processed simultaneously
seedSeed used for the Random number generator
verboseVerbose flag
ndNumber of discretization steps (used for the Spectrum on Sphere)
namconvNaming Convention
Note
The conditional version is not yet available

◆ skipBOM()

void gstlrn::skipBOM ( std::ifstream &  ins)

This file contains all the OLD-STYLE declarations causing warnings on Windows They should gradually be replaced by modern statements However, they are kept there to keep track on these statements

◆ softplus()

static double gstlrn::softplus ( double  x)
static

◆ softplusDerivative()

static double gstlrn::softplusDerivative ( double  x)
static

◆ softplusinv()

static double gstlrn::softplusinv ( double  x)
static

◆ solve_P2()

Id gstlrn::solve_P2 ( double  a,
double  b,
double  c,
1 &  x 
)

Find the roots of a polynomial of order 2: ax^2 + bx + c = 0

Returns
Number of real solutions
Parameters
[in]a,b,cCoefficients of the polynomial
[out]xArray of real solutions (Dimension: 2)
Remarks
When the solution is double, the returned number os 1.

◆ solve_P3()

Id gstlrn::solve_P3 ( double  a,
double  b,
double  c,
double  d,
1 &  x 
)

Find the roots of a polynomial of order 3: a*x^3 + b*x^2 + c*x + d = 0

Returns
Number of real solutions
Parameters
[in]a,b,c,dCoefficients of the polynomial
[out]xArray of real solutions (Dimension: 3)
Remarks
When the solution is double, the returned number os 1.

◆ sparseinv()

Id gstlrn::sparseinv ( Id  n,
Id Lp,
Id Li,
double *  Lx,
double *  d,
Id Up,
Id Uj,
double *  Ux,
Id Zp,
Id Zi,
double *  Zx,
double *  z,
Id Zdiagp,
Id Lmunch 
)

◆ sphering()

MatrixSquare * gstlrn::sphering ( const AMatrix X)

Sphering procedure

Parameters
XInput Data vector
Returns
The Sphering matrix (or nullptr if problem)
Remarks
When performing the (forward) sphering, you must perform the following operation
X <- prodMatMat(X, S)

◆ spill_point()

Id gstlrn::spill_point ( DbGrid dbgrid,
Id  ind_depth,
Id  ind_data,
Id  option,
bool  flag_up,
Id  verbose_step,
double  hmax,
double *  h,
const double *  th,
Id ix0,
Id iy0 
)

Evaluates the spill point

Returns
Error return code
- Memory problem
- Maximum Reservoir Thickness violation when turning UNKNOWN into
INSIDE
Parameters
[in]dbgridGrid Db structure
[in]ind_depthRank of the variable containing the depth
[in]ind_dataRank of the variable containing the data
[in]option0 for 4-connectivity; 1 for 8-connectivity
[in]flag_upTRUE when working in elevation; 0 in depth
[in]verbose_stepStep for verbose flag
[in]hmaxmaximum reservoir thickness (FFFF not used)
[out]helevation of the spill point
[out]thmaximum reservoir thickness
[out]ix0location of the spill point grid node along X
[out]iy0location of the spill point grid node along Y
Remarks
The variable 'ind_data', which contains the constraints, must
be set to:
0 for an idle node
1 for a node located outside the reservoir
2 for a node belonging to the reservoir
The numbering of the grid node corresponding to the spill point
must start with 1

◆ spillPoint()

Spill_Res gstlrn::spillPoint ( DbGrid dbgrid,
const String name_depth,
const String name_data,
Id  option,
bool  flag_up,
Id  verbose_step,
double  hmax 
)

Evaluates the spill point

Returns
The Spill_Res structure which contains:
h elevation of the spill point
th maximum reservoir thickness
ix0 location of the spill point grid node along X
iy0 location of the spill point grid node along Y
Parameters
[in]dbgridGrid Db structure
[in]name_depthName of the variable containing the depth
[in]name_dataName of the variable containing the data
[in]option0 for 4-connectivity; 1 for 8-connectivity
[in]flag_upTRUE when working in elevation; FALSE in depth
[in]verbose_stepStep for the verbose flag
[in]hmaxmaximum reservoir thickness (FFFF not used)
Remarks
The variable 'ind_data', which contains the constraints, must
be set to:
0 for an idle node
1 for a node located outside the reservoir
2 for a node belonging to the reservoir
The numbering of the grid node corresponding to the spill point
must start with 1

◆ st_absolute_index()

static Id gstlrn::st_absolute_index ( DbGrid db,
Id  ix,
Id  iz 
)
static

Returns the absolute index of the sample in the grid

Returns
Returned absolute address
Parameters
[in]dbGrid Db structure
[in]ixRank of the target trace
[in]izRank of the target sample within the target trace

◆ st_addTriangle()

static void gstlrn::st_addTriangle ( const double  v1[3],
const double  v2[3],
const double  v3[3],
Reg_Coor R_coor 
)
static

◆ st_already_present()

static Id gstlrn::st_already_present ( Reg_Coor R_coor,
Id  i0,
Id  ntri,
const 1 &  coord,
double  eps = EPSILON3 
)
static

◆ st_auxiliary()

static void gstlrn::st_auxiliary ( Db surfaces,
Id  rank,
Id  nz,
Id  option,
double  z0,
double  delta,
double  czbot,
double  cztop,
Id  iaux_bot,
Id  iaux_top,
RefStats refstats 
)
static

Project the auxiliary surfaces on the system defined by the unit and store the result in the structure 'refstats'

Parameters
surfacesPointer to the Db containing the surfaces
rankRank of the trace within 'db'
nzNumber of meshes in the layer
optionStretching option
z0Elevation origin
deltaVertical mesh
czbotBottom bound
cztopTop bound
iaux_botAttribute index of the Auxiliary Bottom variable (or -1)
iaux_topAttribute index of the Auxiliary Top variable (or -1)
refstatsRefStats structure

◆ st_binaryFileHeader_init()

static binaryFileHeader gstlrn::st_binaryFileHeader_init ( )
static

◆ st_blank_center()

static void gstlrn::st_blank_center ( SPIMG image)
static

Blanks the center of the image

Parameters
[in,out]imageSPIMG structure to be initialized

◆ st_block_discretize()

static void gstlrn::st_block_discretize ( Id  mode,
Id  flag_rand,
Id  iech 
)
static

Discretize a block

Parameters
[in]mode0 if the block extension is read from grid 1 if the block extension is read from variable
[in]flag_rand0 if the second discretization is regular 1 if the second point must be randomized
[in]iechrank of the variable (used when mode=1)

◆ st_block_discretize_alloc()

static Id gstlrn::st_block_discretize_alloc ( Id  ndim,
const 1 &  ndiscs 
)
static

Allocate the Target discretization

Parameters
[in]ndimSpace dimension
[in]ndiscsDiscretization parameters (or NULL)

◆ st_build_correl()

static void gstlrn::st_build_correl ( Local_CorPgs *  corpgs,
1 &  params_in,
MatrixSymmetric correl 
)
static

Establish the correlation for C1(h), C12(h), C21(h), C2(h)

Parameters
[in]corpgsLocal_CorPgs structure
[in]params_inArray of parameters
[out]correlCorrelation matrix (Dimension = 4*4)

◆ st_bvnmvn()

static double gstlrn::st_bvnmvn ( double *  lower,
double *  upper,
Id infin,
double *  correl 
)
static

A function for computing bivariate normal probabilities

Returns
bivariate normal probability
Parameters
[in]lowerarray of lower integration limits
[in]upperarray of upper integration limits
[in]infinarray of integration limits flag (0,1,2)
[in]correlcorrelation coefficient

◆ st_bvu()

static double gstlrn::st_bvu ( const double *  sh,
const double *  sk,
const double *  r 
)
static

A function for computing bivariate normal probabilities. Yihong Ge Department of Computer Science and Electrical Engineering Washington State University Pullman, WA 99164-2752 and Alan Genz Department of Mathematics Washington State University Pullman, WA 99164-3113 Email : alang.nosp@m.enz@.nosp@m.wsu.e.nosp@m.du

Returns
Calculate the probability that X is larger than SH and Y is
larger than SK.
Parameters
[in]shintegration limit
[in]skintegration limit
[in]rREAL, correlation coefficient

◆ st_calcul()

static double gstlrn::st_calcul ( Local_Pgs *  local_pgs,
Id  flag_deriv,
Id  flag_reset,
1 &  params,
1 &  Grad,
MatrixSymmetric Hess,
MatrixSymmetric JJ 
)
static

Global calculation

Returns
The global score
Parameters
[in]local_pgsLocal_Pgs structure
[in]flag_deriv1 if the derivatives must be calculated
[in]flag_reset1 to update the probability calculations
[in]paramsArray of parameters
[out]GradVector of cumulated gradients (Dimension= 4)
[out]HessMatrix of cumulated Hessian (Dimension= 4*4)
[out]JJMatrix of cumulated JJ (Dimension= 4*4)

◆ st_calcul0()

static Id gstlrn::st_calcul0 ( 1 &  param,
1 &  lower,
1 &  upper,
1 &  scale,
const MatrixDense acont,
1 &  tabwgt,
1 &  residuals,
MatrixDense Jr,
1 &  grad,
MatrixSquare gauss,
1 &  hgnc,
1 &  param1,
1 &  param2,
1 &  tabmod1,
1 &  tabmod2 
)
static

Evaluate Gradient and Hermitian matrices

Parameters
[in]paramCurrent values of the parameters
[in]lowerArray of lower values
[in]upperArray of upper values
[in]scaleArray of scaling values
[in]acontArray of constraints
[in]tabwgtArray of weights at control points
[out]residualsArray of residuals
[out]JrArray of gradients
[out]gradGradient matrix
[out]gaussGauss matrix
[out]hgncResulting hgnc array
[out]param1Working array (Dimension: NPAR)
[out]param2Working array (Dimension: NPAR)
[out]tabmod1Working array (Dimension: NDAT)
[out]tabmod2Working array (Dimension: NDAT)

◆ st_calcul_covmat()

static gstlrn::st_calcul_covmat ( const char *  title,
Db db1,
Id  test_def1,
Db db2,
Id  test_def2,
Model model 
)
static

Establish the covariance matrix between two Dbs

Returns
Covariance matrix (Dim: n1 * n2)
Parameters
[in]titleTitle of the optional printout
[in]db1First Db structure
[in]test_def11 if the first variable (ELoc::Z) must be checked
[in]db2Second Db structure
[in]test_def21 if the second variable (ELoc::Z) must be checked
[in]modelModel structure
Remarks
The returned argument must be freed by the calling function

◆ st_calcul_covmatrix()

static void gstlrn::st_calcul_covmatrix ( Local_Pgs *  local_pgs,
Id flag_ind,
Id iconf,
double *  cov 
)
static

Calculate the covariance matrix

Parameters
[in]local_pgsLocal_Pgs structure
[out]flag_ind1 if the two GRF are independent
[out]iconfArray of ranks of the discretized covariance
[out]covMatrix of covariance

◆ st_calcul_distmat()

static gstlrn::st_calcul_distmat ( const char *  title,
Db db1,
Id  test_def1,
Db db2,
Id  test_def2,
double  power 
)
static

Establish the distance matrix between two Dbs

Returns
Covariance matrix
Parameters
[in]titleTitle of the optional printout
[in]db1First Db structure
[in]test_def11 if the first variable (ELoc::Z) must be checked
[in]db2Second Db structure (sources)
[in]test_def21 if the second variable (ELoc::Z) must be checked
[in]powerPower of the Distance decay
Remarks
The returned argument must be freed by the calling function

◆ st_calcul_drfmat()

static gstlrn::st_calcul_drfmat ( const char *  title,
Db db1,
Id  test_def1,
Model model 
)
static

Establish the drift matrix for a given Db

Returns
Drift matrix (Dim: n1 * nbfl)
Parameters
[in]titleTitle of the optionla printout
[in]db1First Db structure
[in]test_def11 if the first variable (ELoc::Z) must be checked
[in]modelModel structure
Remarks
The returned argument must be freed by the calling function

◆ st_calcul_nostat()

static double gstlrn::st_calcul_nostat ( Local_Pgs *  local_pgs,
Id  flag_deriv,
Id  flag_reset,
MatrixSymmetric correl,
1 &  Grad,
MatrixSymmetric Hess,
MatrixSymmetric JJ 
)
static

Global calculation in the non-stationary case

Returns
The global score
Parameters
[in]local_pgsLocal_Pgs structure
[in]flag_deriv1 if the derivatives must be calculated
[in]flag_reset1 to update the probability calculations
[in]correlCorrelation matrix updated
[out]GradVector of cumulated gradients (Dimension= 4)
[out]HessMatrix of cumulated Hessian (Dimension= 4*4)
[out]JJMatrix of cumulated JJ (Dimension= 4*4)

◆ st_calcul_product()

static gstlrn::st_calcul_product ( const char *  title,
Id  n1,
Id  ns,
const 1 &  covss,
const 1 &  distgen 
)
static

Operate the product of the Distance by the Source covariance matrix

Returns
Product matrix
Parameters
[in]titleTitle of the optionla printout
[in]n1Number of Data
[in]nsNumber of Sources
[in]covssCovariance Matrix between Sources (Dim: ns*ns)
[in]distgenDistance matrix
Remarks
The returned argument must be freed by the calling function

◆ st_calcul_stat()

static double gstlrn::st_calcul_stat ( Local_Pgs *  local_pgs,
Id  flag_deriv,
Id  flag_reset,
MatrixSymmetric correl,
1 &  Grad,
MatrixSymmetric Hess,
MatrixSymmetric JJ 
)
static

Global calculation in the stationary case

Returns
The global score
Parameters
[in]local_pgsLocal_Pgs structure
[in]flag_deriv1 if the derivatives must be calculated
[in]flag_reset1 to update the probability calculations
[in]correlCorrelation matrix updated
[out]GradVector of cumulated gradients (Dimension= 4)
[out]HessMatrix of cumulated Hessian (Dimension= 4*4)
[out]JJMatrix of cumulated JJ (Dimension= 4*4)

◆ st_calculate_covres()

static void gstlrn::st_calculate_covres ( DbGrid db,
Model model,
const double *  cov_ref,
Id  cov_radius,
Id  flag_sym,
const Id  cov_ss[3],
const Id  cov_nn[3],
double *  cov_res 
)
static

Calculate the experimental covariance of the residual variable defined on the grid

Parameters
[in]dbinput Db structure
[in]modelModel describing the horizontal structure
[in]cov_refArray of discretized covariance for target variable
[in]cov_radiusRadius of the covariance array
[in]flag_sym1 for symmetrized covariance
[in]cov_ssArray of dimensions of the Covariance array
[in]cov_nnArray of radius of the Covariance array
[out]cov_resArray containing the covariance of the residual variable

◆ st_calculate_covtot()

static void gstlrn::st_calculate_covtot ( DbGrid db,
Id  ix0,
Id  iy0,
Id  flag_sym,
const Id  cov_ss[3],
const Id  cov_nn[3],
Id num_tot,
double *  cov_tot 
)
static

Calculate the experimental covariance of the total variable defined on the grid

Parameters
[in]dbinput Db structure
[in]ix0index of the grid index along X
[in]iy0index of the grid index along Y
[in]flag_sym1 for symmetrized covariance
[in]cov_ssArray of dimensions of the Covariance array
[in]cov_nnArray of radius of the Covariance array
[out]num_totArray containing the numb er of pairs
[out]cov_totArray containing the covariance of the total variable

◆ st_calculate_thresh_stat()

static Id gstlrn::st_calculate_thresh_stat ( Local_Pgs *  local_pgs)
static

Calculate the thresholds in the stationary case

Returns
Error return code
Parameters
[in]local_pgsLocal_Pgs structure

◆ st_change()

static void gstlrn::st_change ( double *  pt_out,
double  value 
)
static

◆ st_check()

static void gstlrn::st_check ( 1 &  ind_util,
1 &  hgnc,
const MatrixDense acont 
)
static

Check that the algorithm is valid

Parameters
[in]ind_utilList of retained constraint indices
[in]hgncWorking vector
[in]acontMatrix of additional constraints

◆ st_check_auxiliary_variables()

static Id gstlrn::st_check_auxiliary_variables ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
1 &  seltab 
)
static

Check all the auxiliary variables

Returns
The number of active samples
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in,out]seltabNumber of sample definition (0, 1 or 2)

◆ st_check_environment()

static Id gstlrn::st_check_environment ( Id  flag_in,
Id  flag_out,
Model model 
)
static

Checks the kriging environment

Returns
Error return code
Parameters
[in]flag_in1 if the Input Db is used
[in]flag_out1 if the Output Db is used
[in]modelModel structure (optional)
Remarks
The address of the argument 'neigh' is memorized in a local
static variable

◆ st_check_facies_data2grid()

static void gstlrn::st_check_facies_data2grid ( Db dbin,
Db dbout,
Id  flag_check,
Id  flag_show,
Id  ipgs,
Id  nechin,
Id  nfacies,
Id  nbsimu 
)
static

Check/Show the data against facies at the closest grid node

Parameters
[in]dbinInput Db structure
[in]dboutOutput Db grid structure
[in]flag_check1 check the consistency between data and grid
[in]flag_show1 show the data on grid
[in]ipgsRank of the PGS
[in]nechinInitial number of data
[in]nfaciesNumber of facies
[in]nbsimuNumber of simulations
Remarks
Attributes ELoc::FACIES are mandatory
Attributes ELoc::GAUSFAC are mandatory

◆ st_check_layer()

static void gstlrn::st_check_layer ( const char *  string,
LMlayers lmlayers,
Id  ilayer0 
)
static

Check if the target layer rank is consistent

Parameters
[in]stringName of the calling procedure
[in]lmlayersLMlayers structure
[in]ilayer0Rank of the target layer (starting from 1)
Remarks
If this target layer rank is not correct, mes_abort() is called
and the program is interrupted as this must never happen.

◆ st_check_param()

static Id gstlrn::st_check_param ( 1 &  param,
1 &  lower,
1 &  upper 
)
static

Check if the default, lower and upper bounds of the parameters are consistent or not

Returns
Error returned code
Parameters
[in]paramCurrent values of the parameters
[in]lowerArray of lower values
[in]upperArray of upper values

◆ st_check_simtub_environment()

static Id gstlrn::st_check_simtub_environment ( Db dbin,
Db dbout,
Model model,
ANeigh neigh 
)
static

Checks the environment for simulations by Turning Bands

Returns
Error return code
Parameters
[in]dbininput Db structure (optional if non conditional)
[in]dboutoutput Db structure
[in]modelModel structure
[in]neighANeigh structure (optional if non conditional)

◆ st_check_test_discret()

static Id gstlrn::st_check_test_discret ( const ERule &  mode,
Id  flag_rho 
)
static

Check if the Discrete Calculations make sens or not

Returns
Error code
Parameters
[in]modeLithotype mode (ENUM_RULES)
[in]flag_rho1 if rho has to be calculated, 0 otherwise

◆ st_ci0()

static double gstlrn::st_ci0 ( LMlayers lmlayers,
Model model,
Id  ilayer,
const 1 &  prop1,
Id  jlayer,
const double *  dd,
MatrixSquare covtab 
)
static

Calculate the covariance between data and target

Returns
The covariance terms or TEST
Parameters
[in]lmlayersLMlayers structure
[in]modelModel
[in]ilayerLayer of interest (data point). Starting from 1
[in]prop1Working array at data point (Dimension: nlayers)
[in]jlayerLayer of interest (target point). Starting from 1
[in]ddDistance vector (or NULL for zero-distance)
[out]covtabWorking array (Dimension = nlayers * nlayers)
Remarks
: As this function may return TEST, TEST value should be tested

◆ st_cij()

static double gstlrn::st_cij ( LMlayers lmlayers,
Model model,
Id  ilayer,
const 1 &  prop1,
Id  jlayer,
const 1 &  prop2,
const double *  dd,
MatrixSquare covtab 
)
static

Calculate the covariance between data and data

Returns
The covariance terms or TEST
Parameters
[in]lmlayersPointer to the LMlayers structure to be freed
[in]modelModel
[in]ilayerLayer of interest (first point). Starting from 1
[in]prop1Working array at first point (Dimension: nlayers)
[in]jlayerLayer of interest (second point). Starting from 1
[in]prop2Working array at second point (Dimension: nlayers)
[in]ddDistance vector (or NULL for zero-distance)
[out]covtabWorking array (Dimension = nlayers * nlayers)
Remarks
: As this function may return TEST, TEST value should be tested

◆ st_code_comparable()

static Id gstlrn::st_code_comparable ( const Db db1,
const Db db2,
Id  iech,
Id  jech,
Id  opt_code,
Id  tolcode 
)
static

Check if a pair must be kept according to code criterion

Returns
1 if the codes are not comparable
Parameters
[in]db1First Db structure
[in]db2Second Db structure
[in]iechRank of the first sample
[in]jechRank of the second sample
[in]opt_codecode selection option
  • 0 : no use of the code selection
  • 1 : codes must be close enough
  • 2 : codes must be different
[in]tolcodeCode tolerance
Remarks
When used in variogram calculation, pairs are discarded then the
resulting value is 1.

◆ st_collocated_prepare()

static Id gstlrn::st_collocated_prepare ( LMlayers lmlayers,
Id  iechout,
double *  coor,
Db dbin,
DbGrid dbout,
Model model,
1 &  seltab,
double *  a,
1 &  zval,
1 &  prop1,
1 &  prop2,
MatrixSquare covtab,
double *  b2,
1 &  baux,
double *  ratio 
)
static

Perform the per-calculation for estimation with collocated option

Parameters
[in]lmlayersLMlayers structure
[in]iechoutRank of the target
[in]coorCoordinates of the target
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModel
[in]seltabNumber of sample definition (0, 1 or 2)
[in]aL.H.S. (square) inverted matrix
[in]zvalData vector (extended)
[out]prop1Working array (Dimension: nlayers)
[out]prop2Working array (Dimension: nlayers)
[out]covtabWorking array (Dimension = nlayers * nlayers)
[out]b2Working vector (Dimension = neq)
[out]bauxWorking vector (Dimension = neq)
[out]ratioRatio value

◆ st_combinations()

static void gstlrn::st_combinations ( Id v,
Id  start,
Id  n,
Id  k,
Id  maxk,
Id ncomb,
1 &  comb 
)
static

Return all the combinations of k within n (local recursive routine)

Parameters
[in]vArray of indices to be sorted
[in]startRank of the starting index
[in]nTotal number of objects (>= 1)
[in]kStarting sorting index
[in]maxkSelected number of objects (>= 1)
[in,out]ncombCurrent number of combinations
[in,out]combCurrent array of combinations

◆ st_complete_squeeze_and_stretch()

static Id gstlrn::st_complete_squeeze_and_stretch ( Id  ntab,
1 &  tab 
)
static

Complete the information in the Squeeze and Stretch feature

Returns
1 if the vector only contains TEST values
Parameters
[in]ntabDimension of the vector
[in,out]tabVector

◆ st_compute_params()

static gstlrn::st_compute_params ( Local_CorPgs *  corpgs,
1 &  params_in 
)
static

Establish the total vector C1(h), C12(h), C21(h), C2(h)

Parameters
[in]corpgsLocal_CorPgs structure
[in]params_inParameters (Dimension corpgs.npar)
Returns
params Parameters (Dimension = 4)

◆ st_constraints_init()

static void gstlrn::st_constraints_init ( 1 &  ind_util,
1 &  ai 
)
static

Initialize the constraints

Parameters
[in]ind_utilList of retained constraint indices
[in]aiAI matrix

◆ st_convert()

static void gstlrn::st_convert ( double  hspill)
static

Converts the final image into the following codes: SURFACE_INSIDE, SURFACE_OUTSIDE, SURFACE_BELOW or SURFACE_UNKNOWN

Parameters
[in]hspillspill elevation

◆ st_convert_results()

static void gstlrn::st_convert_results ( LMlayers lmlayers,
Db dbout,
Id  flag_std 
)
static

Convert the results in the Depth scale

Parameters
[in]lmlayersLMlayers structure
[in]dboutOutput Db structure
[in]flag_std1 if the estimation error must be calculated
Remarks
The conversion is performed:
- if the calculations have been performed in Velocity or Thickness
- if the calculations have been performed in cumulative or not
The standard deviation is also transformed

◆ st_convertGeodeticAngle()

static double gstlrn::st_convertGeodeticAngle ( double  ,
double  cosa,
double  sinb,
double  cosb,
double  sinc,
double  cosc 
)
static

Extract A from a,b,c

Parameters
[in]cosaCosine of first angle
[in]sinbSine of second angle
[in]cosbCosine of second angle
[in]sincSine of third angle
[in]coscCosine of third angle

◆ st_copy()

static void gstlrn::st_copy ( Id  mode,
DbGrid db,
Id  iatt,
Id  ival,
double *  tab 
)
static

Copy a trace between the Db and a given array

Parameters
[in]modeType of operation
  • 0 : Copy from Db into array
  • 1 : Copy from array into Db
[in]dbDb structure
[in]iattRank of the variable
[in]ivalRank of the column
[in]tabArray containing the column of values

◆ st_copy_attribute()

static void gstlrn::st_copy_attribute ( Db db,
Id  nbsimu,
Id iatt 
)
static

Copy the main attributes in the simulations

Parameters
[in]dbGrid Db structure
[in]nbsimuNumber of simulations
[in]iattAddress of the first item for each variable

◆ st_copy_center()

static void gstlrn::st_copy_center ( Id  mode,
Id  iatt,
SPIMG image,
double  defval 
)
static

Loads the center of the image from an input array

Parameters
[in]modeType of information
  • 0 : for the height variable
  • 1 : for the data variable
[in]iattRank of the attribute
[in]defvalDefault value
[in,out]imageSPIMG structure to be initialized

◆ st_copy_swhh()

static Id gstlrn::st_copy_swhh ( const Vario vario1,
Vario vario2,
bool  flagSw,
bool  flagHh,
bool  flagGg 
)
static

Duplicate the information from the input variogram to the output variogram This operation considers (Sw, Hh, Gg) and replicates this information for all directions. Per direction, the information of the first simple input variogram is replicated to all simple and cross-variograms outputs

Returns
Error return code
Parameters
[in]vario1Input Variogram
[out]vario2Output Variogram
[in]flagSwTrue if Sw must be replicated
[in]flagHhTrue if Hh must be replicated
[in]flagGgTrue if Gg must be replicated

◆ st_core()

static gstlrn::st_core ( Id  nli,
Id  nco 
)
static

Management of internal array (double)

Returns
Pointer to the newly allocated array
Parameters
[in]nliNumber of lines
[in]ncoNumber of columns

◆ st_cov_exp()

static double gstlrn::st_cov_exp ( Id  dist,
const double *  cov,
Id  cov_radius,
Id  flag_sym 
)
static

Calculate the discretized covariance

Parameters
[in]distInteger distance
[in]covArray of discretized covariances
[in]cov_radiusRadius of the covariance array
[in]flag_sym1 for symmetrized covariance

◆ st_covariance_c00()

static void gstlrn::st_covariance_c00 ( LMlayers lmlayers,
Model model,
const 1 &  prop1,
MatrixSquare covtab,
double *  c00 
)
static

Calculate the array of covariances for zero distance

Parameters
[in]lmlayersPointer to the LMlayers structure to be freed
[in]modelModel
[in]prop1Working array at first point (Dimension: nlayers)
[out]covtabWorking array (Dimension = nlayers * nlayers)
[out]c00Returned array (Dimension = nlayers)
Remarks
: This array depends on the target location through proportions

◆ st_covsrt()

static void gstlrn::st_covsrt ( Id n,
double *  lower,
double *  upper,
double *  correl,
Id infin,
double *  y,
Id infis,
double *  a,
double *  b,
double *  cov,
Id infi 
)
static

Subroutine to sort integration limits and determine Cholesky factor

◆ st_crit_global()

Id gstlrn::st_crit_global ( Db db,
Model model,
1 &  ranks1,
1 &  rother,
double *  crit 
)

Evaluate the improvement in adding a new pivot on the global score

Returns
Error retun code
Parameters
[in]dbDb structure
[in]modelModel structure
[in]ranks1Ranks of exact pivots
[in]rotherRanks of the idle samples
[out]critArray of criterion

◆ st_d2_dkldij()

static double gstlrn::st_d2_dkldij ( 1 &  lower,
1 &  upper,
MatrixSymmetric correl 
)
static

Calculate the gradients for a pair of facies and return it

Returns
Calculate d²S/dC12dC21 and d²S/dC1dC2
Parameters
[in]lowerArray of lower bounds (Dimension = 4)
[in]upperArray of upper bounds (Dimension = 4)
[in]correlCorrelation matrix (Dimension = 4*4)

◆ st_d2_dkldkj()

static double gstlrn::st_d2_dkldkj ( Id  index1,
Id  index2,
1 &  lower,
1 &  upper,
MatrixSymmetric correl 
)
static
Returns
Calculate the first-order derivatives
Parameters
[in]index1First derivative index
[in]index2Second derivative index
[in]lowerArray of lower bounds (Dimension = 4)
[in]upperArray of upper bounds (Dimension = 4)
[in]correlCorrelation matrix (Dimension = 4*4)

◆ st_d2_dkldkl()

static double gstlrn::st_d2_dkldkl ( Id  maxpts,
Id  index1,
Id  index2,
1 &  lower,
1 &  upper,
MatrixSymmetric correl 
)
static
Returns
Calculate second-order derivatives
Parameters
[in]maxptsMaximum number of evaluations in mvndst
[in]index1First derivative index
[in]index2Second derivative index
[in]lowerArray of lower bounds (Dimension = 4)
[in]upperArray of upper bounds (Dimension = 4)
[in]correlCorrelation matrix (Dimension = 4*4)

◆ st_data_discretize_alloc()

static void gstlrn::st_data_discretize_alloc ( Id  ndim)
static

Allocate the Data discretization

Parameters
[in]ndimSpace dimension

◆ st_data_vector()

static void gstlrn::st_data_vector ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
1 &  seltab,
1 &  zval 
)
static

Establish the vector of data

Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]seltabNumber of sample definition (0, 1 or 2)
[out]zvalThe data vector (Dimension: neq)

◆ st_declustering_1()

static Id gstlrn::st_declustering_1 ( Db db,
Id  iptr,
const 1 &  radius 
)
static

Perform the Declustering task (Number of samples within an ellipse)

Returns
Error return code
Parameters
[in]dbinput Db structure
[in]iptrRank of the declustering weight
[in]radiusArray of neighborhood radius

◆ st_declustering_2()

static Id gstlrn::st_declustering_2 ( Db db,
Model model,
ANeigh neigh,
Id  iptr 
)
static

Perform the Declustering task as weight of the Mean Kriging (Unique Neigh)

Returns
Error return code
Parameters
[in]dbinput Db structure
[in]modelModel structure
[in]neighANeigh structure (should be Unique)
[in]iptrRank of the declustering weight

◆ st_declustering_3()

static Id gstlrn::st_declustering_3 ( Db db,
Db dbgrid,
Model model,
ANeigh neigh,
const 1 &  ndiscs,
Id  iptr 
)
static

Perform the Declustering task as the sum of the weight for Kriging the Cells of a grid

Returns
Error return code
Parameters
[in]dbinput Db structure
[in]dbgridoutput Db structure
[in]modelModel structure
[in]neighANeigh structure
[in]ndiscsArray of discretization counts
[in]iptrRank of the declustering weight

◆ st_declustering_stats()

static void gstlrn::st_declustering_stats ( Id  mode,
Id  method,
Db db,
Id  iptr 
)
static

Display the statistics of the target variable before or after the Declustering

Parameters
[in]mode0 before the declustering; 1 after
[in]methodMethod for declustering
[in]dbinput Db structure
[in]iptrRank of the weighting variable

◆ st_declustering_truncate_and_rescale()

static void gstlrn::st_declustering_truncate_and_rescale ( Db db,
Id  iptr 
)
static

Truncate the negative weights and scale the remaining ones

Parameters
[in]dbDb structure
[in]iptrRank of the Weight variable

◆ st_define_bounds() [1/2]

static void gstlrn::st_define_bounds ( 1 &  param,
1 &  lower,
1 &  upper,
1 &  scale,
double  delta,
MatrixDense bords 
)
static

Evaluate the bounds and check if one constraint is on its boudn

Parameters
[in]paramCurrent values of the parameters
[in]lowerArray of lower values
[in]upperArray of upper values
[in]scaleArray of scaling values
[in]deltaRadius of the trusting area
[out]bordsValue for the bounds

◆ st_define_bounds() [2/2]

static void gstlrn::st_define_bounds ( Local_Pgs *  local_pgs,
Id  iech1,
Id  iech2,
Id  ifac1,
Id  ifac2,
double *  low,
double *  up,
double *  ploc 
)
static

Define the thresholds of the GRF(s)

Parameters
[in]local_pgsLocal_Pgs structure
[in]iech1Rank of the first sample
[in]iech2Rank of the second sample
[in]ifac1Rank of the first facies
[in]ifac2Rank of the second facies
[out]lowArray of lower thresholds (Dimension: 4)
[out]upArray of upper thresholds (Dimension: 4)
[out]plocArray of proportions (Dimension: 2)

REMARKS: Warning: in the case of TEST_DISCRET, the returned arguments REMARKS: 'low' and 'up' return the ranks in the discretized covariance

◆ st_define_constraints()

static Id gstlrn::st_define_constraints ( Id  mode,
MatrixDense bords_red,
1 &  ai_red,
1 &  hgnc,
MatrixDense consts,
1 &  flag,
1 &  temp 
)
static

Calculate the number of constraints

Parameters
[in]modeType of constraints
  • -1 : the constraints which are non positive
  • 0 : the constraints must be zero
  • 1 : the constraints must be zero (cumul)
[in]bords_redReduced array containing the bounds
[in]ai_redReduced AI matrix
[in]hgncResulting hgnc array
[out]constsArray of constraints
[out]flagArray of indices with zero valid constraint
[out]tempWorking array

◆ st_define_corpgs()

static void gstlrn::st_define_corpgs ( Id  option,
Id  flag_rho,
double  rho,
Local_Pgs *  local_pgs 
)
static

Define the correlation option

Parameters
[in]optionCorrelation option
  • 0 : full parameters (C1, C12, C21, C2)
  • 1 : symmetrical case (C12 = C21)
  • 2 : residual case
[in]flag_rho1 if rho has to be calculated, 0 otherwise
[in]rhoCorrelation between GRFs
[in,out]local_pgsLocal_Pgs structure

◆ st_define_fipos()

static Id gstlrn::st_define_fipos ( Id  oper,
Id  side 
)
static

◆ st_define_trace()

static void gstlrn::st_define_trace ( Id  flag_rho,
Id  flag_correl,
Local_Pgs *  local_pgs 
)
static

Define the trace

Parameters
[in]flag_rho1 if rho has to be calculated, 0 otherwise
[in]flag_correl1 for the correlated case; 0 otherwise
[in,out]local_pgsLocal_Pgs structure

◆ st_deriv_eigen()

static void gstlrn::st_deriv_eigen ( Local_CorPgs *  corpgs,
double  eigval,
const MatrixSquare ev,
1 &  d1,
MatrixSymmetric d2 
)
static

Compute the derivatives (first and second) of the smallest eigenvalue

Parameters
[in]corpgsLocal_CorPgs structure
[in]eigvalCurrent eigen value
[out]evOutput array
[out]d1First order derivative
[out]d2Second order derivative

◆ st_determine_gauss()

static void gstlrn::st_determine_gauss ( MatrixDense Jr,
MatrixSquare gauss 
)
static

Calculate the Gauss matrix

Parameters
[in]JrArray of gradients
[out]gaussGaussian matrix

◆ st_discard_point()

static Id gstlrn::st_discard_point ( Local_Pgs *  local_pgs,
Id  iech 
)
static

Discard a data if:

  • its facies is unknown
  • its thresholds are so close that it leads to a zero probability
Returns
Error return code
Parameters
[in]local_pgsLocal_Pgs structure
[in]iechRank of the sample

◆ st_distance()

static double gstlrn::st_distance ( Id  nvar,
const 1 &  data1,
const 1 &  data2,
Id  index1,
Id  index2 
)
static

Calculate the distance between two samples

Parameters
[in]nvarNumber of variables
[in]data1Array of values for first part
[in]data2Array of values for second part
[in]index1Rank of the first sample
[in]index2Rank of the second sample

◆ st_distance_modify()

static double gstlrn::st_distance_modify ( DbGrid dbgrid,
Id  ig,
Db dbpoint,
Id  ip,
1 &  dvect,
Id  flag_aniso,
Id  iatt_time,
Id  iatt_angle,
Id  iatt_scaleu,
Id  iatt_scalev,
Id  iatt_scalew 
)
static

◆ st_divide_by_2()

static Id gstlrn::st_divide_by_2 ( Id nxyz,
Id  orient 
)
static

Divide by 2 in integer (upper rounded value)

Returns
1 if the input value is larger than 2; 0 otherwise
Parameters
[in]nxyzDimensions of the subgrid
[in]orientRank of the target direction

◆ st_dkbvrc()

static void gstlrn::st_dkbvrc ( Id ndim,
Id minvls,
const Id maxvls,
double(*)(Id *, double *)  functn,
const double *  abseps,
const double *  releps,
double *  abserr,
double *  finest,
Id inform 
)
static

Automatic Multidimensional Integration Subroutine AUTHOR: Alan Genz Department of Mathematics Washington State University Pulman, WA 99164-3113 Email: AlanG.nosp@m.enz@.nosp@m.wsu.e.nosp@m.du Last Change: 5/15/98 KRBVRC computes an approximation to the integral 1 1 1 I I ... I F(X) dx(NDIM)...dx(2)dx(1) 0 0 0 DKBVRC uses randomized Korobov rules for the first 20 variables. The primary references are "Randomization of Number Theoretic Methods for Multiple Integration"

  • R. Cranley and T.N.L. Patterson, SIAM J Numer Anal, 13, pp. 904-14,
  • and "Optimal Parameters for Multidimensional Integration", P. Keast, SIAM J Numer Anal, 10, pp.831-838. If there are more than 20 variables, the remaining variables are integrated using Richtmeyer rules. A reference is "Methods of Numerical Integration", P.J. Davis and P. Rabinowitz, Academic Press, 1984, pp. 482-483.
Parameters
[in]ndimNumber of variables, must exceed 1, but not exceed 40 Integer minimum number of function evaluations allowed.
[in,out]minvlsmust not exceed MAXVLS. If MINVLS < 0 then the routine assumes a previous call has been made with the same integrand and continues that calculation. Actual number of function evaluations used.
[in]maxvlsInteger maximum number of function evaluations allowed.
[in]functnEXTERNALLY declared user defined function to be integrated. It must have parameters (NDIM,Z), where Z is a real array of dimension NDIM.
[in]absepsRequired absolute accuracy. Estimated absolute accuracy of FINEST.
[in]relepsRequired relative accuracy.
[out]abserrAbsolute returned accuracy
[out]finestEstimated value of integral.
[out]inform= 0 for normal status, when ABSERR <= MAX(ABSEPS, RELEPS*ABS(FINEST)) and INTVLS <= MAXCLS. = 1 If MAXVLS was too small to obtain the required accuracy. In this case a value FINEST is returned with estimated absolute accuracy ABSERR.

◆ st_dkrcht()

static void gstlrn::st_dkrcht ( const Id s,
double *  quasi 
)
static

This subroutine generates a new quasi-random Richtmeyer vector. A reference is "Methods of Numerical Integration", P.J. Davis and P. Rabinowitz, Academic Press, 1984, pp. 482-483.

Parameters
[in]sthe number of dimensions
[out]quasia new quasi-random S-vector

◆ st_dksmrc()

static void gstlrn::st_dksmrc ( Id ndim,
const Id klim,
double *  sumkro,
const Id prime,
double *  vk,
double(*)(Id *, double *)  functn,
double *  x 
)
static

st_dksmrc

◆ st_dkswap()

static void gstlrn::st_dkswap ( double *  x,
double *  y 
)
static

st_dkswap

◆ st_drift()

static Id gstlrn::st_drift ( LMlayers lmlayers,
const double *  coor,
double  propval,
double  drext,
Id ipos_loc,
1 &  b 
)
static

Calculate the drift terms

Returns
Error return code
Parameters
[in]lmlayersPointer to the LMlayers structure to be freed
[in]coorArray of coordinates
[in]propvalValue for the proportion (used if flag_cumul=TRUE)
[in]drextValue of the external drift
[in,out]ipos_locAddress for the first drift term. On output, address for the next term after the drift
[out]bArray for storing the drift

◆ st_drift_bayes()

static Id gstlrn::st_drift_bayes ( LMlayers lmlayers,
Id  verbose,
double *  prior_mean,
const double *  prior_vars,
double *  acov,
1 &  zval,
1 &  fftab,
double *  a0,
double *  cc,
double *  ss,
double *  gs,
double *  post_mean,
double *  post_S 
)
static

Calculate the posterior mean and variances in Bayesian case

Returns
Error return code
Remarks
At the end of this function,
invS contains the inverse of prior_S
post_S contains the inverse of post_S

◆ st_drift_data()

static Id gstlrn::st_drift_data ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
1 &  seltab,
1 &  prop1,
1 &  fftab 
)
static

Fill the array of drift values at data points

Returns
1 Error return code
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]seltabNumber of sample definition (0, 1 or 2)
[in]prop1Working array (Dimension: nlayers)
[out]fftabDrift array (Dimension: npar[nrow] * nech[ncol])

◆ st_drift_prepar()

static Id gstlrn::st_drift_prepar ( Id  np,
Id  nbfl,
const double *  covpp,
const double *  drftab,
1 &  ymat,
1 &  zmat 
)
static

Calculate auxiliary arrays when drift is preset

Returns
Error return code
Parameters
[in]npNumber of data
[in]nbflNumber of drift functions
[in]covppInverse Covariance between Data-Data
[in]drftabDrift matrix at Data
[out]ymatArray: t(F) %*% C^-1
[out]zmatArray: (t(F) %*% C^-1 %*% F)^-1
Remarks
The returned arrays 'yloc' and 'zloc' must be freed by the
calling function

◆ st_drift_update()

static void gstlrn::st_drift_update ( Id  np,
Id  nbfl,
const double *  covgp,
const double *  driftg,
const double *  ymat,
double *  zmat,
double *  maux,
double *  lambda,
double *  mu 
)
static

Update the weight vector

Parameters
[in]npNumber of data
[in]nbflNumber of drift functions
[in]covgpCovariance matrix between Data and Target
[in]driftgDrift matrix at Target
[in]ymatAuxiliary array
[in]zmatAuxiliary array
[in]mauxAuxiliary array (Dimension: nbfl)
[out]lambdaVector of weights
[out]muVector of Lagrange parameters

◆ st_dump()

static void gstlrn::st_dump ( bool  flagMain,
const String title,
double *  pt_out,
SPIMG image 
)
static

Prints the current output flag array

Parameters
[in]flagMainTRUE if it is called from a main level
[in]titleTitle for the dump (main level)
[in]pt_outDesignation of the target node in 'out' (if provided)
[in]imageImage containing the information to be displayed

◆ st_essai()

static double gstlrn::st_essai ( 1 &  hgnadm,
1 &  grad_red,
MatrixSquare gauss_red 
)
static

Score of the Minimization under constraints

Parameters
[in]hgnadmAdmissible vector
[in]grad_redReduced Gradient matrix
[in]gauss_redReduced Gauss matrix

◆ st_establish_minimization()

static Id gstlrn::st_establish_minimization ( Id  nactive,
1 &  ind_util,
1 &  flag_active,
MatrixDense bords_red,
1 &  ai_red,
1 &  grad_red,
MatrixSquare gauss_red,
Id lambda_neg,
1 &  hgnc,
MatrixSquare a,
1 &  b,
1 &  temp 
)
static

Minimization under constraints

Returns
Error returned code
Parameters
[in]nactiveNumber of active constraints
[in]ind_utilList of retained constraint indices
[in]flag_activeArray of indices with zero valid constraint
[in]bords_redReduced array containing the bounds
[in]ai_redReduced AI matrix
[in]grad_redReduced Gradient matrix
[in]gauss_redReduced Gauss matrix
[out]lambda_negIndex of the first negative lambda value
[out]hgncResulting Hgnc array
[out]aMinimization L.H.S. matrix
[out]bMinimization R.H.S. matrix
[out]tempWorking array

◆ st_estim_exp()

static double gstlrn::st_estim_exp ( Db db,
const double *  wgt,
Id  nbefore,
Id  nafter 
)
static

Perform the estimation for the Factorial Kriging Analysis in the case of the discretized covariances

Parameters
[in]dbDb structure
[in]wgtArray containing the kriging weights
[in]nbeforeNumber of samples in neighborhood before target
[in]nafterNumber of samples in neighborhood after target

◆ st_estim_exp_3D()

static double gstlrn::st_estim_exp_3D ( Db db,
const Id  nei_ss[3],
const Id  nei_nn[3],
Id nei_cur,
const double *  weight 
)
static

Evaluate the Factorial Kriging estimate

Returns
The estimation result
Parameters
[in]dbinput Db structure
[in]nei_ssArray of dimensions of the Neighborhood
[in]nei_nnArray of radius of the Neighborhood
[in]nei_curArray containing the current neighborhood
[in]weightArray of Kriging weights

◆ st_estimate()

static void gstlrn::st_estimate ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
Model model,
1 &  seltab,
Id  flag_bayes,
Id  flag_std,
double *  a,
1 &  zval,
double *  dual,
1 &  prop1,
1 &  prop2,
MatrixSquare covtab,
1 &  b,
double *  b2,
1 &  baux,
double *  wgt,
double *  c00,
1 &  ,
double *  a0,
double *  cc,
double *  ss,
double *  gs,
double *  ,
double *  post_mean 
)
static

Perform the estimation at the grid nodes

Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModel
[in]seltabNumber of sample definition (0, 1 or 2)
[in]flag_bayes1 if the Bayesian hypothesis is used on drift coeffs
[in]flag_std1 if the estimation error must be calculated
[in]aL.H.S. (square) inverted matrix
[in]zvalData vector (extended)
[in]dualDual vector
[out]prop1Working array (Dimension: nlayers)
[out]prop2Working array (Dimension: nlayers)
[out]covtabWorking array (Dimension = nlayers * nlayers)
[out]bWorking vector (Dimension = neq)
[out]b2Working vector (Dimension = neq)
[out]bauxWorking vector (Dimension = neq)
[out]wgtWorking array (Dimension = neq)
[out]c00Working array (Dimension = nlayers)
[out]a0Constant term
[out]ccOutput value
[out]ssOutput value
[out]gsOutput value
[out]post_meanArray of posterior mean

◆ st_estimate_bayes()

static void gstlrn::st_estimate_bayes ( LMlayers lmlayers,
Id  flag_std,
double  c00,
const double *  acov,
1 &  zval,
1 &  b,
double *  wgt,
double *  post_mean,
double *  a0,
double *  cc,
double *  ss,
const double *  gs,
double *  estim,
double *  stdev 
)
static

Perform the estimation at the grid nodes in the bayesian case

Parameters
[in]lmlayersLMlayers structure
[in]flag_std1 if the estimation error must be calculated
[in]c00Variance at target
[in]acovL.H.S. (square) inverted matrix
[in]zvalData vector
[in]bWorking vector (Dimension = neq)
[in]wgtWorking array (Dimension = neq)
[out]post_meanArray of posterior mean
[out]a0Constant term
[out]ccOutput value
[out]ssOutput value
[out]gsOutput value
[out]estimEstimated value
[out]stdevStandard deviation of estimation error

◆ st_estimate_c00()

static void gstlrn::st_estimate_c00 ( Model model,
double *  c00 
)
static

Establish the constant terms for the variance calculations

Parameters
[in]modelModel structure
[out]c00Array containing the C00 terms (Dimension: NVAR * NVAR)

◆ st_estimate_check_presence()

static void gstlrn::st_estimate_check_presence ( DbGrid db,
Id  ivar,
Id npres,
Id presence 
)
static

Check the presence of neighboring traces

Parameters
[in]dbGrid Db structure
[in]ivarRank of the variable of interest
[out]npresNumber of informed traces
[out]presenceArray giving the number of valid samples per trace

◆ st_estimate_flag()

static void gstlrn::st_estimate_flag ( ST_Seismic_Neigh ngh,
Id  nfeq,
Id flag,
Id nred 
)
static

Establish the Kriging flag

Parameters
[in]nghCurrent ST_Seismic_Neigh structure
[in]nfeqNumber of drift condition per variable
[out]flagArray containing the Kriging flag
[out]nredReduced number of equations

◆ st_estimate_lhs()

static void gstlrn::st_estimate_lhs ( ST_Seismic_Neigh ngh,
Model model,
Id  nfeq,
Id  nred,
Id flag,
double *  lhs 
)
static

Establish the Kriging L.H.S.

Parameters
[in]nghCurrent ST_Seismic_Neigh structure
[in]modelModel structure
[in]nfeqNumber of drift condition per variable
[in]nredReduced number of equations
[in]flagArray giving the flag
[out]lhsArray containing the Kriging L.H.S.

◆ st_estimate_neigh_copy()

static void gstlrn::st_estimate_neigh_copy ( ST_Seismic_Neigh ngh_cur,
ST_Seismic_Neigh ngh_old 
)
static

Copy the current neighborhood into the old one

Parameters
[in]ngh_curCurrent ST_Seismic_Neigh structure
[out]ngh_oldOld ST_Seismic_Neigh structure

◆ st_estimate_neigh_create()

static Id gstlrn::st_estimate_neigh_create ( DbGrid db,
Id  flag_exc,
Id  iatt_z1,
Id  iatt_z2,
Id  ix0,
Id  iz0,
Id  nbench,
Id  nv2max,
Id  [2],
1 &  presence,
ST_Seismic_Neigh ngh 
)
static

Establish the neighborhood

Returns
Error return code
Parameters
[in]dbGrid Db structure
[in]flag_exc1 if the target sample must be excluded
[in]iatt_z1Address of the first data attribute
[in]iatt_z2Address of the second data attribute
[in]ix0Rank of the target trace
[in]iz0Rank of the target sample within the target trace
[in]nbenchVertical Radius of the neighborhood (center excluded)
[in]nv2maxMaximum number of traces of second variable on each side of the target trace
[in]presenceArray giving the number of valid samples per trace
[out]nghCurrent ST_Seismic_Neigh structure

◆ st_estimate_neigh_init()

static void gstlrn::st_estimate_neigh_init ( ST_Seismic_Neigh ngh)
static

Initialize the ST_Seismic_Neigh structure

Parameters
[in]nghST_Seismic_Neigh structure to be freed (if mode<0)

◆ st_estimate_neigh_management()

static ST_Seismic_Neigh * gstlrn::st_estimate_neigh_management ( Id  mode,
Id  nvois,
ST_Seismic_Neigh ngh 
)
static

Manage the ST_Seismic_Neigh structure

Returns
Address of the newly managed ST_Seismic_Neigh structure
Parameters
[in]modeType of management
  • 1 for allocation
  • -1 for deallocation
[in]nvoisMaximum number of samples in the neighborhood
[in]nghST_Seismic_Neigh structure to be freed (if mode<0)

◆ st_estimate_neigh_print()

static void gstlrn::st_estimate_neigh_print ( ST_Seismic_Neigh ngh,
Id  ix0,
Id  iz0 
)
static

Print the Kriging Information

Parameters
[in]nghCurrent ST_Seismic_Neigh structure
[in]ix0Rank of the target trace
[in]iz0Rank of the target sample within the target trace

◆ st_estimate_neigh_unchanged()

static Id gstlrn::st_estimate_neigh_unchanged ( ST_Seismic_Neigh ngh_old,
ST_Seismic_Neigh ngh_cur 
)
static

Check if the neighborhood has changed

Returns
1 if the Neighborhood is unchanged
Parameters
[in]ngh_oldPrevious ST_Seismic_Neigh structure
[in]ngh_curCurrent ST_Seismic_Neigh structure

◆ st_estimate_regular()

static void gstlrn::st_estimate_regular ( LMlayers lmlayers,
Id  flag_std,
double  c00,
double *  a,
1 &  b,
double *  dual,
double *  wgt,
double *  estim,
double *  stdev 
)
static

Perform the estimation at the grid nodes in regular case

Parameters
[in]lmlayersLMlayers structure
[in]flag_std1 if the estimation error must be calculated
[in]c00Variance for target
[in]aL.H.S. (square) inverted matrix
[in]bWorking vector (Dimension = neq)
[in]dualDual vector
[in]wgtWorking array (Dimension = neq)
[out]estimEstimated value
[out]stdevStandard deviation of estimation error

◆ st_estimate_result()

static void gstlrn::st_estimate_result ( Db db,
ST_Seismic_Neigh ngh,
Id  flag_std,
Id  ,
Id  nred,
const Id flag,
const double *  wgt,
const double *  rhs,
const double *  var0,
Id iatt_est,
Id iatt_std 
)
static

Perform the Kriging

Parameters
[in]dbGrid Db structure
[in]nghCurrent ST_Seismic_Neigh structure
[in]flag_std1 for the calculation of the St. Dev.
[in]nredReduced number of equations
[in]flagArray giving the flag
[in]wgtArray containing the Kriging weights
[in]rhsArray containing the R.H.S. member
[in]var0Array containing the C00 terms
[in]iatt_estArray of pointers to the kriged result
[in]iatt_stdArray of pointers to the variance of estimation

◆ st_estimate_rhs()

static void gstlrn::st_estimate_rhs ( ST_Seismic_Neigh ngh,
Model model,
Id  nfeq,
Id  nred,
Id flag,
double *  rhs 
)
static

Establish the Kriging R.H.S.

Parameters
[in]nghCurrent ST_Seismic_Neigh structure
[in]modelModel structure
[in]nfeqNumber of drift condition per variable
[in]nredReduced number of equations
[in]flagArray giving the flag
[out]rhsArray containing the Kriging R.H.S.

◆ st_estimate_sort()

static Id gstlrn::st_estimate_sort ( const Id presence,
Id rank 
)
static

Order the traces to be processed

Returns
Error return code
Parameters
[in]presenceArray giving the number of valid samples per trace
[out]rankArray giving the order of the traces

◆ st_estimate_var0()

static void gstlrn::st_estimate_var0 ( Model model,
double *  var0 
)
static

Establish the constant terms for the variance calculations

Parameters
[in]modelModel structure
[out]var0Array containing the C00 terms (Dimension: NVAR)

◆ st_estimate_wgt()

static Id gstlrn::st_estimate_wgt ( ST_Seismic_Neigh ngh,
Model ,
Id  nred,
Id flag,
double *  lhs,
double *  rhs,
double *  wgt 
)
static

Establish the Kriging Weights

Returns
Error return code
Parameters
[in]nghCurrent ST_Seismic_Neigh structure
[in]nredReduced number of Kriging equations
[in]flagArray giving the flag
[in]lhsArray of Kriging L.H.S.
[in]rhsArray of Kriging R.H.S.
[out]wgtArray containing the Kriging Weights

◆ st_evaluate_lag()

static Id gstlrn::st_evaluate_lag ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
Vario_Order vorder,
Id  nlayers,
Id  ifirst,
Id  ilast,
1 &  zval,
Id nval,
double *  distsum,
Id stat,
1 &  phia,
1 &  phib,
double *  atab,
double *  btab 
)
static

Evaluate the sill matrix for a given lag

Returns
Error return code (proportions not calculatable)
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]vorderVario_Order structure
[in]nlayersNumber of layers
[in]ifirstIndex of the first pair (included)
[in]ilastIndex of the last pair (excluded)
[in]zvalArray containing the sample values
[out]nvalNumber of relevant pairs
[out]distsumAverage distance
[out]statWorking array (Dimension: nlayers * nlayers)
[out]phiaWorking array for proportions (Dimension: nlayers)
[out]phibWorking array for proportions (Dimension: nlayers)
[out]atabWorking array (Dimension: nhalf * nhalf)
[out]btabWorking array (Dimension: nhalf)

◆ st_exit()

static void gstlrn::st_exit ( void  )
static

Exit from the gstlearn library (not killing the encapsulation if any)

◆ st_expand()

static void gstlrn::st_expand ( Id  flag_size,
DbGrid dbgrid,
1 &  tab1,
1 &  indg0,
1 &  indg,
1 &  tab2 
)
static

Expand the joins at each cell in its vicinity, the radius is given per pixel in the array 'tab1'

Parameters
[in]flag_sizewhen 0, the norder pixels are painted with 1 when 1, the border pixels report the border thckness
[in]dbgridDescriptor of the grid parameters
[in]tab1Array containing expansion radius
[in]indg0Array used for encoding/decoding
[in]indgArray used for encoding/decoding
[in]tab2Returned array

◆ st_extract_center()

static void gstlrn::st_extract_center ( SPIMG image,
Id  iatt 
)
static

Extracts an output array from the the center of the image

Parameters
[in]imageSPIMG structure
[out]iattRank of the output attribute

◆ st_extract_subgrid()

static double gstlrn::st_extract_subgrid ( Id  verbose,
Id  flag_ffff,
Id  iech0,
Id  nech0,
Id  ntot,
DbGrid dbgrid,
Id ind0,
Id ixyz,
Id nxyz,
double *  numtab1,
double *  valtab1 
)
static

Load the subgrid from the Input Db

Returns
Return the total probability of finding joins
Parameters
[in]verboseVerbose flag
[in]flag_ffff1 replace masked values by 0 0 replace masked values by FFFF
[in]iech0Rank of the output grid cell
[in]nech0Number of cells of the output grid
[in]ntotDimension of arrays 'numtab1' and 'valtab1'
[in]dbgridDb for the input grid
[in]ind0Origin of the Output Db within the Input Db
[in]nxyzMesh of the Output Db (expressed in Input Db)
[in]ixyzIndices of the starting node of the Output Db
[out]numtab1Array containing the sample count
[out]valtab1Array containing the sample value
Remarks
The array ind0, ixyz and nxyz are dimensioned to ndim

◆ st_extract_trace()

static double gstlrn::st_extract_trace ( Local_Pgs *  local_pgs)
static

Extract the information of the Trace

Returns
The calculated score
Parameters
[in]local_pgsLocal_Pgs structure

◆ st_facies()

static Id gstlrn::st_facies ( PropDef propdef,
Id  ipgs,
Id  ifac 
)
static

Give the rank of a proportion for a given GRF and PGS

Returns
Returned rank
Parameters
[in]propdefPropDef structure
[in]ifacRank of the facies
[in]ipgsRank of the GS

◆ st_fill_constraints()

static void gstlrn::st_fill_constraints ( const MatrixDense acont,
1 &  grad,
MatrixSquare gauss 
)
static

Add ncont linear constraints (AX=B) to the linear system (of size npar) used for quadratic optimization

Parameters
[in]acontMatrix A
[out]gradleft hand-side of the system
[out]gaussmatrix of the system

◆ st_final_stats()

static void gstlrn::st_final_stats ( double  hspill,
Id  ix0,
Id  iy0 
)
static

◆ st_find_cell()

static Id gstlrn::st_find_cell ( Id  ntot,
const double *  tab,
double  proba 
)
static

Find the cell linked to the probability

Returns
Rank of the cell
Parameters
[in]ntotNumber of possibilities
[in]tabArray containing the sample value
[in]probaLocal probability

◆ st_find_interval()

static Id gstlrn::st_find_interval ( double  x,
Id  ndef,
const double *  X 
)
static

Find the interval (among vector X) to which the sample (x) belongs

Returns
Rank of the interval containing the target
Parameters
[in]xTarget coordinate
[in]ndefNumber of defined samples
[in]XVector of coordinate of valued samples
Remarks
If x < min(X) or x > max(X) the returned index is -1
Array X is assumed to be increasingly ordered

◆ st_fipos_decode()

static void gstlrn::st_fipos_decode ( Id  fipos,
1 &  fgrf 
)
static

◆ st_fipos_encode()

static Id gstlrn::st_fipos_encode ( 1 &  fgrf)
static

◆ st_fixed_position()

static Id gstlrn::st_fixed_position ( Id  ntot,
const double *  tab,
Id  cell 
)
static

Find the location of the cell (within the possible cells) which is the closest to the target cell provided as argument

Returns
Rank of the cell
Parameters
[in]ntotNumber of possibilities
[in]tabArray containing the sample value
[in]cellCell location

◆ st_foxleg_debug_current()

static void gstlrn::st_foxleg_debug_current ( double  mscur,
double  delta,
1 &  param 
)
static

Display the current status for FOXLEG trace

◆ st_foxleg_debug_title()

static void gstlrn::st_foxleg_debug_title ( void  )
static

Display the title for FOXLEG trace

◆ st_func_search_nostat()

static double gstlrn::st_func_search_nostat ( double  correl,
void *  user_data 
)
static

Local searching function

Returns
Evaluation value
Parameters
[in]correlCorrelation parameter
[in]user_dataUser Data

◆ st_func_search_stat()

static double gstlrn::st_func_search_stat ( double  correl,
void *  user_data 
)
static

Local searching function

Returns
Evaluation value
Parameters
[in]correlCorrelation parameter
[in]user_dataUser Data

◆ st_get_average()

static double gstlrn::st_get_average ( Id  nz,
const 1 &  writes 
)
static

Calculate the average

◆ st_get_close_sample()

static Id gstlrn::st_get_close_sample ( LMlayers lmlayers,
Db dbin,
Id  iech0,
const double *  coor 
)
static

Check if an intercept with the bottom layer is located close enough to the current sample

Returns
1 if a duplicate must be generated; 0 otherwise
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]iech0Rank of sample to be discarded (or -1)
[in]coorCoordinates of the target

◆ st_get_closest_sample()

void gstlrn::st_get_closest_sample ( DbGrid dbgrid,
Id  ig,
Db dbpoint,
Id  ip,
Id  flag_aniso,
Id  iatt_time,
Id  iatt_angle,
Id  iatt_scaleu,
Id  iatt_scalev,
Id  iatt_scalew,
Id ipmin,
double *  ddmin,
1 &  dvect 
)

Update minimum distance and rank of the corresponding sample

Parameters
[in]dbgridDescriptor of the grid parameters
[in]igRank of the sample in the Grid file
[in]dbpointDescriptor of the point parameters
[in]ipRank of the sample in the Point file
[in]flag_aniso1 if anisotropic distance must be calculated
[in]iatt_timeOptional variable for Time shift
[in]iatt_angleOptional variable for anisotropy angle (around Z)
[in]iatt_scaleuOptional variable for anisotropy scale factor (U)
[in]iatt_scalevOptional variable for anisotropy scale factor (V)
[in]iatt_scalewOptional variable for anisotropy scale factor (W)
[in,out]ipminRank of the Point sample
[in,out]ddminMinimum distance
[out]dvectWorking vector
Remarks
The Time Shift is an optional variable which increases the
distance (the time-to-distance conversion is assumed to be 1)
Only positive Time Shifts are considered

◆ st_get_coordinates()

static void gstlrn::st_get_coordinates ( const double *  pt_out,
Id ix,
Id iy,
SPIMG image = SPIMG_OUT,
bool  flag_center = false 
)
static

Returns the coordinates of a point, given its pointer in 'out'

Parameters
[in]pt_outAddress in the image
[in]imageIMAGE structure
[in]flag_centerWhen TRUE, coordinates are epressed in central image
[out]ixLocation of the spill point grid node along X
[out]iyLocation of the spill point grid node along Y

◆ st_get_count()

static Id gstlrn::st_get_count ( Local_Pgs *  local_pgs,
Id  ifac1,
Id  ifac2 
)
static

Count the number of pairs with the target facies

Parameters
[in]local_pgsLocal_Pgs structure
[in]ifac1First target facies (starting from 1)
[in]ifac2Second target facies (starting from 1)

◆ st_get_cuts()

static Id gstlrn::st_get_cuts ( Db surfaces,
Id  rank,
Id  iatt_top,
Id  iatt_bot,
double  ,
double  ,
double  thickmin,
double *  cztop,
double *  czbot 
)
static

Define the cutoffs along a vertical for a given trace

Returns
Error returned code
Parameters
[in]surfacesDb containing the top, Bottom and Reference surfaces This file is optional
[in]rankRank of the trace within 'surfaces'
[in]iatt_topRank of attribute containing the Top Surface (or 0)
[in]iatt_botArnk of the attribute containing the Bottom Surface (or 0)
[in]thickminMinimum thickness (if defined)
[out]cztopCoordinate for the Top along Z (or TEST)
[out]czbotCoordinate for the Bottom along Z (or TEST)

◆ st_get_diff_coeff()

static double gstlrn::st_get_diff_coeff ( Id  niter,
Id  verbose,
double  pmid,
Id  flag_save,
double *  cvdist2,
double *  cvsave 
)
static

Derive the diffusion factor from the serie of squared distance as a function of time

Returns
The diffusion coefficient
Parameters
[in]niterNumber of iterations
[in]verboseVerbose flag
[in]pmidPercentage of niter to store convergence
[in]flag_saveIf the array must be saved for keypair
[in]cvdist2Array containing the squared distances
[out]cvsaveArray containing the storage (Dimension: 3 * niter)

◆ st_get_distmatrix()

static void gstlrn::st_get_distmatrix ( const 1 &  data,
Id  nvar,
Id  nech,
1 &  distmatrix 
)
static

Evaluate the distance matrix

Parameters
[in]dataArray of values
[in]nvarNumber of samples
[in]nechNumber of variables
[out]distmatrixMatrix of distances

◆ st_get_drift_data()

static double gstlrn::st_get_drift_data ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
Id  iech,
Id  ilayer0 
)
static

Return the external drift value at an input location for a target layer

Returns
The external drift value of TEST
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]iechRank of the target sample (in output Db)
[in]ilayer0Rank of the target layer (Starting from 1)

◆ st_get_drift_result()

static double gstlrn::st_get_drift_result ( LMlayers lmlayers,
Db dbout,
Id  iech,
Id  ilayer0 
)
static

Return the external drift value at an output location for a target layer

Returns
The external drift value of TEST
Parameters
[in]lmlayersLMlayers structure
[in]dboutOutput Db structure
[in]iechRank of the target sample (in output Db)
[in]ilayer0Rank of the target layer (Starting from 1)

◆ st_get_idim()

static double gstlrn::st_get_idim ( Id  loc_rank,
Id  idim 
)
static

Returns the coordinate of the data (at rank if rank >= 0) or of the target (at IECH_OUT if rank < 0)

Parameters
[in]loc_rankRank of the sample
[in]idimRank of the coordinate

◆ st_get_ivar()

static double gstlrn::st_get_ivar ( Id  rank,
Id  ivar 
)
static

‍****************************************************************************‍/ *!

Returns the value of the variable (at rank if rank >= 0) or of the target (at IECH_OUT if rank < 0)

Parameters
[in]rankRank of the sample
[in]ivarRank of the variable
Remarks
In case of simulation, the variable of the first simulation
is systematically returned. This has no influence on the rest
of the calculations

◆ st_get_keypair_address()

static Keypair * gstlrn::st_get_keypair_address ( const char *  keyword)
static

Internal function to find the keypair stack address or to create a new one if not already existing

Returns
The address in the stack
Parameters
[in]keywordKeyword
Remarks
If the keypair is new, the arguments 'nrow', 'ncol' and 'origin'
are set to zero
Otherwise they are not updated

◆ st_get_limits()

static Id gstlrn::st_get_limits ( DbGrid db,
double  top,
double  bot,
Id ideb,
Id ifin 
)
static

Returns the limits of the area of interest

Returns
Error returned code
Parameters
[in]dbinput Db structure
[in]topElevation of the Top variable
[in]botElevation of the bottom variable
[out]idebIndex of the starting sample
[out]ifinIndex of the ending sample

◆ st_get_neigh()

static Id gstlrn::st_get_neigh ( Id  ideb,
Id  ifin,
Id  neigh_radius,
Id status,
Id nbefore,
Id nafter 
)
static

Definition of the neighborhood

Returns
Error return code: 1 if the target does not belong to the
area of interest
Parameters
[in]idebIndex of the starting sample
[in]ifinIndex of the ending sample
[in]neigh_radiusRadius of the Neighborhood
[out]statusNeighborhood error status
[out]nbeforeNumber of samples in neighborhood before target
[out]nafterNumber of samples in neighborhood after target

◆ st_get_nmax()

static Id gstlrn::st_get_nmax ( ANeigh neigh)
static

Returns the maximum number of points per neighborhood

Returns
Maximum number of points per neighborhood
Parameters
[in]neighANeigh structure

◆ st_get_number_drift()

static Id gstlrn::st_get_number_drift ( Id  irf_rank,
Id  flag_ext 
)
static

Returns the number of drift functions

Returns
Number of drift conditions
Parameters
[in]irf_rankRank of the Intrinsic Random Function (0 or 1)
[in]flag_ext1 if external drift must be used; 0 otherwise

◆ st_get_prior()

static Id gstlrn::st_get_prior ( Id  nech,
Id  npar,
1 &  zval,
1 &  fftab,
double *  mean,
double *  vars 
)
static

Determine the mean and variance of drift coefficients

Returns
Error return code
Parameters
[in]nechNumber of samples
[in]nparNumber of drift coefficients
[in]zvalThe data vector (Dimension: neq)
[in]fftabDrift array (Dimension: npar[nrow] * nech[ncol])
[out]meanArray of means
[out]varsArray of variances

◆ st_get_proba()

static double gstlrn::st_get_proba ( Local_Pgs *  local_pgs,
Id  flag_ind,
double *  low,
double *  up,
Id iconf,
double *  cov 
)
static

Calculate the probability

Returns
Evaluation value
Parameters
[in]local_pgsLocal_Pgs structure
[in]flag_ind1 if the GRFs are independent
[in]lowArray of lower thresholds (Dimension: 4)
[in]upArray of upper thresholds (Dimension: 4)
[in]iconfArray of ranks of the discretized covariance
[in]covCovariance matrix

◆ st_get_proba_ind()

static double gstlrn::st_get_proba_ind ( double  correl,
double *  low,
double *  up,
Id  iconf 
)
static

Calculate the probability for two independent GRFs

Returns
Evaluation value
Parameters
[in]correlCorrelation between covariance
[in]lowArray of lower thresholds or lower indices (Dimension: 2)
[in]upArray of upper thresholds or upper indices (Dimension: 2)
[in]iconfRank for the discrete calculation

◆ st_get_props_data()

static Id gstlrn::st_get_props_data ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
Id  iech,
Id  ilayer0,
1 &  props 
)
static

Fill the proportion vector at a data location, up to the target layer

Returns
1 if the proportion vector cannot be defined; 0 otherwise
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]iechRank of the target sample
[in]ilayer0Rank of the target layer (starting from 1)
[out]propsWorking array (Dimension: nlayers)

◆ st_get_props_result()

static Id gstlrn::st_get_props_result ( LMlayers lmlayers,
Db dbout,
Id  iech,
Id  ilayer0,
1 &  props 
)
static

Fill the proportion vector at a output location, up to the target layer

Returns
1 if the proportion vector cannot be defined; 0 otherwise
Parameters
[in]lmlayersLMlayers structure
[in]dboutOutput Db structure
[in]iechRank of the target sample (in output Db)
[in]ilayer0Rank of the target layer (starting from 1)
[out]propsWorking array (Dimension: nlayers)

◆ st_get_trace_params()

void gstlrn::st_get_trace_params ( traceHead Theader,
Id iline,
Id xline,
double *  delta,
double *  xtrace,
double *  ytrace 
)

Get Trace characteristics

◆ st_get_value()

static double gstlrn::st_get_value ( Local_Pgs *  local_pgs,
Id  flag_ind,
Id  iech1,
Id  iech2,
Id  ifac1,
Id  ifac2,
Id iconf,
double *  cov 
)
static

Calculate the variogram or covariance contribution

Returns
Evaluation value
Parameters
[in]local_pgsLocal_Pgs structure
[in]flag_ind1 if the GRFs are independent
[in]iech1Rank of the first sample
[in]iech2Rank of the second sample
[in]ifac1Rank of the first facies
[in]ifac2Rank of the second facies
[in]iconfArray of ranks of the discretized covariance
[in]covCovariance matrix

◆ st_get_verr()

static double gstlrn::st_get_verr ( Id  rank,
Id  ivar 
)
static

Returns the value of the measurement error (at rank if rank >= 0) or of the target (at IECH_OUT if rank < 0)

Parameters
[in]rankRank of the sample
[in]ivarRank of the variable

◆ st_getclustermeans()

static void gstlrn::st_getclustermeans ( const 1 &  data,
Id  nvar,
Id  nech,
Id  nclusters,
const 1 &  clusterid,
1 &  cdata,
1 &  cmask 
)
static

Find the center of a cluster

Parameters
[in]nclustersNumber if clusters
[in]nvarNumber of samples
[in]nechNumber of variables
[in]dataArray of values
[in]clusteridArray of cluster number for each sample
[out]cdataArray containing the centroids
[out]cmaskArray containing the number of sample per cluster

◆ st_getclustermedian()

static void gstlrn::st_getclustermedian ( const 1 &  data,
Id  nvar,
Id  nech,
Id  nclusters,
const 1 &  clusterid,
1 &  cdata,
1 &  cache 
)
static

Find the median of a cluster

Parameters
[in]nclustersNumber if clusters
[in]nvarNumber of samples
[in]nechNumber of variables
[in]dataArray of values
[in]clusteridArray of cluster number for each sample
[out]cdataArray containing the centroids
[out]cacheArray for storing data of a cluster

◆ st_getclustermedoids()

static void gstlrn::st_getclustermedoids ( Id  nech,
Id  nclusters,
const 1 &  distmatrix,
const 1 &  clusterid,
1 &  centroids,
1 &  errors 
)
static

Find the center of a cluster

Parameters
[in]distmatrixMatrix of distances
[in]nechNumber of variables
[in]nclustersNumber if clusters
[in]clusteridArray of cluster number for each sample
[out]centroidsArray of centroids
[out]errorsArray containing within-cluster distances

◆ st_getDATE()

static double gstlrn::st_getDATE ( const DbGrid dbgrid,
Id  indDate,
Id  iech 
)
static

◆ st_getFACIES()

static Id gstlrn::st_getFACIES ( const DbGrid dbgrid,
Id  nfacies,
Id  indFacies,
Id  iech 
)
static

◆ st_getFLUID()

static Id gstlrn::st_getFLUID ( const DbGrid dbgrid,
Id  nfluids,
Id  indFluid,
Id  iech 
)
static

◆ st_getPORO()

static double gstlrn::st_getPORO ( const DbGrid dbgrid,
Id  indPoro,
Id  iech 
)
static

◆ st_getTimeInterval()

static Id gstlrn::st_getTimeInterval ( double  date,
Id  ntime,
double  time0,
double  dtime 
)
static

Check if the sample belongs to the time slice

Returns
Rank of the time slice (or -1)
Parameters
[in]dateDate attached to a sample
[in]ntimeNumber of time intervals
[in]time0Origin of the first time interval
[in]dtimeTime interval

◆ st_global_init()

static void gstlrn::st_global_init ( Db dbin,
Db dbout 
)
static

Initialize the static global variables

Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure

◆ st_gradient()

static void gstlrn::st_gradient ( 1 &  param,
1 &  lower,
1 &  upper,
1 &  scale,
1 &  tabwgt,
MatrixDense Jr,
1 &  param1,
1 &  param2,
1 &  tabmod1,
1 &  tabmod2 
)
static

Calculate the gradient

Parameters
[in]paramCurrent values of the parameters
[in]lowerArray of lower values
[in]upperArray of upper values
[in]scaleArray of scaling values
[in]tabwgtArray of weights
[out]JrArray of gradients
[out]param1Working array (Dimension: NPAR)
[out]param2Working array (Dimension: NPAR)
[out]tabmod1Working array (Dimension: NDAT)
[out]tabmod2Working array (Dimension: NDAT)

◆ st_grid1D_interpolate_linear()

static void gstlrn::st_grid1D_interpolate_linear ( Db dbgrid,
Id  ivar,
Id  ndef,
const double *  X,
const double *  Y 
)
static

Fill an incomplete 1-D grid by linear interpolation from a set of valued samples

Parameters
[in]dbgridDb grid structure
[in]ivarRank of the variable to be filled
[in]ndefNumber of defined samples
[in]XVector of coordinate of valued samples
[in]YVector of values of valued samples

◆ st_grid1D_interpolate_spline()

static Id gstlrn::st_grid1D_interpolate_spline ( Db dbgrid,
Id  ivar,
Id  ndef,
const double *  X,
const double *  Y 
)
static

Fill an incomplete 1-D grid by spline interpolation from a set of valued samples

Returns
Error returned code
Parameters
[in]dbgridDb grid structure
[in]ivarRank of the variable to be filled
[in]ndefNumber of defined samples
[in]XVector of coordinate of valued samples
[in]YVector of values of valued samples

◆ st_grid_fill_calculate()

static Id gstlrn::st_grid_fill_calculate ( Id  ipos,
Id  mode,
Id  nech,
Id tabind,
const double *  tabval 
)
static

Calculate the extrapolation

Returns
Error return code
Parameters
[in]iposAbsolute grid index of the input grid node
[in]modeType of interpolation
  • 0 : Moving average
  • 1 : Inverse squared distance
  • 2 : Interpolation by a linear plane
  • 3 : Distance to the initial grains
[in]nechNumber of samples in the neighborhood
[in]tabindIndex of the neighboring sample
[in]tabvalValue of the neighboring sample

◆ st_grid_fill_neigh()

static void gstlrn::st_grid_fill_neigh ( Id  ipos,
Id  ndim,
Id  radius,
Id nech_loc,
Id tabind,
double *  tabval 
)
static

Find the neighborhood of the current cell

Parameters
[in]iposAbsolute grid index of the input grid node
[in]ndimSpace dimension
[in]radiusRadius of the neighborhood
[out]nech_locNumber of samples in the neighborhood
[out]tabindIndex of the neighboring sample
[out]tabvalValue of the neighboring sample

◆ st_grid_from_2refpt()

static void gstlrn::st_grid_from_2refpt ( RefPt  refpt[3],
RefStats refstats,
double  dz,
Grid def_grid 
)
static

Derive grid information from the two Reference Points

Parameters
[in]refptArray of RefPt structure pointers
[in]refstatsStructure for Statistics
[in]dzVertical mesh
[out]def_gridGrid output structure

◆ st_grid_from_3refpt()

static void gstlrn::st_grid_from_3refpt ( RefPt  refpt[3],
RefStats refstats,
double  dz,
Grid def_grid 
)
static

Derive grid information from the three Reference Points

Parameters
[in]refptArray of RefPt structure pointers
[in]refstatsStructure for Statistics
[in]dzVertical mesh
[out]def_gridGrid output structure

◆ st_grid_to_sample()

static Id gstlrn::st_grid_to_sample ( Id  ndim,
const Id nxyz,
const Id indg 
)
static

Converts from grid indices into sample index

Returns
The absolute index
Parameters
[in]ndimSpace dimension
[in]nxyzDimensions of the subgrid
[in]indgGrid indices

◆ st_heap_add()

static void gstlrn::st_heap_add ( double *  p)
static

Add an element to the Heap Sort Pile

Parameters
[in]ppointer to the element to be added

◆ st_heap_del()

static double * gstlrn::st_heap_del ( void  )
static

Return the first element of the Heap Sort Pile and delete it

Returns
Pointer to the first element of the Heap Sort Pile

◆ st_htop_evaluate()

static double gstlrn::st_htop_evaluate ( )
static

Evaluates the highest elevation within the reservoir

◆ st_ibm2ieee()

static float gstlrn::st_ibm2ieee ( const float  ibm)
static

◆ st_identify_trace_rank()

static Id gstlrn::st_identify_trace_rank ( DbGrid surfaces,
double  xtrace,
double  ytrace 
)
static

Identify the rank of the trace within the 'Db'

Parameters
surfacesPointer to the 'Db' containing the surfaces
xtraceX-coordinate of the trace
ytraceY-coordinate of the trace
Returns
Remarks
The rank is returned as -1 if not defined

◆ st_ikl()

static double gstlrn::st_ikl ( Id  maxpts,
Id  index1,
Id  index2,
1 &  lower,
1 &  upper,
MatrixSymmetric correl 
)
static
Returns
Calculate
d/(d xk) * d/(d xl)
int_lower1^upper1
int_lower2^upper2
int_lower3^upper3
int_lower4^upper4
gaussian density(x1,x2,x3,x4,rho) dx1 dx2 dx3 dx4
Parameters
[in]maxptsMaximum number of evaluations in mvndst
[in]index1First derivative index
[in]index2Second derivative index
[in]lowerArray of lower bounds
[in]upperArray of upper bounds
[in]correlCorrelation matrix (Dimension = 4*4)

◆ st_image_alloc()

static SPIMG * gstlrn::st_image_alloc ( double  value)
static

Procedure to allocates a NEW image The bitmap of the new image is set to zero

Returns
Pointer to the new image
Parameters
[in]valueconventional value for initialization

◆ st_image_free()

static SPIMG * gstlrn::st_image_free ( SPIMG image)
static

Procedure to free an already existig image

Returns
Pointer to the image freed (NULL)
Parameters
[in]imagepointer to the image to be freed

◆ st_index()

static Id gstlrn::st_index ( Id  i,
Id  j 
)
static

Calculate the indexes of each parameter

Parameters
[in]iIndex
[in]jIndex

◆ st_inhomogeneous_covgg()

static gstlrn::st_inhomogeneous_covgg ( Db dbsrc,
Db dbout,
Id  flag_source,
Model model_dat,
const double *  distgs,
const 1 &  prodgs 
)
static

Establish the covariance vector at target

Returns
Covariance vector
Parameters
[in]dbsrcDb structure containing Sources
[in]dboutDb structure for target
[in]flag_sourceIf the result is the source, rather than diffusion
[in]model_datModel structure for the data
[in]distgsDistance matrix between Target and Sources
[in]prodgsProduct of DistGS by CovSS
Remarks
The returned argument must be freed by the calling function

◆ st_inhomogeneous_covgp()

static gstlrn::st_inhomogeneous_covgp ( Db dbdat,
Db dbsrc,
Db dbout,
Id  flag_source,
Model model_dat,
const double *  distps,
const double *  prodps,
const double *  prodgs 
)
static

Establish the R.H.S. for Inhomogeneous Kriging

Returns
Covariance matrix
Parameters
[in]dbdatDb structure containing Data
[in]dbsrcDb structure containing Sources
[in]dboutDb structure containing Targets
[in]flag_sourceIf the result is the source, rather than diffusion
[in]model_datModel structure for the data
[in]distpsDistance matrix between Data and Sources
[in]prodpsProduct of DistPS by CovSS
[in]prodgsProduct of DistGS by CovSS
Remarks
: When used with flag_source=TRUE, 'dbsrc' and 'dbout' coincide

◆ st_inhomogeneous_covpp()

static gstlrn::st_inhomogeneous_covpp ( Db dbdat,
Db dbsrc,
Model model_dat,
const 1 &  distps,
const 1 &  prodps 
)
static

Establish the L.H.S. for Inhomogeonous Kriging

Returns
Covariance matrix
Parameters
[in]dbdatDb structure containing Data
[in]dbsrcDb structure containing Sources
[in]model_datModel structure for the data
[in]distpsDistance matrix between Data and Sources
[in]prodpsProduct of DistPS by CovSS

◆ st_init_rotation()

static void gstlrn::st_init_rotation ( double *  ct,
double *  st,
double *  a 
)
static

Generate a random rotation axis

Parameters
[out]ctCosine of the random rotation angle
[out]stSine of the random rotation angle
[out]aRandom direction vector

◆ st_initialize_params()

static void gstlrn::st_initialize_params ( Local_CorPgs *  corpgs)
static

Initialize the parameters

Parameters
[out]corpgsLocal_CorPgs Structure

◆ st_intt8r()

static void gstlrn::st_intt8r ( Id  ntable,
double  table[][LTABLE],
Id  nxin,
double  dxin,
double  fxin,
const double *  yin,
double  yinl,
double  yinr,
Id  nxout,
const double *  xout,
double *  yout 
)
static

Interpolation of a uniformly-sampled complex function y(x) via a table of 8-coefficient interpolators

Parameters
[in]ntablenumber of tabulated interpolation operators; ntable>=2
[in]tablearray of tabulated 8-point interpolation operators
[in]nxinnumber of x values at which y(x) is input
[in]dxinx sampling interval for input y(x)
[in]fxinx value of first sample input
[in]yinarray of input y(x) values: yin[0] = y(fxin), etc.
[in]yinlvalue used to extrapolate yin values to left of yin[0]
[in]yinrvalue used to extrapolate yin values to right of yin[nxin-1]
[in]nxoutnumber of x values a which y(x) is output
[in]xoutarray of x values at which y(x) is output
[out]youtarray of output y(x) values: yout[0] = y(xout[0]), etc.
Remarks
ntable must not be less than 2.
The table of interpolation operators must be as follows:
Let d be the distance, expressed as a fraction of dxin, from a
particular xout value to the sampled location xin just to the left
of xout. Then:
for d = 0., table[0][0:7] = 0., 0., 0., 1., 0., 0., 0., 0.
are the weights applied to the 8 input samples nearest xout.
for d = 1., table[ntable-1][0:7] = 0., 0., 0., 0., 1., 0., 0., 0.
are the weights applied to the 8 input samples nearest xout.
for d = (float)itable/(float)(ntable-1), table[itable][0:7] are the
weights applied to the 8 input samples nearest xout.
If the actual sample distance d does not exactly equal one of the
values for which interpolators are tabulated, then the interpolator
corresponding to the nearest value of d is used.
Because extrapolation of the input function y(x) is defined by the
left and right values yinl and yinr, the xout values are not
restricted to lie within the range of sample locations defined by
nxin, dxin, and fxin.

◆ st_is_subgrid()

static Id gstlrn::st_is_subgrid ( Id  verbose,
const char *  title,
DbGrid dbgrid1,
DbGrid dbgrid2,
Id ind0,
Id nxyz,
Id ntot 
)
static

Check if the first grid is a subgrid of the second one

Returns
1 if grids are multiple
Parameters
[in]verboseVerbose flag
[in]titleTitle of the work (used only for verbose case)
[in]dbgrid1Db for the input grid
[in]dbgrid2Db for the output grid
[out]ind0Starting address
[out]nxyzNumber of subdivisions
[out]ntotTotal number of grid nodes

◆ st_keep()

static Id gstlrn::st_keep ( Id  flag_gaus,
Id  flag_prop,
Id  file,
Id  type 
)
static

Check if the field must be kept

Returns
1 if the field must be kept; 0 otherwise
Parameters
[in]flag_gaus1 gaussian results; otherwise facies
[in]flag_prop1 for facies proportion
[in]fileDATA or RESULT
[in]type0 for gaussian; 1 for facies; 2 for proportion

◆ st_keypair_allocate()

static void gstlrn::st_keypair_allocate ( Keypair keypair,
Id  nrow,
Id  ncol 
)
static

Internal function to allocate the storage of a keypair

Parameters
[in]keypairKeypair structure
[in]nrowNumber of rows
[in]ncolNumber of columns

◆ st_keypair_attributes()

static void gstlrn::st_keypair_attributes ( Keypair keypair,
Id  mode,
Id  origin,
Id  ,
Id  ncol 
)
static

Internal function to copy or check the attributes (append)

Parameters
[in]keypairKeypair structure
[in]mode0 for creation and 1 for appending
[in]origin1 from C; 2 from R
[in]ncolNumber of columns
Remarks
The arguments 'ncol' and 'origin' are updated.
Conversely, the argument 'nrow' is not updated here

◆ st_keypair_copy()

static void gstlrn::st_keypair_copy ( Keypair keypair,
Id  type,
Id  start,
void *  values 
)
static

Internal function to copy the contents of values into he keypair

Parameters
[in]keypairKeypair structure
[in]type1 for integer, 2 for double
[in]startStaring address within 'values' in keypair
[in]valuesArray to be copied

◆ st_krige_data()

Id gstlrn::st_krige_data ( Db db,
Model model,
double  beta,
1 &  ranks1,
1 &  ranks2,
1 &  rother,
Id  flag_abs,
double *  data_est,
double *  data_var 
)

Perform the estimation at the data points

Returns
Error return code
Parameters
[in]dbDb structure
[in]modelModel structure
[in]betaThresholding value
[in]ranks1Ranks of exact pivots
[in]ranks2Ranks of ACP pivots
[in]rotherRanks of the idle samples
[in]flag_abs1 Modify 'daata_est' to store the estimation error
[out]data_estArray of estimation at samples
[out]data_varArray of estimation variance at samples

◆ st_krige_manage()

static Id gstlrn::st_krige_manage ( Id  mode,
Id  nvar,
Model model,
ANeigh neigh 
)
static

Management of internal arrays used by kriging procedure

Returns
Error return code
Parameters
[in]mode1 for allocation; -1 for deallocation
[in]nvarNumber of variables to be calculated
[in]modelModel structure
[in]neighANeigh structure
Remarks
The number of variables corresponds to the number of variables
to be calculated. It is not necessarily equal to the number of
variables contained in Model (when kriging a linear combination
of variables for example): hence the use of the 'nvar' passed
as an argument

◆ st_krige_manage_basic()

static Id gstlrn::st_krige_manage_basic ( Id  mode,
Id  nech,
Id  nmax,
Id  nvar,
Id  nfeq 
)
static

Management of internal arrays used by kriging procedure

Returns
Error return code
Parameters
[in]mode1 for allocation; -1 for deallocation
[in]nechNumber of samples in the Input Db (only used for the neighborhood search, if any)
[in]nmaxMaximum number of samples per neighborhood
[in]nvarNumber of variables (to be calculated)
[in]nfeqNumber of drift equations

◆ st_krige_wgt_print()

static void gstlrn::st_krige_wgt_print ( Id  status,
Id  nvar,
Id  nvar_m,
Id  nfeq,
const 1 &  nbgh_ranks,
Id  nred,
Id  icase,
const Id flag,
const double *  wgt 
)
static

Print the kriging weights

Parameters
[in]statusKriging error status
[in]nvarNumber of variables (output)
[in]nvar_mNumber of variables in the Model
[in]nfeqNumber of drift equations
[in]nbgh_ranksVector of selected samples
[in]nredReduced number of equations
[in]icaseRank of the PGS or GRF
[in]flagFlag array
[in]wgtArray of Kriging weights
Remarks
In the case of simulations (icase>=0), the data vector is not
printed as it changes for every sample, per simulation

◆ st_larger_than_dmax()

static Id gstlrn::st_larger_than_dmax ( Id  ndim,
const 1 &  dvect,
Id  distType,
const 1 &  dmax 
)
static

Check if vector is out of range by comparing each component to the maximum value defined per direction

Returns
Error return code
Parameters
[in]ndimSpace dimension
[in]dvectVector
[in]distTypeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
Remarks
If 'dmax' is not defined, the function always returns 0
The function returns 1 as soon as one vector component is
larger than the maximum value for this direction

◆ st_lhs()

static Id gstlrn::st_lhs ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
Model model,
1 &  seltab,
1 &  prop1,
1 &  prop2,
MatrixSquare covtab,
double *  a,
double *  acov 
)
static

Calculates the Kriging L.H.S.

Returns
: 1 if the L.H.S. vector cannot be calculated; 0 otherwise
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModel
[in]seltabNumber of sample definition (0, 1 or 2)
[out]prop1Working array (Dimension: nlayers)
[out]prop2Working array (Dimension: nlayers)
[out]covtabWorking array (Dimension = nlayers * nlayers)
[out]aL.H.S. (square) matrix
[out]acovL.H.S. (square) covariance matrix

◆ st_lhs_exp()

static void gstlrn::st_lhs_exp ( double *  covdd,
Id  cov_radius,
Id  flag_sym,
Id  nfeq,
Id  nbefore,
Id  nafter,
Id  neq 
)
static

Establish the L.H.S. of the Kriging system in the case of the discretized covariances

Parameters
[in]covddArray of discretized covariance (data-data)
[in]cov_radiusRadius of the covariance array
[in]flag_sym1 for symmetrized covariance
[in]nfeq0 or 1 drift function(s)
[in]nbeforeNumber of samples in neighborhood before target
[in]nafterNumber of samples in neighborhood after target
[in]neqNumber of kriging equations

◆ st_lhs_exp_3D()

static void gstlrn::st_lhs_exp_3D ( Id  nech,
Id  nfeq,
const Id  nei_ss[3],
const Id  nei_nn[3],
const Id  cov_ss[3],
const Id  cov_nn[3],
const Id nei_cur,
const double *  cov_tot,
double  nugget 
)
static

Establish the kriging L.H.S. using discretized covariances

Parameters
[in]nechNumber of samples in the Neighborhood
[in]nfeqNumber of drift functions
[in]nei_ssArray of dimensions of the Neighborhood
[in]nei_nnArray of radius of the Neighborhood
[in]cov_ssArray of dimensions of the Covariance array
[in]cov_nnArray of radius of the Covariance array
[in]nei_curArray containing the current neighborhood
[in]cov_totArray containing the total variable covariance
[in]nuggetAmount of additional Nugget Effect

◆ st_lhs_one()

static Id gstlrn::st_lhs_one ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
Model model,
1 &  seltab,
Id  iech0,
Id  ilayer0,
double *  coor,
1 &  prop0,
1 &  prop2,
MatrixSquare covtab,
1 &  b 
)
static

Calculates the L.H.S. for one data

Returns
: 1 if the L.H.S. vector cannot be calculated; 0 otherwise
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModel
[in]seltabNumber of sample definition (0, 1 or 2)
[in]iech0Rank of the target sample (used for ext. drift)
[in]ilayer0Rank of the layer of interest (Starting from 1)
[in]coorCoordinates of the data
[in]prop0Working array at first point (Dimension: nlayers)
[out]prop2Working array (Dimension: nlayers)
[out]covtabWorking array (Dimension = nlayers * nlayers)
[out]bR.H.S. vector (Dimension = neq)

◆ st_linear_interpolate()

static void gstlrn::st_linear_interpolate ( double  mscur,
1 &  param,
const MatrixDense acont,
1 &  tabexp,
1 &  tabwgt,
MatrixDense bords,
1 &  grad,
double *  msaux,
1 &  paramaux,
1 &  residuals,
1 &  tabmod1 
)
static

Interpolate linearly the vector of parameters

Parameters
[in]mscurCurrent minimization value
[in]paramCurrent values of the parameters
[in]acontArray of constraints
[in]tabexpArray of values at control points
[in]tabwgtArray of weights at control points
[in]bordsArray containing the bounds
[in]gradGradient matrix
[out]msauxNew minimization value
[out]paramauxNew vector of parameters
[out]residualsArray of residuals
[out]tabmod1Working array (Dimension: NDAT)

◆ st_load_segment()

static Id gstlrn::st_load_segment ( DbGrid dbgrid,
1 &  mesh,
1 &  order,
Id  ipos,
Id  ix1,
Id  ix2 
)
static

Load the vertices in a segment and check if the segment is masked

Returns
1 If the segment is valid because at least one vertex is active
Parameters
[in]dbgridDb structure
[in]iposPosition of newly created mesh information
[in]ix1Grid index along X for the vertex #1
[in]ix2Grid index along X for the vertex #2
[out]meshArray of triangle ranks (dimension = 3)
[out]orderArray of relative ranks
Remarks
The values in 'order' are the absolute indices (starting from 1),
negative if the grid node is masked off

◆ st_load_tetra()

static Id gstlrn::st_load_tetra ( DbGrid dbgrid,
1 &  mesh,
1 &  order,
Id  ipos,
Id  ix1,
Id  iy1,
Id  iz1,
Id  ix2,
Id  iy2,
Id  iz2,
Id  ix3,
Id  iy3,
Id  iz3,
Id  ix4,
Id  iy4,
Id  iz4 
)
static

Load the vertices in a tetrahedron and check if the tetrahedron is masked

Returns
1 If the tetrahedron is valid because at least one vertex is active
Parameters
[in]dbgridDb structure
[in]meshArray of triangle ranks (dimension = 4)
[in]orderArray of relative ranks
[in]iposPosition of newly created mesh information
[in]ix1Grid index along X for the vertex #1
[in]iy1Grid index along Y for the vertex #1
[in]iz1Grid index along Z for the vertex #1
[in]ix2Grid index along X for the vertex #2
[in]iy2Grid index along Y for the vertex #2
[in]iz2Grid index along Z for the vertex #2
[in]ix3Grid index along X for the vertex #3
[in]iy3Grid index along Y for the vertex #3
[in]iz3Grid index along Z for the vertex #3
[in]ix4Grid index along X for the vertex #4
[in]iy4Grid index along Y for the vertex #4
[in]iz4Grid index along Z for the vertex #4
Remarks
The values in 'order' are the absolute indices (starting from 1),
negative if the grid node is masked off

◆ st_load_trace()

static Id gstlrn::st_load_trace ( Id  nPerTrace,
Id  nz,
Id  option,
double  z0,
double  delta,
double  czbot,
double  cztop,
const 1 &  cotes,
const 1 &  values,
1 &  writes,
Id nbvalues,
RefStats refstats 
)
static

Processing a Trace

◆ st_load_triangle()

static Id gstlrn::st_load_triangle ( DbGrid dbgrid,
1 &  mesh,
1 &  order,
Id  ipos,
Id  ix1,
Id  iy1,
Id  ix2,
Id  iy2,
Id  ix3,
Id  iy3 
)
static

Load the vertices in a triangle and check if the triangle is masked

Returns
1 If the triangle is valid because at least one vertex is active
Parameters
[in]dbgridDb structure
[in]iposPosition of newly created mesh information
[in]ix1Grid index along X for the vertex #1
[in]iy1Grid index along Y for the vertex #1
[in]ix2Grid index along X for the vertex #2
[in]iy2Grid index along Y for the vertex #2
[in]ix3Grid index along X for the vertex #3
[in]iy3Grid index along Y for the vertex #3
[out]meshArray of triangle ranks (dimension = 3)
[out]orderArray of relative ranks
Remarks
The values in 'order' are the absolute indices (starting from 1),
negative if the grid node is masked off

◆ st_locate_coor_on_grid()

static Id gstlrn::st_locate_coor_on_grid ( Id  np,
const 1 &  coords,
const DbGrid db_grid,
1 &  tab 
)
static

Locate a set of points on a grid

Returns
Number of samples located on the grid
Parameters
[in]npNumber of samples
[in]coordsArray of coordinates (dimension: ndim, np)
[in]db_griddescriptor of the grid parameters
[out]tabOutput array (Dimension: Number of discretized points)
Remarks
The array tab contains the index of the closest grid node
even if the sample does not lie within the grid
This function is limited to 3D space maximum. The consistency
of space dimension must have been performed beforehand

◆ st_locate_point_on_grid()

static Id gstlrn::st_locate_point_on_grid ( const Db db_point,
const DbGrid db_grid,
1 &  coor,
1 &  tab 
)
static

Locate a set of points on a grid

Returns
Number of samples located on the grid
Parameters
[in]db_pointdescriptor of the point parameters
[in]db_griddescriptor of the grid parameters
[out]coorWorking array
[out]tabOutput array (Dimension: Number of point samples)
Remarks
The array tab contains the index of the closest grid node
even if the sample does not lie within the grid

◆ st_locate_sample_in_output()

static Id gstlrn::st_locate_sample_in_output ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
Id  iech,
Id igrid 
)
static

Returns the absolute grid node absolute index which is the closest to a given sample of a Db In the case of same input and output file, simply return 'iech'

Returns
1 if the sample does not belong to the grid; 0 otherwise
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]iechRank in the input Db
[out]igridRank of the node in the output Db

◆ st_make_all_lags_active()

static void gstlrn::st_make_all_lags_active ( Vario vario)
static

Make all lags active

Parameters
[out]varioVario structure

◆ st_make_some_lags_inactive()

static void gstlrn::st_make_some_lags_inactive ( Vario vario)
static

Make some lags inactive

Parameters
[out]varioVario structure

◆ st_manage_corpgs()

static void gstlrn::st_manage_corpgs ( Local_CorPgs *  local_corpgs)
static

Manage the Local_CorPgs structure

Parameters
[in,out]local_corpgsLocal_CorPgs structure

◆ st_manage_pgs()

static void gstlrn::st_manage_pgs ( Id  mode,
Local_Pgs *  local_pgs,
Db db = nullptr,
const Rule rule = nullptr,
Vario vario = nullptr,
Vario varioind = nullptr,
Model model = nullptr,
PropDef propdef = nullptr,
Id  flag_stat = 0,
Id  flag_facies = 0,
Id  flag_dist = 0,
Id  ngrf = 0,
Id  nfacies = 0,
const ECalcVario &  calcul_type = ECalcVario::UNDEFINED 
)
static

Manage the Local_Pgs structure

Parameters
[in]mode0 initialization; 1 allocation; -1 deallocation
[in,out]local_pgsLocal_Pgs structure
[in]dbDb structure
[in]ruleLithotype Rule definition
[in]varioVario structure
[in]varioindIndicator Vario structure
[in]modelModel structure
[in]propdefPropDef structure
[in]flag_stat1 for stationary; 0 otherwise
[in]flag_facies1 when processed on facies; 0 otherwise
[in]flag_dist1 if distances are stored; 0 otherwise
[in]ngrfNumber of GRFs
[in]nfaciesNumber of facies
[in]calcul_typeType of the calculation (covariance, variogram, ...)

◆ st_manage_trace()

static void gstlrn::st_manage_trace ( Local_TracePgs *  local_tracepgs)
static

Manage the Local_TracePgs structure

Parameters
[in,out]local_tracepgsLocal_TracePgs structure

◆ st_match()

static Id gstlrn::st_match ( DbGrid db_z,
DbGrid db_t 
)
static

Check that the Depth and Time grid coincide

Returns
1 if the two files coincide; 0 otherwise
Parameters
[in]db_zDepth Grid structure
[in]db_tTime Grid structure (optional)
Remarks
In case of error, a message is displayed

◆ st_match_keypair()

static Id gstlrn::st_match_keypair ( const char *  keyword,
Id  flag_exact 
)
static

Look for an already registered keypair

Returns
Rank of the matching item (or -1)
Parameters
[in]keywordKeyword
[in]flag_exact1 if Exact keyword matching is required

◆ st_maxstable_combine()

static void gstlrn::st_maxstable_combine ( Db dbout,
double  scale,
Id  iter0,
Id  iptrg,
Id  iptrv,
Id  iptrr,
Id last 
)
static

Combine the simulations of the max-stable process

Parameters
[in]dboutOutput Db structure
[in]scaleScaling factor for the new simulation
[in]iter0Rank of the current iteration
[in]iptrgPointer to the newly simulated outcome
[in]iptrvPointer to the max-stable outcome
[in]iptrrPointer to the max-stable rank outcome
[in,out]lastRank of Iteration where the last grid node is covered

◆ st_maxstable_mask()

static Id gstlrn::st_maxstable_mask ( Db dbout,
double  seuil,
double  scale,
Id  iptrv,
Id  iptrs 
)
static

Mask the grid nodes whose value is already too large

Returns
Number of cells left to be filled
Parameters
[in]dboutOutput Db structure
[in]seuilThreshold
[in]scaleScaling factor for the new simulation
[in]iptrvPointer to the max-stable outcome
[in]iptrsPointer to the current selection

◆ st_mean_arith()

static void gstlrn::st_mean_arith ( Id  idim,
const Id nxyz1,
const Id nxyz2,
const double *  numtab1,
double *  numtab2,
double *  valtab1,
double *  valtab2 
)
static

Perform the arithmetic mean

Parameters
[in]idimDirection of calculation
[in]nxyz1Dimensions of the initial subgrid
[in]nxyz2Dimensions of the final subgrid
[out]numtab1Array containing the sample count
[out]numtab2Array containing the sample count
[out]valtab1Array containing the sample value
[out]valtab2Array containing the sample value

◆ st_mean_harmo()

static void gstlrn::st_mean_harmo ( Id  idim,
const Id nxyz1,
const Id nxyz2,
const double *  numtab1,
double *  numtab2,
double *  valtab1,
double *  valtab2 
)
static

Perform the harmonic mean

Parameters
[in]idimDirection of calculation
[in]nxyz1Dimensions of the initial subgrid
[in]nxyz2Dimensions of the final subgrid
[out]numtab1Array containing the input sample count
[out]numtab2Array containing the output sample count
[out]valtab1Array containing the input sample value
[out]valtab2Array containing the output sample value

◆ st_migrate_seed()

static void gstlrn::st_migrate_seed ( Id  ndim,
Id  n_nbgh,
Id nxyz,
const Id nbgh,
double *  valwrk,
const double *  valtab0,
Id locwrk,
Id loccur 
)
static

Migrate the seed to one of the available neighboring cells

Parameters
[in]ndimSpace dimension
[in]n_nbghNumber of neighboring cells
[in]nxyzDimensions of the subgrid
[in]nbghArray giving the neighboring cell location
[in]valwrkWorking array (Dimension: n_nbgh)
[in]valtab0Array containing the sample value
[in]locwrkWorking array for shifted seed positions
[in,out]loccurCurrent seed position

◆ st_minimization_under_constraints()

static Id gstlrn::st_minimization_under_constraints ( 1 &  ind_util,
MatrixDense bords_red,
1 &  ai_red,
1 &  grad_red,
MatrixSquare gauss_red,
MatrixDense consts,
1 &  hgnc,
1 &  hgnadm,
1 &  flag_active,
1 &  flag_actaux,
MatrixSquare a,
1 &  b1,
1 &  b2,
1 &  b3,
1 &  temp,
const MatrixDense acont 
)
static

Minimization under constraints

Returns
1 if the optimum has not been reached (various reasons)
Parameters
[in]ind_utilList of retained constraint indices
[in]bords_redReduced array containing the bounds
[in]ai_redReduced AI matrix
[in]grad_redReduced Gradient matrix
[in]gauss_redReduced Gauss matrix
[out]constsArray of constraints
[out]hgncWorking vector
[out]hgnadmWorking array
[out]flag_activeArray of indices with zero valid constraint
[out]flag_actauxArray of indices with negative valid constraint
[out]aMinimization L.H.S. matrix
[out]b1Minimization R.H.S. matrix
[out]b2Minimization R.H.S. matrix
[out]b3Minimization R.H.S. matrix
[out]tempWorking array
[out]acontConstraint array

◆ st_minimum()

static void gstlrn::st_minimum ( 1 &  ,
1 &  flag,
MatrixDense bords_red,
const 1 &  top,
const 1 &  bot,
1 &  hgnc,
1 &  hgnadm 
)
static

Calculate the minimum of the criterion and update hgnadm

Parameters
[in]flagArray of indices with negative valid constraint
[in]bords_redReduced array containing the bounds
[in]topCalculated top of the fraction
[in]botCalculated bottom of the fraction
[in]hgncHgnc array
[out]hgnadmAdmissible Hgn array

◆ st_mksinc()

static void gstlrn::st_mksinc ( double  d,
Id  lsinc,
double *  sinc 
)
static

Compute least-squares optimal sinc interpolation coefficients.

Parameters
[in]dfractional distance to interpolation point; 0.0<=d<=1.0
[in]lsinclength of sinc approximation; lsinc%2==0 and lsinc<=20
[out]sincarray[lsinc] containing interpolation coefficients
Remarks
The coefficients are a least-squares-best approximation to the
ideal sinc function for frequencies from zero up to a computed
maximum frequency.
For a given interpolator length, lsinc, mksinc computes the
maximum frequency, fmax (expressed as a fraction of the Nyquist
frequency), using the following empirically derived relation (from
a Western Geophysical Technical Memorandum by Ken Larner):
fmax = min(0.066+0.265*log(lsinc),1.0)
Note that fmax increases as lsinc increases, up to a maximum of 1.
Use the coefficients to interpolate a uniformly-sampled function
y(i) as follows:
lsinc-1
y(i+d) = sum sinc[j]*y(i+j+1-lsinc/2)
j=0
Interpolation error is greatest for d=0.5, but for frequencies less
than fmax, the error should be less than 1.0 percent.

◆ st_model_manage()

static Id gstlrn::st_model_manage ( Id  mode,
Model model 
)
static

Management of internal arrays used by cov and drift functions

Returns
Error return code
Parameters
[in]mode1 for allocation; -1 for deallocation
[in]modelModel structure
Remarks
This function manages covariance internal arrays with dimension
equal to the number of variables in the Model

◆ st_multilinear_evaluate()

static Id gstlrn::st_multilinear_evaluate ( DbGrid db_grid,
const 1 &  indg,
Id  iatt,
double *  value 
)
static

◆ st_multilinear_interpolation()

static double gstlrn::st_multilinear_interpolation ( DbGrid dbgrid,
Id  iatt,
Id  distType,
const 1 &  dmax,
const 1 &  coor 
)
static

Perform the multi-linear interpolation from a regular grid Db

Returns
Interpolated value
Parameters
[in]dbgriddescriptor of the grid parameters
[in]iattrank of the target variable in dbgrid
[in]distTypeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]coorCoordinates of the target point

◆ st_mvndfn()

static double gstlrn::st_mvndfn ( Id n,
double *  w 
)
static

st_mvndfn

◆ st_mvndfn_0()

static double gstlrn::st_mvndfn_0 ( Id  n__,
Id n,
double *  w,
double *  correl,
double *  lower,
double *  upper,
Id infin,
Id infis,
double *  d,
double *  e 
)
static

Integrand subroutine

◆ st_mvndnt()

static double gstlrn::st_mvndnt ( Id n,
double *  correl,
double *  lower,
double *  upper,
Id infin,
Id infis,
double *  d,
double *  e 
)
static

st_mvndnt

◆ st_mvnlms()

static void gstlrn::st_mvnlms ( double *  a,
double *  b,
const Id infin,
double *  lower,
double *  upper 
)
static

Multivariate Normal Probability (local function)

◆ st_mvnphi()

static double gstlrn::st_mvnphi ( const double *  z)
static

Normal distribution probabilities accurate to 1.e-15. Z = no. of standard deviations from the mean. Based upon algorithm 5666 for the error function, from: Hart, J.F. et al, 'Computer Approximations', Wiley 1968

◆ st_neigh_diff()

static Id gstlrn::st_neigh_diff ( const Id  nei_ss[3],
const Id  nei_nn[3],
Id nei_ref,
const Id nei_cur 
)
static

Check if two neighborhood patterns are similar

Returns
1 if the patterns are different; 0 otherwise
Parameters
[in]nei_ssArray of dimensions of the Neighborhood
[in]nei_nnArray of radius of the Neighborhood
[in]nei_refArray containing the reference neighborhood
[in]nei_curArray containing the current neighborhood

◆ st_neigh_find()

static gstlrn::st_neigh_find ( DbGrid db,
Id  ix0,
Id  iy0,
Id  iz0,
const Id  nei_ss[3],
const Id  nei_nn[3],
Id nei_cur 
)
static

Find the neighborhood of a pixel

Parameters
[in]dbinput Db structure
[in]ix0index of the pixel along X
[in]iy0index of the pixel along Y
[in]iz0index of the pixel along Z
[in]nei_ssArray of dimensions of the Neighborhood
[in]nei_nnArray of radius of the Neighborhood
[out]nei_curArray containing the neighborhood

◆ st_next_sample()

Id gstlrn::st_next_sample ( Id  ip0_init,
const 1 &  rank,
const 1 &  xtab,
double  xtarget 
)

Get the rank of the next sample just above the target To speed up the process, this operation is performed starting from the rank assigned to the previous sample (this assumes that samples are treated by increasing coordinate)

Parameters
ip0_initRank of the previous sample
rankArray of sample ordering
xtabArray of sample coordinates
xtargetTarget coordinate
Returns
Rank of the sample just above the target (or equal)
Note
: The use of 'ip0_init' which could be different from 0 has been abandoned temporarily

◆ st_nkl()

static double gstlrn::st_nkl ( 1 &  u,
double  lower,
double  upper,
1 &  invvari,
Id  index2,
double  meanj,
double  varj,
double  stdj 
)
static
Returns
Calculate the other derivatives

◆ st_norm_hgn()

static double gstlrn::st_norm_hgn ( 1 &  hgn,
1 &  scale 
)
static

Calculate the Norm of the HGN vector

Returns
The norm value
Parameters
[in]hgnWorking vector
[in]scaleScaling values

◆ st_normalize()

static void gstlrn::st_normalize ( double  v[3])
static

◆ st_optim_onelag_pgs()

static double gstlrn::st_optim_onelag_pgs ( Local_Pgs *  local_pgs,
double  tolsort,
Id  new_val 
)
static

Optimize the lag

Parameters
[in]local_pgsLocal_Pgs structure
[in]tolsortTolerance value
[in]new_valFlag indicating if parameters must be initialized

◆ st_param_expand()

static double gstlrn::st_param_expand ( Local_Pgs *  local_pgs,
Id  igrf,
Id  jgrf,
Id  idir 
)
static

Expand the vector of parameters into C1, C12, C21 and C2 according to the constraints

Returns
Returned parameter
Parameters
[in]local_pgsLocal_Pgs structure
[in]igrfRank of the first variable
[in]jgrfRank of the second variable
[in]idirpositive (1) or negative (-1) distance

◆ st_permut()

static Id gstlrn::st_permut ( Id  value,
Id  igrf 
)
static

◆ st_phinvs()

static double gstlrn::st_phinvs ( const double *  p)
static

Produces the normal deviate Z corresponding to a given lower tail area of P. The hash sums below are the sums of the mantissas of the coefficients. They are included for use in checking transcription.

◆ st_possibilities()

static Id gstlrn::st_possibilities ( Id  npar,
MatrixDense bords,
1 &  ai,
1 &  hgnc,
1 &  flag,
1 &  temp 
)
static

Calculate the number of new inactive constraints

Returns
Number of highlited constraints
Parameters
[in]nparCurrent number of parameters
[in]bordsArray containing the bounds
[in]aiAI matrix
[in]hgncResulting hgnc array
[out]flagWorking array
[out]tempWorking array

◆ st_print() [1/2]

static void gstlrn::st_print ( )
static

◆ st_print() [2/2]

static void gstlrn::st_print ( const char *  string)
static

Internal print from the library

Parameters
[in]stringMessage to be printed

◆ st_print_BFileHead()

static void gstlrn::st_print_BFileHead ( binaryFileHeader Bheader)
static

Internal function for printing the Binary File Header

Parameters
[in]BheaderPointer to the Binary File header

◆ st_print_grid() [1/2]

static void gstlrn::st_print_grid ( const char *  subtitle,
Id  nxyz[3],
double *  numtab,
double *  valtab 
)
static

Print the generated grids (for counts and values)

Parameters
[in]subtitleSubtitle
[in]nxyzDimensions of the grid
[out]numtabArray containing the sample count
[out]valtabArray containing the sample value

◆ st_print_grid() [2/2]

static void gstlrn::st_print_grid ( const Grid def_grid)
static

Print the characteristics of the resulting grid

Parameters
[in]def_gridPointer to the Grid structure

◆ st_print_position()

static void gstlrn::st_print_position ( Id  ndim,
Id  iseed,
Id  iter,
Id tab 
)
static

Print the position (debug option)

Parameters
[in]ndimSpace dimension
[in]iseedRank of the trajectory (from 0)
[in]iterRank of the iteration (from 0)
[in]tabArray containing the coordinates of the position
Remarks
This very verbose option only functions if verbose is TRUE
and the internal flag DEBUG is TRUE (this requires compiling)

◆ st_print_results()

static void gstlrn::st_print_results ( Id  nPerTrace,
bool  flag_surf,
double  delta,
RefStats refstats 
)
static

Printout

◆ st_print_traceHead()

static void gstlrn::st_print_traceHead ( traceHead Theader,
Id  numTrace 
)
static

Internal function for printing the Trace Header

Parameters
[in]TheaderPointer to the Trace Header contents
[in]numTraceRank of the trace

◆ st_print_upscale()

static void gstlrn::st_print_upscale ( const char *  title,
Id nxyz,
const double *  valtab 
)
static

Print statistics after basic upscaling operation

Parameters
[in]titleTitle for the printout
[in]nxyzGrid dimension
[out]valtabArray containing the sample value

◆ st_printclustercount()

static void gstlrn::st_printclustercount ( Id  nclusters,
Id  nech,
const 1 &  clusterid 
)
static

Print the number of samples per cluster

Parameters
[in]nclustersNumber if clusters
[in]nechNumber of samples
[in]clusteridArray of cluster number for each sample

◆ st_printclusterlist()

static void gstlrn::st_printclusterlist ( Id  nclusters,
Id  nech,
const 1 &  clusterid 
)
static

Print the list of cluster per sample

Parameters
[in]nclustersNumber if clusters
[in]nechNumber of samples
[in]clusteridArray of cluster number for each sample

◆ st_proportion_changed()

static Id gstlrn::st_proportion_changed ( PropDef propdef)
static

Check if the proportion has changed since the previous usage and store the current proportions for future comparison

Returns
1 if the proportions are unchanged; 0 otherwise
Parameters
[in]propdefPropDef structure

◆ st_proportion_define()

static Id gstlrn::st_proportion_define ( PropDef propdef,
const Db db,
Id  iech,
Id  isimu,
Id  nbsimu,
Id jech 
)
static

Set the (non-stationary) proportions

Returns
Error return code
- the target point does not lie within the proportion grid
- in conditional processing, the reference facies does not exist
Parameters
[in]propdefPropDef structure
[in]dbDb input structure
[in]iechRank of the data in the input Db
[in]isimuRank of the simulation (EProcessOper::CONDITIONAL)
[in]nbsimuNumber of simulations
[out]jechRank of the auxiliary data in the input Db
Remarks
At the end of this function, the local proportions are stored
in the array proploc of the structure PropDef
The argument 'isimu' is only used for
propdef->mode == EProcessOper::CONDITIONAL (simbipgs)

◆ st_proportion_locate()

static Id gstlrn::st_proportion_locate ( PropDef propdef,
Id  ifac_ref 
)
static

Locate the current proportions

Parameters
[in]propdefPropDef structure
[in]ifac_refConditional (first variable) facies (Only used for EProcessOper::CONDITIONAL)

◆ st_proportion_transform()

static Id gstlrn::st_proportion_transform ( PropDef propdef)
static

Transform the proportions (from CST to WRK)

Returns
-1 if the proportion is not defined; 0 otherwise
Parameters
[in]propdefPropDef structure

◆ st_quantile()

static double gstlrn::st_quantile ( Db dbout,
double  proba,
double *  sort 
)
static

Calculate the quantile for a given array

Returns
Quantile value
Parameters
[in]dboutOutput Db structure
[in]probaProbability
[out]sortSorting array

◆ st_randomassign()

static void gstlrn::st_randomassign ( Id  nclusters,
Id  nech,
1 &  clusterid 
)
static

Initial random assignment of samples to clusters

Parameters
[in]nclustersNumber if clusters
[in]nechNumber of samples
[out]clusteridArray of cluster number for each sample

◆ st_ranks_other()

static gstlrn::st_ranks_other ( Id  nech,
const 1 &  ranks1,
const 1 &  ranks2 
)
static

Allocate a vector of sample ranks excluding already selected pivots

Returns
Pointer to the newly create integer vector
Parameters
[in]nechNumber of samples
[in]ranks1Ranks of exact pivots
[in]ranks2Ranks of ACP pivots
Remarks
The output array must be free by the calling function

◆ st_rcswp()

static void gstlrn::st_rcswp ( const Id p,
const Id q,
double *  a,
double *  b,
Id infin,
const Id n,
double *  c 
)
static

Swaps rows and columns P and Q in situ, with P <= Q

◆ st_read()

static void gstlrn::st_read ( const char *  prompt,
char *  buffer 
)
static

Read a string from the Standard Input

Parameters
[in]promptString to be prompted to ask the question
[in]bufferArray where the Input string is stored

◆ st_read_active_sample()

static Id gstlrn::st_read_active_sample ( Db db,
Id  flag_zero,
Id  iech,
Id  nvar,
Id iatt,
double  eps,
double *  tab 
)
static

Check if a sample must be kept or not

Returns
1 if the sample must be kept
Parameters
[in]dbDb characteristics
[in]flag_zero1 to forbid zero values
[in]iechRank of the sample
[in]nvarNumber of attributes
[in]iattArray of the input attribute
[in]epsMinimum value assigned to a zero
[out]tabArray of values

◆ st_read_trace()

static Id gstlrn::st_read_trace ( FILE *  file,
Id  codefmt,
Id  numtrace,
Id  nPerTrace,
double  delta,
Id  verbOption,
1 &  values,
1 &  cotes 
)
static

◆ st_readFileHeader()

static Id gstlrn::st_readFileHeader ( FILE *  file,
Id  verbOption,
Id NPerTrace,
double *  delta 
)
static

Internal function for reading the File header

Parameters
[in]filePointer to the File stream
[in]verbOptionVerbose option
[out]NPerTraceNumber of samples per trace
[out]deltaDistance between two consecutive vertical samples

◆ st_recopy()

static Id gstlrn::st_recopy ( const Id nxyz1,
const double *  numtab1,
const double *  valtab1,
Id nxyz2,
double *  numtab2,
double *  valtab2 
)
static

Update the dimensions and calculate the current number of cells

Returns
Number of cells
Parameters
[in]nxyz1Dimensions of the initial subgrid
[in]numtab1Array containing the sample count
[in]valtab1Array containing the sample value
[out]nxyz2Dimensions of the final subgrid
[out]numtab2Array containing the sample count
[out]valtab2Array containing the sample value

◆ st_refstats_init()

static void gstlrn::st_refstats_init ( RefStats refstats,
double  modif_high,
double  modif_low,
double  modif_scale 
)
static

Initialize statistics

◆ st_refstats_update()

static void gstlrn::st_refstats_update ( Id  iline,
Id  xline,
double  xtrace,
double  ytrace,
RefStats refstats 
)
static

Update statistics

◆ st_reject_trace()

static Id gstlrn::st_reject_trace ( Id  iline,
Id  xline,
Id  iline_min,
Id  iline_max,
Id  xline_min,
Id  xline_max 
)
static

Reject trace due to trace boundary specifications

◆ st_relative_position_array()

static gstlrn::st_relative_position_array ( Id  neq)
static

Manage the relative position array

Parameters
[in]neqNumber of kriging equations

◆ st_relem_alloc()

static Relem * gstlrn::st_relem_alloc ( Split old_split)
static

◆ st_relem_define()

static void gstlrn::st_relem_define ( Relem relem,
Id  nfacies,
const 1 &  facies,
Id  side,
const Id poss 
)
static

◆ st_relem_evaluate()

static gstlrn::st_relem_evaluate ( Relem relem,
Id  verbose,
1 &  fgrf,
1 &  fcmp,
Local_Pgs *  local_pgs,
Id nscore,
Id r_opt 
)
static

◆ st_relem_explore()

static void gstlrn::st_relem_explore ( Relem relem,
Id  verbose 
)
static

◆ st_relem_free()

static Relem * gstlrn::st_relem_free ( Relem relem)
static

◆ st_relem_subdivide()

static void gstlrn::st_relem_subdivide ( Relem relem0,
Id  half,
Id  noper 
)
static

◆ st_residuals()

static double gstlrn::st_residuals ( 1 &  param,
1 &  tabexp,
1 &  tabwgt,
1 &  tabmod,
1 &  residuals 
)
static

Calculate the residuals between the model and the experimental

Returns
The weighted mean squared error
Parameters
[in]paramCurrent values of the parameters
[in]tabexpArray of values at control points
[in]tabwgtArray of weights at control points
[out]tabmodWorking array (Dimension: NDAT)
[out]residualsArray of residuals

◆ st_result_kriging_print()

static void gstlrn::st_result_kriging_print ( Id  flag_xvalid,
Id  nvar,
Id  status 
)
static

Print the results

Parameters
[in]flag_xvalidwhen cross-validation option is switched ON 1: Z*-Z and (Z*-Z)/S* 2: Z* and S* > 0 for ONE Point out < 0 for excluding information with same code
[in]nvarNumber of variables
[in]statusKriging error status

◆ st_retrace_define()

static void gstlrn::st_retrace_define ( Local_Pgs *  local_pgs)
static

Reset the Local_TracePgs structure

Parameters
[in,out]local_pgsLocal_TracePgs structure

◆ st_rho_search()

static double gstlrn::st_rho_search ( double  rho,
void *  user_data 
)
static

Local searching function for rho

Returns
Evaluation value
Parameters
[in]rhorho parameter
[in]user_dataUser Data

◆ st_rhs()

static Id gstlrn::st_rhs ( LMlayers lmlayers,
Db dbin,
DbGrid dbout,
Model model,
double *  coor,
1 &  seltab,
Id  iechout,
Id  ilayer0,
1 &  prop0,
1 &  prop2,
MatrixSquare covtab,
1 &  b 
)
static

Calculates the Kriging R.H.S.

Returns
: 1 if the R.H.S. has not been calculated; 0 otherwise
Parameters
[in]lmlayersLMlayers structure
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]modelModel
[in]coorCoordinates of the target sample
[in]seltabNumber of sample definition (0, 1 or 2)
[in]iechoutRank of the target sample
[in]ilayer0Rank of the layer of interest (Starting from 1)
[out]prop0Working array (Dimension: nlayers)
[out]prop2Working array (Dimension: nlayers)
[out]covtabWorking array (Dimension = nlayers * nlayers)
[out]bR.H.S. vector (Dimension = neq)

◆ st_rhs_exp()

static void gstlrn::st_rhs_exp ( double *  covd0,
Id  cov_radius,
Id  flag_sym,
Id  nfeq,
Id  nbefore,
Id  nafter,
Id  neq 
)
static

Establish the R.H.S. of the Kriging system in the case of the discretized covariances

Parameters
[in]covd0Array of discretized covariance (data-data)
[in]cov_radiusRadius of the covariance array
[in]flag_sym1 for symmetrized covariance
[in]nfeq0 or 1 drift function(s)
[in]nbeforeNumber of samples in neighborhood before target
[in]nafterNumber of samples in neighborhood after target
[in]neqNumber of equations

◆ st_rhs_exp_3D()

static void gstlrn::st_rhs_exp_3D ( Id  nech,
Id  nfeq,
const Id  nei_ss[3],
const Id  nei_nn[3],
const Id  cov_ss[3],
const Id  cov_nn[3],
const Id nei_cur,
const double *  cov_res 
)
static

Establish the kriging R.H.S. using discretized covariances

Parameters
[in]nechNumber of samples in the neighborhood
[in]nfeqNumber of drift functions
[in]nei_ssArray of dimensions of the Neighborhood
[in]nei_nnArray of radius of the Neighborhood
[in]cov_ssArray of dimensions of the Covariance array
[in]cov_nnArray of radius of the Covariance array
[in]nei_curArray containing the current neighborhood
[in]cov_resArray containing the residual variable covariance

◆ st_rkl()

static double gstlrn::st_rkl ( Id  maxpts,
double  x,
double  y,
1 &  lower,
1 &  upper,
MatrixSymmetric corr1,
MatrixSquare covar,
MatrixSquare temp 
)
static

PRUPOSE: Internal function

◆ st_rule_calcul()

static double gstlrn::st_rule_calcul ( Local_Pgs *  local_pgs,
Id string 
)
static

◆ st_rule_encode()

static Rule * gstlrn::st_rule_encode ( const Id string)
static

◆ st_rule_glue()

static void gstlrn::st_rule_glue ( Relem relem,
Id  nrule1,
Id  nbyrule1,
const 1 &  rules1,
const 1 &  fipos1 
)
static

◆ st_rule_print()

static void gstlrn::st_rule_print ( Id  rank,
Id  nbyrule,
const 1 &  rules,
const 1 &  fipos,
bool  flag_rank,
Id  flag_similar,
Id  flag_igrf,
double  score 
)
static

◆ st_rule_product()

static void gstlrn::st_rule_product ( Split split,
Id  nprod,
Id  nrule1,
Id  nbyrule1,
const 1 &  rules1,
const 1 &  fipos1,
Id  nrule2,
Id  nbyrule2,
const 1 &  rules2,
const 1 &  fipos2 
)
static

◆ st_rules_print()

static void gstlrn::st_rules_print ( const char *  title,
Id  nrule,
Id  nbyrule,
const 1 &  rules,
const 1 &  fipos 
)
static

◆ st_same_score()

static Id gstlrn::st_same_score ( Relem relem,
Id  ir0,
Id  igrf_cas,
1 &  fgrf,
1 &  fcmp 
)
static

◆ st_sample_add()

static void gstlrn::st_sample_add ( DbGrid db,
Id  iatt_z1,
Id  iatt_z2,
Id  flag_test,
Id  ix,
Id  iz,
ST_Seismic_Neigh ngh 
)
static

Add the sample to the neighborhood

Parameters
[in]dbGrid Db structure
[in]iatt_z1Address of the first data attribute
[in]iatt_z2Address of the second data attribute
[in]flag_testFlag to check if the sample must be added
  • 0 : only if at least one variable is defined
  • 1 : only if the first variable is defined
  • 2 : only if the second variable is defined
[in]ixRank of the trace
[in]izRank of the target sample within the target trace
[in,out]nghST_Seismic_Neigh structure

◆ st_sample_remove_central()

static void gstlrn::st_sample_remove_central ( ST_Seismic_Neigh ngh)
static

Remove the sample which coincides with the target site from the neighborhood

Parameters
[in,out]nghST_Seismic_Neigh structure

◆ st_sample_to_grid()

static void gstlrn::st_sample_to_grid ( Id  ndim,
Id  ntot,
const Id nxyz,
Id  iech,
Id indg 
)
static

Converts from sample index into grid indices

Parameters
[in]ndimSpace dimension
[in]ntotTotal number of cells in subgrid
[in]nxyzDimensions of the subgrid
[in]iechRank of the sample
[out]indgGrid indices

◆ st_sampling_krige_data()

static Id gstlrn::st_sampling_krige_data ( Db db,
Model model,
double  beta,
1 &  ranks1,
1 &  ranks2,
1 &  rother,
Id ntot_arg,
Id nutil_arg,
1 &  rutil,
1 &  tutil,
1 &  invsig 
)
static

Establishing the kriging system with exact and ACP points

Returns
Error retun code
Parameters
[in]dbDb structure
[in]modelModel structure
[in]betaThresholding value
[in]ranks1Ranks of samples (exact)
[in]ranks2Ranks of samples (ACP)
[in]rotherRanks of the idle samples (modified by routine)
[out]ntot_argNumber of pivots
[out]nutil_argNumber of active samples
[out]rutilRank of the active samples
[out]tutilReturned array for the U array
[out]invsigReturned array for Inverse Sigma

◆ st_scaling()

static double gstlrn::st_scaling ( Id  coor,
Id  scale 
)
static

Internal function to scale the coordinate by the scaling factor

Returns
Scaled value
Parameters
[in]coorInteger value containing the input coordinate
[in]scaleInteger value giving the scale factor

◆ st_seismic_affect()

static void gstlrn::st_seismic_affect ( Db ,
Id  nz,
Id  shift,
double  val_before,
double  val_middle,
double  val_after,
const double *  tab0,
double *  tab1 
)
static

Loads the values of a Db column in the output array Completes undefined values

Parameters
[in]nzNumber of elements in the column
[in]shiftThe shift of the trace before convolution
[in]val_beforeReplacement value for undefined element before first defined sample
[in]val_middleReplacement value for undefined element between defined samples
[in]val_afterReplacement value for undefined element after last defined sample
[in]tab0Input array (Dimension: nz)
[out]tab1Output array (Dimension: nz)

◆ st_seismic_contrast()

static void gstlrn::st_seismic_contrast ( Id  nz,
double *  tab 
)
static

Converts an impedance into a contrast

Parameters
[in]nzNumber of elements in the column
[out]tabOutput array (Dimension: nz)

◆ st_seismic_convolve()

static void gstlrn::st_seismic_convolve ( Id  nx,
Id  ix0,
const double *  x,
Id  ny,
Id  iy0,
const double *  y,
Id  nz,
Id  iz0,
double *  z 
)
static

Compute the convolution of two input vector arrays

Parameters
[in]nxlength of x array
[in]ix0sample index of first x
[in]xarray[nx] to be convolved with y
[in]nylength of y array
[in]iy0sample index of first y
[in]yarray[ny] with which x is to be convolved
[in]nzlength of z array
[in]iz0sample index of first z
[out]zarray[nz] containing x convolved with y
Remarks
The operation z = x convolved with y is defined to be
ix0+nx-1
z[i] = sum x[j]*y[i-j] ; i = iz0,...,iz0+nz-1
j=ix0
The x samples are contained in x[0], x[1], ..., x[nx-1];
likewise for the y and z samples. The sample indices of the
first x, y, and z values determine the location of the origin
for each array. For example, if z is to be a weighted average
of the nearest 5 samples of y, one might use
x[0] = x[1] = x[2] = x[3] = x[4] = 1/5
conv(5,-2,x,ny,0,y,nz,0,z)
In this example, the filter x is symmetric, with index of first
sample = -2.

◆ st_seismic_debug()

static void gstlrn::st_seismic_debug ( Id  rankz,
Id  nz,
double  z0,
double  dz,
Id  rankt,
Id  nt,
double  t0,
double  dt,
double  vmin,
double  vmax 
)
static

Debugging printout for the seismic time-to-depth conversion

Parameters
[in]rankzRank for Depth (0 for Input; 1 for Output)
[in]nznumber of depth samples
[in]z0first depth value
[in]dzdepth sampling interval
[in]ranktRank for Time (0 for Input; 1 for Output)
[in]ntnumber of time samples
[in]t0first time value
[in]dttime sampling interval
[in]vminMinimum velocity value
[in]vmaxMaximum velocity value

◆ st_seismic_operate()

static Id gstlrn::st_seismic_operate ( Db db,
Id  oper,
Id  natt,
Id  nt,
Id  iatt_in,
Id  iatt_out,
double  dt 
)
static

Do unary arithmetic operation on traces

Returns
Error return code
Parameters
[in]dbDb structure
[in]operOperator flag (ENUM_SEISMICS)
[in]nattNumber of seismic attributes
[in]ntNumber of samples on input trace
[in]iatt_inAddress of the first input attribute
[in]iatt_outAddress of the first output attribute
[in]dttime sampling interval
Remarks
Operations inv, slog and slog10 are "punctuated", meaning that if,
the input contains 0 values, 0 values are returned.

◆ st_seismic_t2z_convert()

static void gstlrn::st_seismic_t2z_convert ( DbGrid db_t,
Id  iatt_t,
Id  nt,
double  t0,
double  t1,
double  dt,
DbGrid db_z,
Id  iatt_z,
Id  nz,
double  z0,
double  z1,
double  dz,
DbGrid db_v,
Id  iatt_v,
Id  natt,
double *  tz,
double *  zt,
double *  at,
double *  az 
)
static

Resample from time to depth

Parameters
[in]db_tTime Db
[in]iatt_tAddress of the first variable of the Time Db
[in]ntNumber of meshes of the Time Db
[in]t0First Time
[in]t1Last Time
[in]dtMesh of the Time Db
[in]db_zDepth Db
[in]iatt_zAddress of the first variable of the Depth Db
[in]nzNumber of meshes of the Depth Db
[in]z0First Depth
[in]z1Last Depth
[in]dzMesh of the Depth Db
[in]db_vVelocity Db
[in]iatt_vAddress of the velocity variable in Depth Db
[in]nattNumber of seismic attributes
[out]tzWorking array (dimension: nt)
[out]ztWorking array (dimension: nz)
[out]atWorking array (dimension: nt)
[out]azWorking array (dimension: nz)
Remarks
Linear interpolation and constant extrapolation is used to
determine interval velocities at times not specified.

◆ st_seismic_wavelet()

static gstlrn::st_seismic_wavelet ( Id  verbose,
Id  type,
Id  ntw,
Id  tindex,
double  dt,
double  fpeak,
double  period,
double  amplitude,
double  distort 
)
static

Defining some wavelets for modeling of seimic data

Returns
Array containing the discretized wavelet, allocated here
Dimension = 2 * ntw + 1
Parameters
[in]verbose1 for a verbose output; 0 otherwise
[in]typeType of the wavelet (ENUM_WAVELETS)
[in]ntwhalf-length of the wavelet excluding center (samples)
[in]tindextime index to locate the spike (Spike)
[in]dttime step
[in]fpeakpeak frequency of the Ricker wavelet
[in]periodwavelet period (s) (Ricker)
[in]amplitudewavelet amplitude (Ricker)
[in]distortwavelet distortion factor (Ricker)

◆ st_seismic_z2t_convert()

static void gstlrn::st_seismic_z2t_convert ( DbGrid db_z,
Id  iatt_z,
Id  nz,
double  z0,
double  ,
double  dz,
DbGrid db_t,
Id  iatt_t,
Id  nt,
double  t0,
double  t1,
double  dt,
DbGrid db_v,
Id  iatt_v,
Id  natt,
double *  tz,
double *  zt,
double *  at,
double *  az 
)
static

Resample from depth to time

Parameters
[in]db_zDepth Db
[in]iatt_zAddress of the first variable of the Depth Db
[in]nzNumber of meshes of the Depth Db
[in]z0First Depth
[in]dzMesh of the Depth Db
[in]db_tTime Db
[in]iatt_tAddress of the first variable of the Time Db
[in]ntNumber of meshes of the Time Db
[in]t0First Time
[in]t1Last Time
[in]dtMesh of the Time Db
[in]db_vVelocity Db
[in]iatt_vAddress of the velocity variable in Depth Db
[in]nattNumber of seismic attributes
[out]tzWorking array (dimension: nt)
[out]ztWorking array (dimension: nz)
[out]atWorking array (dimension: nt)
[out]azWorking array (dimension: nz)
Remarks
Linear interpolation and constant extrapolation is used to
determine interval velocities at times not specified.

◆ st_set_bounds()

static void gstlrn::st_set_bounds ( Db db,
Id  flag_one,
Id  ngrf,
Id  nfacies,
Id  ifac,
Id  iech,
double  t1min,
double  t1max,
double  t2min,
double  t2max 
)
static

Define the bounds for Gaussian integrals and store them in relevant variables

◆ st_set_modif()

static void gstlrn::st_set_modif ( Local_CorPgs *  corpgs)
static

Compute the modif matrix

Parameters
[out]corpgsLocal_CorPgs structure

◆ st_set_opt_correl()

static void gstlrn::st_set_opt_correl ( Id  opt,
Local_CorPgs *  corpgs 
)
static

Set the model-type (opt_correl)

Parameters
[in]optThe model-type to set
[out]corpgsLocal_CorPgs structure

◆ st_set_rho()

static void gstlrn::st_set_rho ( double  rho,
Local_Pgs *  local_pgs 
)
static

Modify rho where it is needed

Parameters
[in]rhoRho value
[out]local_pgsLocal_Pgs structure

◆ st_shift()

static void gstlrn::st_shift ( Id  rank,
Db dbgrid,
const 1 &  indg1,
const 1 &  prop,
1 &  indg2,
double *  weight 
)
static

◆ st_simulate_result()

static void gstlrn::st_simulate_result ( DbGrid db,
Id  ix0,
Id  iz0,
ST_Seismic_Neigh ngh,
Id  nbsimu,
Id  ,
Id  nred,
const Id flag,
const double *  wgt,
const double *  rhs,
const double *  c00,
Id iatt_sim 
)
static

Perform the Simulation

Parameters
[in]dbGrid Db structure
[in]ix0Rank of the target trace
[in]iz0Rank of the target sample within the target trace
[in]nghCurrent ST_Seismic_Neigh structure
[in]nbsimuNumber of simulations
[in]nredReduced number of equations
[in]flagArray giving the flag
[in]wgtArray containing the Kriging weights
[in]rhsArray containing the R.H.S. member
[in]c00Array containing the C00 terms
[in]iatt_simArray of pointers to the simulated results

◆ st_simulation_environment()

static void gstlrn::st_simulation_environment ( void  )
static

Initialize the global values

◆ st_solve_hgnc()

static Id gstlrn::st_solve_hgnc ( Id  npar,
const 1 &  grad,
const MatrixSquare gauss,
1 &  hgnc,
Id  flaginvsign 
)
static

Solve the direct minimization problem

Returns
Error return code
Parameters
[in]nparCurrent number of parameters
[in]gradGradient matrix
[in]gaussGauss matrix
[in]hgncResulting hgnc array
[in]flaginvsignif 1, the result is multiplied by -1

◆ st_split_alloc()

static Split * gstlrn::st_split_alloc ( Relem old_relem)
static

◆ st_split_collapse()

static void gstlrn::st_split_collapse ( Split split,
Id  verbose 
)
static

◆ st_split_free()

static Split * gstlrn::st_split_free ( Split split)
static

◆ st_squared_distance()

static double gstlrn::st_squared_distance ( Id  orient,
Id  ndim,
const Id locini,
const Id loccur 
)
static

Calculate the euclidean distance between current and initial seed locations

Returns
Calculated squared distance
Parameters
[in]orientDiffusion orientation (0 or the space rank dimension)
[in]ndimSpace dimension
[in]lociniInitial seed positions
[in]loccurCurrent seed positions

◆ st_store_refpt()

static Id gstlrn::st_store_refpt ( Id  nbrefpt,
RefPt  refpt[3],
Id  iline,
Id  xline,
double  xtrace,
double  ytrace 
)
static

Store an additional reference point

Returns
Number of RefPt already stored
Parameters
[in]nbrefptNumber of RefPt currently allocated
[in]refptArray of RefPt structure pointers
[in]ilineInline number
[in]xlineCrossline number
[in]xtraceCoordinate of the trace along X
[in]ytraceCoordinate of the trace along y

◆ st_subdivide()

void gstlrn::st_subdivide ( double  v1[3],
double  v2[3],
double  v3[3],
Id  depth,
Reg_Coor R_coor 
)

◆ st_subtract_optimal_drift()

static Id gstlrn::st_subtract_optimal_drift ( LMlayers lmlayers,
Id  verbose,
Db dbin,
DbGrid dbout,
1 &  seltab,
1 &  zval 
)
static

Calculate the Drift and subtract it from the Data

Parameters
[in]lmlayersLMlayers structure
[in]verbose1 for a verbose option
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]seltabNumber of sample definition (0, 1 or 2)
[out]zvalThe data vector (Dimension: neq)
Remarks
In the current version, the optimal coefficients of the Drift
are output using the set_keypair mechanism using the keyword:
"Optim_Drift_Coeffs" which returns 'ipos' values

◆ st_suppress_added_samples()

static void gstlrn::st_suppress_added_samples ( Db db,
Id  nech 
)
static

Suppresses the added samples

Parameters
[in]dbDb structure
[in]nechinitial number of samples

◆ st_suppress_unused_constraints()

static Id gstlrn::st_suppress_unused_constraints ( MatrixDense bords,
1 &  ai,
1 &  grad,
MatrixSquare gauss,
1 &  hgnc,
1 &  ind_util,
MatrixDense bords_red,
1 &  ai_red,
1 &  grad_red,
MatrixSquare gauss_red,
1 &  flag1,
1 &  flag2,
1 &  temp 
)
static

Eliminate the useless constraints

Returns
1 if the number of possibilities is reduced down to zero
or when the Generalized Inverse calculation failed
Parameters
[in]bordsArray containing the bounds
[in]aiAI matrix
[in]gradGradient matrix
[in]gaussGaussian matrix
[in]hgnchgnc array
[out]ind_utilList of retained constraint indices
[out]bords_redReduced Bounds array
[out]ai_redReduced AI matrix
[out]grad_redReduced Gradient matrix
[out]gauss_redReduced Gauss matrix
[out]flag1Working array
[out]flag2Working array
[out]tempWorking array

◆ st_surface_identify()

static Id gstlrn::st_surface_identify ( Id  verbOption,
Db surfaces,
const String name_bot,
bool  flag_bot,
Id iatt_bot,
const String name_top,
bool  flag_top,
Id iatt_top,
const String aux_top,
Id iaux_top,
const String aux_bot,
Id iaux_bot 
)
static

Identify Bottom and Top surfaces (if present)

Returns
Error returned code
Parameters
[in]verbOptionVerbose Option
[in]surfacesDb containing the top, Bottom and Reference surfaces This file is optional
[in]name_botName of variable containing the Bottom Surface (or empty)
[in]flag_botFlag for defining a Bottom surface
[in]name_topName of variable containing the Top Surface (or empty)
[in]flag_topFlag for defining a Top surface
[in]aux_topName of the Auxiliary Top variable (optional)
[in]aux_botName of the Auxiliary Bottom variable (optional)
[out]iatt_topAttribute index for the Top surface (or -1)
[out]iatt_botAttribute index for the Bottom surface (or -1)
[out]iaux_topAttribute index for the Top Auxiliary variable (or -1)
[out]iaux_botAttribute index for the Bottom Auxiliary variable (or -1)

◆ st_tableone_getrank()

static void gstlrn::st_tableone_getrank ( const CTables ctables,
double  low,
double  up,
Id indmin,
Id indmax 
)
static

◆ st_tableone_manage()

static void gstlrn::st_tableone_manage ( CTables ctables,
Id  mode,
Id  rank,
Id nb_used,
Id nb_max 
)
static

◆ st_to_f()

static Id gstlrn::st_to_f ( Id  x)
static

Routines for reading / decoding information stored in SEGY file

◆ st_to_i()

static Id gstlrn::st_to_i ( Id  a)
static

◆ st_to_s()

static short gstlrn::st_to_s ( short  x)
static

◆ st_to_u()

static unsigned short gstlrn::st_to_u ( unsigned short  a)
static

◆ st_traceHead_init()

static traceHead gstlrn::st_traceHead_init ( )
static

◆ st_traite()

static Id gstlrn::st_traite ( double *  pt_out,
double *  pt_vois 
)
static

Checks if a current element can be processed according to its neighborhood status

Returns
Flag indicating the end of the procedure:
1 : the current element and its neighboring one have
Remarks
two different status
2 : the maximum reservoir thickness has been reached
Parameters
[in]pt_outpointer to the current element
[in]pt_voispointer to the neighboring element

◆ st_ultimate_regular_grid()

static MeshEStandard * gstlrn::st_ultimate_regular_grid ( Db dbgrid,
Id  ndim,
Id  nmesh,
Id  ncorner,
1 &  meshes,
1 &  order 
)
static

Perform the ultimate task for the regular grid

Returns
Pointer to the newly created MeshEStandard structure
Parameters
[in]dbgridDb structure
[in]ndimSpace dimension
[in]nmeshCurrent number of meshes
[in]ncornerNumber of corner per mesh
[in]meshesInitial array of meshes
[in]orderArray of relative ranks

◆ st_update_bords()

static void gstlrn::st_update_bords ( MatrixDense bords,
1 &  ind_util,
MatrixDense bords_red 
)
static

Update the constraints when no move has been performed

Parameters
[in]bordsArray containing the bounds
[in]ind_utilList of retained constraint indices
[out]bords_redReduced Bounds array

◆ st_update_constraints()

static void gstlrn::st_update_constraints ( Local_CorPgs *  corpgs,
1 &  Grad,
MatrixSymmetric Hess 
)
static

Update the following matrices according to constraints on model

Parameters
[in]corpgsLocal_CorPgs structure
[in,out]GradVector of gradients (Dimension = npar)
[in,out]HessMatrix of Hessian (Dimension = npar * npar)

◆ st_update_constraints_with_JJ()

static void gstlrn::st_update_constraints_with_JJ ( Local_CorPgs *  corpgs,
1 &  Grad,
MatrixSymmetric Hess,
MatrixSymmetric JJ 
)
static

Update the following matrices according to constraints on model

Parameters
[in]corpgsLocal_CorPgs structure
[in,out]GradVector of gradients (Dimension = npar)
[in,out]HessMatrix of Hessian (Dimension = npar * npar)
[in,out]JJMatrix of t(JJ) * JJ (Dimension = npar * npar)

◆ st_update_orientation()

static Id gstlrn::st_update_orientation ( Id  fac0,
Id  igrf_cas,
1 &  fgrf 
)
static

◆ st_update_regression()

static void gstlrn::st_update_regression ( double  x,
double  y,
double *  count,
double *  sum_x,
double *  sum_y,
double *  sum_xx,
double *  sum_xy 
)
static

Update the quantities needed for calculating the linear regression amongst a set of 2-D points

Parameters
[in]xX value
[in]yY value
[in,out]countNumber of samples
[in,out]sum_xSum of the X variable
[in,out]sum_ySum of the Y variable
[in,out]sum_xxSum of the X*X variable
[in,out]sum_xySum of the X*Y variable

◆ st_update_variance_nostat()

static void gstlrn::st_update_variance_nostat ( Local_Pgs *  local_pgs)
static

Establish the theoretical variance of the simple and cross-variograms of the indicators in the non-stationary case

Parameters
[in]local_pgsLocal_Pgs structure

◆ st_update_variance_stat()

static void gstlrn::st_update_variance_stat ( Local_Pgs *  local_pgs)
static

Establish the theoretical variance of the simple and cross-variograms of the indicators in the stationary case

Parameters
[in]local_pgsLocal_Pgs structure

◆ st_updiff()

static void gstlrn::st_updiff ( Id  orient,
Id  ndim,
Id  ntot,
Id  nseed,
Id  niter,
Id  n_nbgh,
Id  flag_save,
double  probtot,
Id nxyz,
Id nbgh,
Id tabini,
Id tabcur,
Id tabwrk,
double *  valwrk,
double *  valtab0,
Id  verbose,
double *  cvdist2,
double *  trsave 
)
static

Calculate the average squared distance as a function of the iteration

Parameters
[in]orientDiffusion orientation (0 or the space rank dimension)
[in]ndimSpace dimension
[in]ntotTotal number of cells in the subgrid
[in]nseedNumber of seeds
[in]niterNumber of iterations
[in]n_nbghNumber of neighboring cells
[in]flag_saveIf the array must be saved for keypair
[in]probtotTotal probability of joins
[in]nxyzDimensions of the subgrid
[in]nbghArray giving the neighboring cell location
[in]tabiniArray of initial seed positions Dimension: nseed * ndim
[in]tabcurArray of current seed positions Dimension: nseed * ndim
[in]tabwrkArray of shifted seed positions Dimension: ndim
[in]valwrkWorking array Dimension: n_nbgh
[in]valtab0Array containing the sample value
[in]verboseVerbose option
[out]cvdist2Array of squared distances by iteration
[out]trsaveArray of trajectories (saved only if defined)
Remarks
If the starting position is fixed, it is specified using: set_keypair("Fixed_Position",...)

◆ st_upscale()

static void gstlrn::st_upscale ( Id  orient,
Id nxyz,
Id  flag_save,
double *  numtab0,
double *  numtab1,
double *  numtab2,
double *  valtab0,
double *  valtab1,
double *  valtab2,
double *  res1,
double *  res2 
)
static

Upscale the variable defined on a subgrid into one value

Parameters
[in]orientUpscaling orientation (0 to 2)
[in]nxyzDimensions of the subgrid
[in]flag_saveIf the array must be saved for keypair
[out]numtab0Array containing the sample count
[out]numtab1Array containing the sample count
[out]numtab2Array containing the sample count
[out]valtab0Array containing the sample value
[out]valtab1Array containing the sample value
[out]valtab2Array containing the sample value
[out]res1First result (Harmonic first)
[out]res2First result (Arithmetic first)

◆ st_varcalc_correlated_grf()

static double gstlrn::st_varcalc_correlated_grf ( Local_Pgs *  local_pgs,
Id  idir 
)
static

Evaluate the variogram of the underlying GRFs (assuming the two GRFs of the PGS model are correlated)

Parameters
[in]local_pgsLocal_Pgs structure
[in]idirRank of the direction

◆ st_varcalc_from_vario_stat()

static Id gstlrn::st_varcalc_from_vario_stat ( Vario vario,
Local_Pgs *  local_pgs,
Id  ngrf 
)
static

Performing the variogram calculations (stationary case)

Returns
Error return code
Parameters
[in]varioVario structure for the GRFs to be filled
[in]local_pgsLocal_Pgs structure
[in]ngrfNumber of GRFs

◆ st_varcalc_uncorrelated_grf()

static void gstlrn::st_varcalc_uncorrelated_grf ( Local_Pgs *  local_pgs,
Id  idir 
)
static

Evaluate the variogram of one underlying GRF

Parameters
[in]local_pgsLocal_Pgs structure
[in]idirRank of the direction

◆ st_vario_dump()

static void gstlrn::st_vario_dump ( FILE *  file,
Id  ix0,
Id  iy0,
const Id  cov_ss[3],
const Id  cov_nn[3],
const Id num_tot,
const double *  cov_tot 
)
static

Dump the contents of the covariance maps

Parameters
[in]fileFILE structure where the dmp must be produced
[in]ix0Rank of the trace along X (-1 for the reference)
[in]iy0Rank of the trace along Y (-1 for the reference)
[in]cov_ssArray of dimensions of the Covariance array
[in]cov_nnArray of radius of the Covariance array
[out]num_totArray containing the numb er of pairs
[out]cov_totArray containing the covariance of the total variable

◆ st_vario_indic_model_nostat()

static Id gstlrn::st_vario_indic_model_nostat ( Local_Pgs *  local_pgs)
static

Performing the variogram calculations in the non-stationary case

Returns
Error return code
Parameters
[in]local_pgsLocal_Pgs structure

◆ st_vario_indic_model_stat()

static Id gstlrn::st_vario_indic_model_stat ( Local_Pgs *  local_pgs)
static

Performing the variogram calculations in the stationary case

Returns
Error return code
Parameters
[in]local_pgsLocal_Pgs structure

◆ st_vario_pgs_check()

static Id gstlrn::st_vario_pgs_check ( Id  flag_db,
Id  flag_rule,
Id  flag_varioind,
Db db,
const Db dbprop,
const Vario vario,
Vario varioind,
const Rule rule 
)
static

Check that the arguments are correct

Returns
Error return code
Parameters
[in]flag_db1 if the input Db must be provided -1 if it is optional 0 if the Db is not tested
[in]flag_rule1 if the Rule must be defined
[in]flag_varioind1 if the Indicator Variogram must be defined
[in]dbDb structure
[in]dbpropDb Grid used for proportions (non-stationary)
[in]varioVario structure for the GRFs to be filled
[in]varioindVario structure for Indicator
[in]ruleLithotype Rule definition

◆ st_vario_pgs_variable()

static Id gstlrn::st_vario_pgs_variable ( Id  mode,
Id  ngrf,
Id  nfacies,
Id  flag_one,
Id  flag_prop,
Db db,
PropDef propdef,
const Rule rule 
)
static

Manage local variables for variopgs calculation (Non-stationary case)

Returns
Error return code
Parameters
[in]modeType of usage 1 for allocation 0 for valuation (rule dependent) -1 for deallocation
[in]ngrfNumber of grfs
[in]nfaciesNumber of facies
[in]flag_one1 for considering only the Facies at data point 0 for considering all facies
[in]flag_prop1 for allocating variable for proportions
[in]dbDb structure
[in]propdefPropDef structure
[in]ruleLithotype Rule definition

◆ st_varioexp_chh()

static Id gstlrn::st_varioexp_chh ( LMlayers lmlayers,
Id  verbose,
Db dbin,
DbGrid dbout,
Vario_Order vorder,
1 &  zval,
Id  idir,
Vario vario 
)
static

Calculate the variogram for each lag per direction

Returns
Error return code
Parameters
[in]lmlayersLMlayers structure
[in]verbose1 for a verbose option
[in]dbinInput Db structure
[in]dboutOutput Db structure
[in]vorderVario_Order structure
[in]zvalData vector
[in]idirRank of the Direction
[out]varioVario structure

◆ st_variogram_define_vars()

static void gstlrn::st_variogram_define_vars ( Vario vario,
const Rule rule,
Id  ngrf 
)
static

Establish the array of variances

Parameters
[in,out]varioVario structure for the GRFs to be filled
[in]ruleLithotype Rule definition
[in]ngrfNumber of GRFs

◆ st_variogram_geometry_pgs_calcul()

static Id gstlrn::st_variogram_geometry_pgs_calcul ( Local_Pgs *  local_pgs,
Vario vario,
Id  idir 
)
static

Determine the Geometry of all pairs

Returns
Error return code
Parameters
[in]local_pgsLocal_Pgs structure
[in]varioVario structure
[in]idirRank of the direction

◆ st_variogram_geometry_pgs_correct()

static void gstlrn::st_variogram_geometry_pgs_correct ( Local_Pgs *  local_pgs,
Vario vario,
Id  idir 
)
static

Correct the experimental variogram for GRFs

Parameters
[in]local_pgsLocal_Pgs structure
[in]varioVario structure
[in]idirRank of the direction

◆ st_variogram_geometry_pgs_final()

static Id gstlrn::st_variogram_geometry_pgs_final ( Local_Pgs *  local_pgs)
static

Compress the Geometry of all pairs

Returns
Error return code
Parameters
[in]local_pgsLocal_Pgs structure

◆ st_variogram_patch_C00()

static void gstlrn::st_variogram_patch_C00 ( Local_Pgs *  local_pgs,
Vario vario,
Id  idir,
double  rho 
)
static

Patch the central value (dist=0) of the covariances

Parameters
[in]local_pgsLocal_Pgs structure
[in]varioVario structure for the GRFs to be filled
[in]idirRank of the direction
[in]rhoCorrelation coefficient

◆ st_variogram_pgs_nostat()

static Id gstlrn::st_variogram_pgs_nostat ( Db db,
const Db dbprop,
Vario vario,
const Rule rule,
const 1 &  propcst,
Id  flag_rho,
Id  opt_correl 
)
static

Calculate the gaussian variograms

Returns
Error return code
Parameters
[in]dbDb structure
[in]dbpropDb Grid used for proportions (non-stationary)
[in]varioVario structure for the GRFs to be filled
[in]ruleLithotype Rule definition
[in]propcstArray of proportions for the facies
[in]flag_rho1 if the correlation coefficient must be regressed
[in]opt_correl0 full model; 1 symmetrical; 2 residuals

◆ st_variogram_pgs_stat()

static Id gstlrn::st_variogram_pgs_stat ( Db db,
Vario vario,
Vario varioind,
const Rule rule,
const 1 &  propcst 
)
static

Calculate the gaussian variograms in the stationary case

Returns
Error return code
Parameters
[in]dbDb structure (for Space dimension)
[in]varioVario structure for the GRFs to be filled
[in]varioindIndicator Vario structure
[in]ruleLithotype Rule definition
[in]propcstArray of proportions for the facies

◆ st_variogram_scale()

static void gstlrn::st_variogram_scale ( Vario vario,
Id  idir 
)
static

Scale the variogram calculations

Parameters
[in]varioVario structure
[in]idirRank of the Direction

◆ st_variopgs_calcul_norho()

static Id gstlrn::st_variopgs_calcul_norho ( Vario vario,
const Rule rule,
Local_Pgs *  local_pgs,
Id  ngrf,
Id  opt_correl,
Id  flag_geometry 
)
static

Performing the variogram calculations

Returns
Error return code
Parameters
[in]varioVario structure for the GRFs to be filled
[in]ruleLithotype Rule definition
[in]local_pgsLocal_Pgs structure
[in]ngrfNumber of GRFs
[in]opt_correl0 full model; 1 symetrical; 2 residuals
[out]flag_geometry1 if Geometry must be established per direction 0 if Geometry is already calculated before calling this function

◆ st_variopgs_calcul_rho()

static Id gstlrn::st_variopgs_calcul_rho ( Vario vario,
const Rule rule,
Local_Pgs *  local_pgs,
Id  ngrf,
Id  opt_correl 
)
static

Performing the variogram calculations (in the case of flag.rho)

Returns
Error return code
Parameters
[in]varioVario structure for the GRFs to be filled
[in]ruleLithotype Rule definition
[in]local_pgsLocal_Pgs structure
[in]ngrfNumber of GRFs
[in]opt_correl0 full model; 1 symetrical; 2 residuals

◆ st_velocity_minmax()

static Id gstlrn::st_velocity_minmax ( Id  nech,
double *  vv,
double *  v0,
double *  v1,
double *  vmin,
double *  vmax 
)
static

Calculate the extrema of the velocity array vv[]

Returns
Error return code
Parameters
[in]nechNumber of samples in the array vv[]
[in]vvArray of interest
[out]v0Initial velocity value
[out]v1Last velocity value
[out]vminMinimum value
[out]vmaxMaximum value

◆ st_verify_refpt()

static void gstlrn::st_verify_refpt ( RefPt  refpt[3],
RefStats refstats,
Id  nbrefpt,
double  x0,
double  y0,
double  dx,
double  dy,
double  sint,
double  cost 
)
static

Check that calculations are correct

Parameters
[in]refptArray of RefPt structure pointers
[in]refstatsStructure for Statistics
[in]nbrefptNumber of reference points
[in]x0Origin of the grid along X
[in]y0Origin of the grid along Y
[in]dxMesh of the grid along X
[in]dyMesh of the grid along Y
[in]sintSine of the rotation angle
[in]costCosine of the rotation angle
Remarks
The internal flag debug must be set to 1 to perform this task

◆ st_weights()

static void gstlrn::st_weights ( double  table[][LTABLE])
static

Interpolation of a uniformly-sampled real function y(x) via a table of 8-coefficient sinc approximations

Parameters
[out]tablearray of weights

◆ st_wgt_print()

static void gstlrn::st_wgt_print ( ST_Seismic_Neigh ngh,
Id  nvar,
Id  nech,
Id  nred,
const Id flag,
const double *  wgt 
)
static

Print the kriging weights

Parameters
[in]nghST_Seismic_Neigh structure
[in]nvarNumber of variables
[in]nechNumber of active points
[in]nredReduced number of equations
[in]flagFlag array
[in]wgtArray of Kriging weights

◆ st_within_layer()

static bool gstlrn::st_within_layer ( double  z0,
double  delta,
double  cztop,
double  czbot,
double  cote,
Id  option,
Id  nz,
Id iz1_ret,
Id iz2_ret,
double *  cote_ret 
)
static

Get the vertical limits in indices Check if the target elevation 'cote' belongs to the layer If True, returns the starting and ending index

Parameters
z0Origin of the Elevations
deltaElevation increment
cztopTop bound
czbotBottom bound
coteTarget elevation
optionStretching option
nzNumber of meshes of the layer
iz1_retReturned starting index
iz2_retReturned ending index
cote_retReturelevation (expressed in the layer system (possibly stretched)
Returns
True if the target elevation belongs to the layer

◆ st_write_active_sample()

static void gstlrn::st_write_active_sample ( Db db,
Id  iech,
Id  nvar,
Id iatt,
double *  tab 
)
static

Write a sample in the output file

Parameters
[in]dbDb characteristics
[in]iechRank of the sample
[in]nvarNumber of attributes
[in]iattArray of the output attribute
[in]tabArray of values

◆ st_yxtoxy()

static void gstlrn::st_yxtoxy ( Id  nx,
double  dx,
double  x0,
const double *  y,
Id  ny,
double  dy,
double  y0,
double  xylo,
double  xyhi,
double *  x 
)
static

Compute regularly-sampled monotonically increasing function x(y) from regularly-sampled monotonically increasing function y(x) by inverse linear interpolation

Parameters
[in]nxnumber of samples of y(x)
[in]dxx sampling interval; dx>0.0 is required
[in]x0first x
[in]yarray[nx] of y(x) values; y[0] < ... < y[nx-1] required
[in]nynumber of samples of x(y)
[in]dyy sampling interval; dy>0.0 is required
[in]y0first y
[in]xylox value assigned to x(y) when y is less than smallest y(x)
[in]xyhix value assigned to x(y) when y is greater than largest y(x)
[out]xarray[ny] of x(y) values

◆ statisticsProportion()

Id gstlrn::statisticsProportion ( DbGrid dbin,
DbGrid dbout,
Id  pos,
Id  nfacies,
Id  radius 
)

Calculates the "montee" from a grid into a 1-D grid

Returns
Error return code
Parameters
[in]dbinDb for the input grid
[in]dboutDb for the output grid
[in]posRank of the montee axis (starting from 0)
[in]nfaciesNumber of facies
[in]radiusRadius of the neighborhood

◆ statisticsTransition()

Id gstlrn::statisticsTransition ( DbGrid dbin,
DbGrid dbout,
Id  pos,
Id  nfacies,
Id  radius,
Id  orient 
)

Calculates the transition from a grid into a 1-D grid

Returns
Error return code
Parameters
[in]dbinDb for the input grid
[in]dboutDb for the output grid
[in]posRank of the montee axis (starting from 0)
[in]nfaciesNumber of facies
[in]radiusRadius of the neighborhood
[in]orientOrientation (+1 or -1)

◆ statOptionToName()

VectorString gstlrn::statOptionToName ( const std::vector< EStatOption > &  opers)

◆ stats_residuals()

Id gstlrn::stats_residuals ( Id  verbose,
Id  nech,
const double *  tab,
Id  ncut,
double *  zcut,
Id nsorted,
double *  mean,
double *  residuals,
double *  T,
double *  Q 
)

Create residuals

Returns
Error returned code
Parameters
[in]verboseVerbose flag
[in]nechNumber of samples
[in]tabArray of sample values (Dimension: nech)
[in]ncutNumber of cutoffs
[in]zcutArray of cutoff values (Dimension: ncut)
[out]nsortedNumber of sorted samples
[out]meanAverage of the active data
[out]residualsArray of residuals (Dimension: ncut * nech)
[out]TArray of for tonnage
[out]QArray of for metal quantity

◆ stoepd()

static void gstlrn::stoepd ( Id  n,
const double *  r,
const double *  g,
double *  f,
double *  a 
)
static

Solve a symmetric Toeplitz linear system of equations Rf=g for f

Parameters
[in]ndimension of system
[in]rarray[n] of top row of Toeplitz matrix
[in]garray[n] of right-hand-side column vector
[out]farray[n] of solution (left-hand-side) column vector
[out]aarray[n] of solution to Ra=v (Claerbout, FGDP, p. 57)
Remarks
This routine does NOT solve the case when the main diagonal is
zero, it just silently returns.
The left column of the Toeplitz matrix is assumed to be equal to
the top row (as specified in r); i.e., the Toeplitz matrix is
assumed symmetric.

◆ string_strip_blanks()

void gstlrn::string_strip_blanks ( char *  string,
Id  flag_lead 
)

Strip the blanks from a string

Parameters
[in,out]stringString to be cleaned
[in]flag_lead1 to strip only the leading blanks

◆ string_strip_quotes()

void gstlrn::string_strip_quotes ( char *  string)

Strip the leading and trailing quotes from a string

Parameters
[in,out]stringString to be cleaned
Remarks
The quote is searched in first position. If not found, nothing done
If found, the trailing quote is stripped, if similar to the first
character

◆ substitution()

Id gstlrn::substitution ( DbGrid dbgrid,
SimuSubstitutionParam subparam,
Id  seed = 43242,
Id  verbose = false,
const NamingConvention namconv = NamingConvention("SimSub") 
)

◆ swap()

void gstlrn::swap ( Id arr,
Id  i1,
Id  i2 
)

◆ t_1d()

static Id gstlrn::t_1d ( Id  x,
Id  y,
Id  z,
double  t0,
double  hs0,
double  hs1,
double  hs2,
double  hs3 
)
static

◆ t_2d()

static Id gstlrn::t_2d ( Id  x,
Id  y,
Id  z,
double  t0,
double  t1,
double  hs0,
double  hs1 
)
static

◆ t_3d_()

static Id gstlrn::t_3d_ ( Id  x,
Id  y,
Id  z,
double  t0,
double  tl,
double  tr,
double  td,
double  hs0,
Id  redundant 
)
static

◆ t_3d_part1()

static Id gstlrn::t_3d_part1 ( Id  x,
Id  y,
Id  z,
double  t0,
double  tl,
double  tr,
double  hs0 
)
static

◆ tab_print_rc()

void gstlrn::tab_print_rc ( const char *  title,
Id  mode,
Id  value,
Id  ncol,
const EJustify &  justify 
)

Tabulated printout of a row or column value

Parameters
[in]titleoptional title (NULL if not defined)
[in]modeCASE_ROW or CASE_COL
[in]valueValue to be written
[in]ncolnumber of columns for the printout
[in]justifyjustification flag (EJustify::LEFT, EJustify::CENTER or EJustify::RIGHT)

◆ tab_print_rowname()

void gstlrn::tab_print_rowname ( const char *  string,
Id  taille 
)

Tabulated printout of a string (character size provided)

Parameters
[in]stringString to be written
[in]tailleNumber of characters
Remarks
The string is printed (left-adjusted) on 'taille' characters

◆ tab_printd()

void gstlrn::tab_printd ( const char *  title,
double  value,
Id  ncol,
const EJustify &  justify 
)

Tabulated printout of a double value

Parameters
[in]titleoptional title (NULL if not defined)
[in]valueValue to be written
[in]ncolnumber of columns for the printout
[in]justifyjustification flag (EJustify::LEFT, EJustify::CENTER or EJustify::RIGHT)

◆ tab_printg()

void gstlrn::tab_printg ( const char *  title,
double  value,
Id  ncol,
const EJustify &  justify 
)

Tabulated printout of a real value

Parameters
[in]titleoptional title (NULL if not defined)
[in]valueValue to be written
[in]ncolnumber of columns for the printout
[in]justifyjustification flag (EJustify::LEFT, EJustify::CENTER or EJustify::RIGHT)

◆ tab_printi()

void gstlrn::tab_printi ( const char *  title,
Id  value,
Id  ncol,
const EJustify &  justify 
)

Tabulated printout of an integer value

Parameters
[in]titleoptional title (NULL if not defined)
[in]valueValue to be written
[in]ncolnumber of columns for the printout
[in]justifyjustification flag (EJustify::LEFT, EJustify::CENTER or EJustify::RIGHT)

◆ tab_prints()

void gstlrn::tab_prints ( const char *  title,
const char *  string,
Id  ncol,
const EJustify &  justify 
)

Tabulated printout of a string

Parameters
[in]titleoptional title (NULL if not defined)
[in]stringString to be written
[in]ncolnumber of columns for the printout
[in]justifyjustification flag (EJustify::LEFT, EJustify::CENTER or EJustify::RIGHT)

◆ tessellation_poisson()

Id gstlrn::tessellation_poisson ( DbGrid dbgrid,
Model model,
const SimuPartitionParam parparam,
Id  seed = 432432,
Id  verbose = false,
const NamingConvention namconv = NamingConvention(                                           "Poisson") 
)

◆ tessellation_voronoi()

Id gstlrn::tessellation_voronoi ( DbGrid dbgrid,
Model model,
const SimuPartitionParam parparam,
Id  seed = 43243,
Id  verbose = false,
const NamingConvention namconv = NamingConvention(                                           "Voronoi") 
)

◆ test_neigh()

Id gstlrn::test_neigh ( Db dbin,
Db dbout,
ModelGeneric model,
ANeigh neigh,
const NamingConvention namconv 
)

Check the Neighborhood

Returns
Error return code (0: success, 1: error)
Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure
[in]modelModelGeneric structure (optional)
[in]neighANeigh structure
[in]namconvNaming Convention
Remarks
This procedure creates the following arrays:
1 - The number of selected samples
2 - The maximum neighborhood distance
3 - The minimum neighborhood distance
4 - The number of non-empty sectors
5 - The number of consecutive empty sectors

◆ throw_exp()

void gstlrn::throw_exp ( const std::string &  msg = "",
const std::string &  file = "",
Id  line = 0 
)

◆ time_3db()

Id gstlrn::time_3db ( double *  HS,
double *  T,
Id  NX,
Id  NY,
Id  NZ,
Id  BX,
Id  BY,
Id  BZ,
double  XS,
double  YS,
double  ZS,
double  HS_EPS_INIT,
Id  MSG 
)

◆ toDouble() [1/2]

double gstlrn::toDouble ( const String v,
char  dec = '.' 
)

◆ toDouble() [2/2]

String gstlrn::toDouble ( double  value,
const EJustify &  justify = EJustify::fromKey("RIGHT") 
)

◆ toInt()

String gstlrn::toInt ( Id  value,
const EJustify &  justify = EJustify::fromKey("RIGHT") 
)

◆ toInteger()

Id gstlrn::toInteger ( const String v)

Decode an integer from a string. Returns ITEST if impossible

Parameters
vString to be decoded
Returns
The integer value or ITEST (in case of failure)

◆ toInterval()

String gstlrn::toInterval ( double  zmin,
double  zmax 
)

◆ toLower() [1/2]

String gstlrn::toLower ( const std::string_view  string)

◆ toLower() [2/2]

void gstlrn::toLower ( String string)

◆ toMatrix() [1/3]

String gstlrn::toMatrix ( const String title,
const AMatrix mat,
bool  flagOverride,
bool  flagSkipZero 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Print the contents of a VectorDouble in a Matrix Form

Parameters
titleTitle of the printout
matContents of a AMatrix
flagOverridetrue to override printout limitations
flagSkipZerowhen true, skip the zero values (represented by a '.' as for sparse matrix) always true for sparse matrix

◆ toMatrix() [2/3]

String gstlrn::toMatrix ( const String title,
const VectorString colnames,
const VectorString rownames,
bool  bycol,
Id  nrows,
Id  ncols,
const 1 &  tab,
bool  flagOverride = false,
bool  flagSkipZero = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Print the contents of a VectorDouble in a Matrix Form

Parameters
titleTitle of the printout
colnamesNames of the columns (optional)
rownamesNames of the rows (optional)
bycoltrue if values as sorted by column; false otherwise
nrowsNumber of rows
ncolsNumber of columns
tabVectorInt containing the values
flagOverridetrue to override printout limitations
flagSkipZerowhen true, skip the zero values (represented by a '.' as for sparse matrix)

◆ toMatrix() [3/3]

String gstlrn::toMatrix ( const String title,
const VectorString colnames,
const VectorString rownames,
bool  bycol,
Id  nrows,
Id  ncols,
const double *  tab,
bool  flagOverride,
bool  flagSkipZero 
)
  • Print the contents of a VectorDouble in a Matrix Form This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
    Parameters
    titleTitle of the printout
    colnamesNames of the columns (optional)
    rownamesNames of the rows (optional)
    bycoltrue if values as sorted by column; false otherwise
    nrowsNumber of rows
    ncolsNumber of columns
    tabVectorDouble containing the values
    flagOverridetrue to override printout limitations
    flagSkipZerowhen true, skip the zero values (represented by a '.' as for sparse matrix)

◆ toStr()

String gstlrn::toStr ( const String string,
const EJustify &  justify = EJustify::fromKey("RIGHT"),
Id  localSize = 0 
)

◆ toString() [1/2]

String gstlrn::toString ( double  value)

◆ toString() [2/2]

String gstlrn::toString ( Id  value)

◆ toTitle()

String gstlrn::toTitle ( Id  level,
const char *  format,
  ... 
)

Print a message and underlines it with various formats

Parameters
levelLevel of the title
formatOutput format
...Additional arguments

◆ toUpper() [1/2]

String gstlrn::toUpper ( const std::string_view  string)

◆ toUpper() [2/2]

void gstlrn::toUpper ( String string)

◆ toVector() [1/3]

String gstlrn::toVector ( const String title,
const 1 &  tab,
bool  flagOverride = true 
)

◆ toVector() [2/3]

String gstlrn::toVector ( const String title,
const VectorString tab,
bool  flagOverride = true 
)

Printout a vector in a formatted manner

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
titleTitle of the printout (or empty string)
tabVector (string values) to be printed
flagOverridetrue to override printout limitations
Returns
The string (terminated with a newline)

◆ toVector() [3/3]

String gstlrn::toVector ( const String title,
constvect  tab,
bool  flagOverride = true 
)

Printout a vector in a formatted manner

Parameters
titleTitle of the printout (or empty string)
tabVector (real values) to be printed
flagOverridetrue to override printout limitations
Returns
The string (terminated with a newline)

◆ toVectorDouble()

VectorString gstlrn::toVectorDouble ( const 1 &  values,
const EJustify &  justify = EJustify::fromKey("RIGHT") 
)

◆ TR_IN()

static double gstlrn::TR_IN ( Db db,
Id  iatt_in,
Id  iatt,
Id  itrace,
Id  it 
)
static

Local function to read the Data Base

Returns
Returned value
Parameters
[in]dbDb structure
[in]iatt_inAddress of the first input attribute
[in]iattRank of the internal attribute
[in]itraceRank of the trace
[in]itRank of the sample on the trace

◆ TR_OUT()

static void gstlrn::TR_OUT ( Db db,
Id  iatt_out,
Id  iatt,
Id  itr,
Id  it,
double  value 
)
static

Local function to write into the Data Base

Parameters
[in]dbDb structure
[in]iatt_outAddress of the first input attribute
[in]iattRank of the internal attribute
[in]itrRank of the trace
[in]itRank of the sample on the trace
[in]valueValue to be stored

◆ trace_add_row()

static void gstlrn::trace_add_row ( Local_Pgs *  local_pgs)
static

Add a new row to the trace

Parameters
[in]local_pgsLocal_Pgs structure

◆ trace_define()

static void gstlrn::trace_define ( Local_Pgs *  local_pgs,
double  value0,
double  value1,
Id  origin,
Id  number,
const double *  values 
)
static

Update the Trace array

Parameters
[in]local_pgsLocal_Pgs structure
[in]value0First value in a Trace row
[in]value1Second value in a Trace row
[in]originOrigin for values in record (after 2 heading values)
[in]numberNumber of values assigned
[in]valuesArray of values assigned

◆ trendSPDE()

gstlrn::trendSPDE ( Db dbin,
Model model,
Id  useCholesky,
const VectorMeshes meshesK,
const ProjMultiMatrix projInK,
const SPDEParam params,
bool  verbose 
)

Derive the global trend in the SPDE framework

Parameters
dbinInput Db (must contain the variable to be estimated)
modelModel definition
useCholeskyDefine the choice regarding Cholesky (see _defineCholesky)
meshesKMeshes description (optional)
projInKMatrix of projection (optional)
paramsSet of SPDE parameters
verboseVerbose flag
Returns
Returned vector

◆ trim()

String gstlrn::trim ( const String s,
const String t = SPACES 
)

◆ trimLeft()

String gstlrn::trimLeft ( const String s,
const String t = SPACES 
)

◆ trimRight()

String gstlrn::trimRight ( const String s,
const String t = SPACES 
)

◆ truncateDecimals()

double gstlrn::truncateDecimals ( double  value,
Id  ndec 
)

Rounding a double to a given number of decimals (from: https://stackoverflow.com/questions/304011/truncate-a-decimal-value-in-c/304013#304013)

Parameters
valueValue to be rounded up
ndecNumber of significant decimals

◆ truncateDigits()

double gstlrn::truncateDigits ( double  value,
Id  ndigits 
)

Rounding a double to a given number of decimals

Parameters
valueValue to be rounded up
ndigitsNumber of significant digits

◆ UniformConditioning()

Id gstlrn::UniformConditioning ( Db db,
AAnam anam,
Selectivity selectivity,
const String name_est,
const String name_varz,
const NamingConvention namconv 
)

Calculate the Uniform Conditioning

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]anamPoint anamorphosis
[in]selectivitySelectivity structure
[in]name_estName of the Kriging estimate
[in]name_varzName of the Variance of Kriging estimate
[in]namconvNaming Convention
Remarks
We need the variance of Estimation Error... even if it will be
temporarily stored in a member names iptrStd.

◆ ut_chebychev_coeffs()

Id gstlrn::ut_chebychev_coeffs ( double(*)(double, double, const 1 &)  func,
Cheb_Elem cheb_elem,
const 1 &  blin 
)

Calculates the coefficients of the Chebychev polynomial which is an approximation of a given function

Returns
Error return code
Parameters
[in]funcFunction to be approximated
[in]cheb_elemCheb_Elem structure
[in]blinArray of coefficients for polynomial expansion

◆ ut_chebychev_count()

Id gstlrn::ut_chebychev_count ( double(*)(double, double, const 1 &)  func,
Cheb_Elem cheb_elem,
double  x,
const 1 &  blin 
)

Evaluate the number of coefficients necessary to evaluate a function (at a sample location) at a given approximation

Returns
Minimum number of necessary coefficients
Parameters
[in]funcFunction to be approximated
[in]cheb_elemCheb_Elem structure
[in]xSampling value
[in]blinArray of coefficients for polynomial expansion

◆ ut_classify()

void gstlrn::ut_classify ( Id  nech,
const double *  tab,
double *  sel,
Id  nclass,
double  start,
double  pas,
Id nmask,
Id ntest,
Id nout,
Id classe 
)

Classify the samples into integer sieves

Parameters
[in]nechNumber of samples
[in]tabArray of values
[in]selArray containing the Selection or NULL
[in]nclassNumber of sieve classes
[in]startStarting sieve value
[in]pasWidth of the sieve
[out]nmaskNumber of masked values
[out]ntestNumber of undefined values
[out]noutNumber of values outside the classes
[out]classeArray for number of samples per sieve

◆ ut_cnp()

double gstlrn::ut_cnp ( Id  n,
Id  k 
)

Compute combinations(n,k)

Returns
Return the number of combinations of 'k' objects amongst 'n'
Parameters
[in]nTotal number of objects (>= 1)
[in]kSelected number of objects (>= 1)

◆ ut_combinations()

gstlrn::ut_combinations ( Id  n,
Id  maxk,
Id ncomb 
)

Return all the combinations of k within n

Returns
Return all the combinations of 'k' objects amongst 'n'
Parameters
[in]nTotal number of objects (>1)
[in]maxkSelected number of objects (1<=maxk<n)
[out]ncombNumber of combinations
Remarks
The calling function must free the returned array.

◆ ut_deg2rad()

double gstlrn::ut_deg2rad ( double  angle)

Translates from degree to radian

Parameters
[in]angleAngle in degrees

◆ ut_distance()

double gstlrn::ut_distance ( Id  ndim,
const double *  tab1,
const double *  tab2 
)

Calculate the distance between two endpoints

Returns
Distance value (or TEST if a coordinate is not defined)
Parameters
[in]ndimSpace dimension
[in]tab1Array corresponding to the first endpoint
[in]tab2Array corresponding to the second endpoint

◆ ut_distance_allocated()

void gstlrn::ut_distance_allocated ( Id  ndim,
double **  tab1,
double **  tab2 
)

Allocate the necessary arrays for calculating distances using already allocated arrays

Parameters
[in]ndimSpace dimension
[out]tab1Array for coordinates of first sample
[out]tab2Array for coordinates of second sample

◆ ut_facies_statistics()

void gstlrn::ut_facies_statistics ( Id  nech,
double *  tab,
double *  sel,
Id nval,
Id mini,
Id maxi 
)

Returns the statistics of an array containing the facies

Parameters
[in]nechNumber of samples
[in]tabArray of values
[in]selArray containing the Selection or NULL
[out]nvalNumber of active values
[out]miniMinimum value
[out]maxiMaximum value

◆ ut_factorial()

double gstlrn::ut_factorial ( Id  k)

Calculates the factorial coefficient

Returns
Returned value
Parameters
[in]kValue

◆ ut_flegendre()

double gstlrn::ut_flegendre ( Id  n,
Id  k0,
double  theta,
bool  flagNorm 
)

Returns the Spherical Legendre normalized function. According to boost Library documentation, this returns

Y_n^m(theta, phi) = sqrt{{(2n+1)(n-m)!} / {4pi(n+m)!}} P_n^m(cos(theta))e{imphi}

with phi=0 and m = |k0|

If flagNorm is switched ON, the previous result is multiplied by:

sqrt(2 * pi)

Parameters
[in]nDegree
[in]k0Order (ABS(k0) <= n)
[in]thetaTheta angle in radian
[in]flagNormfor normalized and 0 otherwise

◆ ut_icosphere()

Id gstlrn::ut_icosphere ( Id  n,
Id  flag_rot,
Id ntri_arg,
1 &  coord 
)

Generate regular Icosahedron discretization

Returns
Error return code
Parameters
[in]nNumber of discretization steps
[in]flag_rotPerform a random rotation
[out]ntri_argNumber of points
[out]coordArray of point coordinates (Dimension: 3*ntri)
Remarks
As random number are used in this function, a specific seed
is fixed here

◆ ut_legendre()

double gstlrn::ut_legendre ( Id  n,
double  v,
bool  flagNorm 
)

Returns the Legendre Function described as follows:

legendre_p(n,v) = 1/{2^n n!) d^n/dx^n [x^2-1)^n with |x|<=1

If flagNorm is switched ON, the Boost library cannot be used anymore. We have to rely on the ode provided by X; Freulon.

Parameters
[in]nDegree of the Legendre Polynomial to be computed (n >= 0)
[in]vValue for which the polynomial is evaluated (-1 <= v <= 1)
[in]flagNormTrue for normalized and 0 otherwise
Returns
Value of the Legendre polynomial.

◆ ut_legendreAssociatedMat()

MatrixDense gstlrn::ut_legendreAssociatedMat ( Id  l,
const 1 &  v,
bool  flagNorm 
)

Returns the Associated Legendre Function described as follows:

‍In the case flagNorm=true

Using the relations: P_0^0 (x) = 1 P_{l+1}^{l+1} (x) = - sqrt((2l+3)/(2l+2)) * (1-x^2)^{1/2} * P_{l}^{l}(x) P_{l+1}^{m} (x) = sqrt((2l+3)(2l+1)/((l-m+1)(l+m+1))) * x * P_{l}^{m}(x) - sqrt((2l+3)/(2l-1)*(l+m)/(l+m+1)*(l-m)/(l-m+1)) P_{l-1}^m(x) Changing l to l-1, P_{l}^{l} (x) = - a0 * (1-x^2)^{1/2} * P_{l-1}^{l-1}(x) with a0 = sqrt((2l+1)/(2l)) P_{l}^{m} (x) = a * x * P_{l-1}^{m}(x) - b P_{l-2}^m(x) with a = sqrt((2l+1)(2l-1)/(l-m)/(l+m)) and b = sqrt((2l+1)/(2l-3)*(l+m-1)/(l+m)*(l-m-1)/(l-m))

‍In the case flagNorm=false

Using the relations: P_0^0 (x) = 1 P_{l+1}^{l+1} (x) = - sqrt((2l+3)/(2l+2)) * (1-x^2)^{1/2} * P_{l}^{l}(x) P_{l+1}^{m} (x) = sqrt((2l+3)(2l+1)/((l-m+1)(l+m+1))) * x * P_{l}^{m}(x) - sqrt((2l+3)/(2l-1)*(l+m)/(l+m+1)*(l-m)/(l-m+1)) P_{l-1}^m(x) Changing l to l-1, P_{l}^{l} (x) = - a0 * (1-x^2)^{1/2} * P_{l-1}^{l-1}(x) with a0 = sqrt((2l+1)/(2l)) P_{l}^{m} (x) = a * x * P_{l-1}^{m}(x) - b P_{l-2}^m(x) with a = sqrt((2l+1)(2l-1)/(l-m)/(l+m)) and b = sqrt((2l+1)/(2l-3)*(l+m-1)/(l+m)*(l-m-1)/(l-m))

Parameters
[in]lDegree of the Legendre Polynomial to be computed (n >= 0)
[in]vValue for which the polynomial is evaluated (-1 <= v <= 1)
[in]flagNormNormalized when True
Returns
A matrix of the (normalized) associated Legendre functions: P_l^m (x) for 0 <= m <= l

◆ ut_legendreMatNorm()

MatrixDense gstlrn::ut_legendreMatNorm ( Id  n,
const 1 &  v 
)

◆ ut_legendreVec()

gstlrn::ut_legendreVec ( Id  n,
const 1 &  vecin,
bool  flagNorm 
)

◆ ut_log_factorial()

void gstlrn::ut_log_factorial ( Id  nbpoly,
double *  factor 
)

Calculates the nbpoly log-factorial coefficients

Parameters
[in]nbpolyNumber of terms
[out]factorlogarithm of factorials

◆ ut_median()

double gstlrn::ut_median ( 1 &  tab,
Id  ntab 
)

Calculate the median from a table of values

Returns
The median value
Parameters
[in]tabArray of values
[in]ntabNumber of samples

◆ ut_pascal()

MatrixSquare gstlrn::ut_pascal ( Id  ndim)

Create the matrix containing the Pascal Triangle coefficients

Returns
A matrix (Dimension: ndim * ndim) containing the coefficients
or NULL if core allocation problem has been encountered
Parameters
[in]ndimSize of the matrix
Remarks
The calling function must free the returned matrix

◆ ut_rad2deg()

double gstlrn::ut_rad2deg ( double  angle)

Translates from radian to degree

Parameters
[in]angleAngle in radian

◆ ut_shuffle_array()

void gstlrn::ut_shuffle_array ( Id  nrow,
Id  ncol,
1 &  tab 
)

Shuffle an array (by line)

Parameters
[in]nrowNumber of rows
[in]ncolNumber of columns
[in,out]tabArray to be suffled

◆ ut_sort_double()

void gstlrn::ut_sort_double ( Id  safe,
Id  nech,
Id ind,
double *  value 
)

Sorts the (double) array value() and the array ind() in the ascending order of value

Parameters
[in]safe1 if the value array if preserved 0 if the value array is also sorted
[in]nechnumber of samples
[out]indoutput Id array
[out]valueinput and output array
Remarks
If ind = NULL, ind is ignored

◆ ut_sphericalHarmonic()

double gstlrn::ut_sphericalHarmonic ( Id  n,
Id  k,
double  theta,
double  phi 
)

Returns the Spherical harmonic

Parameters
[in]nDegree of HS (n >= 0)
[in]kOrder of the HS (-n <= k <= n)
[in]thetaColatitude angle in radian (0 <= theta <= pi
[in]phiLongitude angle in radian (0 <= phi <= 2* pi)

◆ ut_sphericalHarmonicVec()

gstlrn::ut_sphericalHarmonicVec ( Id  n,
Id  k,
theta,
phi 
)

◆ ut_split_into_two()

gstlrn::ut_split_into_two ( Id  ncolor,
Id  flag_half,
Id  verbose,
Id nposs 
)

Return all the ways to split ncolor into two non-empty subsets

Returns
Return an array of possibilities
Parameters
[in]ncolorNumber of colors
[in]flag_half1 if only half of possibilities must be envisaged
[in]verbose1 for a verbose option
[out]npossNumber of possibilities
Remarks
The calling function must free the returned array.
The array has 'ncolor' columns and 'ncomb' subsets
The elements of each row are set to 0 or 1 (subset rank)

◆ ut_statistics()

StatResults gstlrn::ut_statistics ( Id  nech,
const double *  tab,
const double *  sel,
const double *  wgt 
)

Returns the statistics of an array in a StatResults structure

Parameters
[in]nechNumber of samples
[in]tabArray of values
[in]selArray containing the Selection or NULL
[in]wgtArray containing the Weights or NULL

◆ ut_stats_mima_print()

void gstlrn::ut_stats_mima_print ( const char *  title,
Id  nech,
double *  tab,
double *  sel 
)

Print minimum and maximum of an array

Parameters
[in]titleTitle
[in]nechNumber of samples
[in]tabArray of values
[in]selArray containing the Selection or NULL

◆ ut_vandercorput()

void gstlrn::ut_vandercorput ( Id  n,
Id  flag_sym,
Id  flag_rot,
Id ntri_arg,
1 &  coord 
)

Generate a Van Der Corput list of points in R^3

Parameters
[in]nNumber of points
[in]flag_symDuplicate the samples by symmetry
[in]flag_rotPerform a random rotation
[out]ntri_argNumber of points
[out]coordArray of point coordinates (Dimension: 3*ntri)

◆ util_rotation_gradXYToAngle()

double gstlrn::util_rotation_gradXYToAngle ( double  dzoverdx,
double  dzoverdy 
)

Calculate the angle to translate the gradients of a tilted plane (defined by the partial derivatives along X and Y) into the axis of the rotation angle

Parameters
dzoverdxPartial derivative along X
dzoverdyPartial derivative along Y

◆ vanDerCorput()

DISABLE_WARNING_POP MatrixDense * gstlrn::vanDerCorput ( Id  n,
Id  nd 
)

Function to compute the vector Van der Corput sequence or the Halton sequence

Parameters
nThe number of values to be computed
ndThe dimension of output sequence
Returns
A matrix of dimensions [n,nd] with the sequence values (between 0 and 1)
Note
The dimension nd should be lower or equal to 50.

◆ vario_order_add()

Id gstlrn::vario_order_add ( Vario_Order vorder,
Id  iech,
Id  jech,
void *  aux_iech,
void *  aux_jech,
Id  ilag,
Id  idir,
double  dist 
)

Add a record to the Variogram Order structure

Returns
Error return code
Parameters
[in]vorderVario_Order structure
[in]iechRank of the first sample
[in]jechRank of the second sample
[in]aux_iechAuxiliary array for sample 'iech' (or NULL)
[in]aux_jechAuxiliary array for sample 'jech' (or NULL)
[in]ilagRank of the lag
[in]idirRank of the direction (or 0)
[in]distCalculated distance (only stored if flag_dist == 1)

◆ vario_order_final()

Vario_Order * gstlrn::vario_order_final ( Vario_Order vorder,
Id npair 
)

Resize the array and sort it

Returns
Pointer to the Vario_Order structure
Parameters
[in]vorderVario_Order structure
[in]npairFinal number of pairs

◆ vario_order_get_auxiliary()

void gstlrn::vario_order_get_auxiliary ( Vario_Order vorder,
Id  ipair,
char *  aux_iech,
char *  aux_jech 
)

Returns the two auxiliary arrays for a given (ordered) pair

Parameters
[in]vorderVario_Order structure
[in]ipairRank of the sorted pair
[out]aux_iechArray to auxiliary information for sample 'iech'
[out]aux_jechArray to auxiliary information for sample 'jech'

◆ vario_order_get_bounds()

void gstlrn::vario_order_get_bounds ( Vario_Order vorder,
Id  idir,
Id  ilag,
Id ifirst,
Id ilast 
)

Returns the first and last indices matching a target lag

Parameters
[in]vorderVario_Order structure
[in]idirRank of the target direction
[in]ilagRank of the target lag
[out]ifirstRank of the first sample of the lag (included)
[out]ilastRank of the last sample of the lag (excluded)

◆ vario_order_get_indices()

void gstlrn::vario_order_get_indices ( Vario_Order vorder,
Id  ipair,
Id iech,
Id jech,
double *  dist 
)

Returns the two samples for a given (ordered) pair

Parameters
[in]vorderVario_Order structure
[in]ipairRank of the sorted pair
[out]iechRank of the first sample
[out]jechRank of the second sample
[out]distCalculated distance or TEST (if flag_dist == 0)

◆ vario_order_manage()

Vario_Order * gstlrn::vario_order_manage ( Id  mode,
Id  flag_dist,
Id  size_aux,
Vario_Order vorder 
)

Manage the Variogram Order structure

Returns
Pointer to the Vario_Order structure
Parameters
[in]modeUsage:
  • 1 : to initialize
  • 0 : to clean the geometry
  • -1 : to delete
[in]flag_dist1 if distances are stored; 0 otherwise
[in]size_auxSize (in bytes) of the auxiliary array
[in]vorderVario_Order structure

◆ vario_order_print()

void gstlrn::vario_order_print ( Vario_Order vorder,
Id  idir_target,
Id  ipas_target,
Id  verbose 
)

Print the Vario_Order structure

Parameters
[in]vorderVario_Order structure
[in]idir_targetRank of the target direction (starting from 0) or -1
[in]ipas_targetRank of the target lag (starting from 0) or -1
[in]verbose1 for a complete printout

◆ variogram_pgs()

Vario * gstlrn::variogram_pgs ( Db db,
const VarioParam varioparam,
const RuleProp ruleprop,
Id  flag_rho,
Id  opt_correl 
)

Calculate the Gaussian variograms

Returns
Error return code
Parameters
[in]dbDb structure
[in]varioparamVarioParam structure for the GRFs
[in]rulepropRuleProp structure
[in]flag_rho1 if the correlation coefficient must be regressed
[in]opt_correl0 full model; 1 symmetrical; 2 residuals
Remarks
This is simply a routine dispatching between the stationary function
and the non-stationary one

◆ viech2()

thread_local gstlrn::viech2 ( )

◆ vmap_auto_fit()

Id gstlrn::vmap_auto_fit ( const DbGrid dbmap,
Model model,
bool  verbose = false,
const Option_AutoFit mauto_arg = Option_AutoFit(),
const Constraints cons_arg = Constraints(),
const Option_VarioFit optvar_arg = Option_VarioFit() 
)

◆ write_curvilinear_mesh()

void gstlrn::write_curvilinear_mesh ( const char *  filename,
Id  ub,
Id dims,
float *  pts,
Id  nvars,
Id vardim,
Id centering,
const char *const *  varnames,
1 &  vars 
)

◆ write_float()

static void gstlrn::write_float ( float  val)
static

◆ write_header()

static void gstlrn::write_header ( void  )
static

◆ write_int()

static void gstlrn::write_int ( Id  val)
static

◆ write_point_mesh()

void gstlrn::write_point_mesh ( const char *  filename,
Id  ub,
Id  npts,
float *  pts,
Id  nvars,
Id vardim,
const char *const *  varnames,
1 &  vars 
)

◆ write_rectilinear_mesh()

void gstlrn::write_rectilinear_mesh ( const char *  filename,
Id  ub,
Id dims,
float *  x,
float *  y,
float *  z,
Id  nvars,
Id vardim,
Id centering,
const char *const *  varnames,
1 &  vars 
)

◆ write_regular_mesh()

void gstlrn::write_regular_mesh ( const char *  filename,
Id  ub,
Id dims,
Id  nvars,
Id vardim,
Id centering,
const char *const *  varnames,
1 &  vars 
)

◆ write_string()

static void gstlrn::write_string ( const char *  str)
static

◆ write_unstructured_mesh()

void gstlrn::write_unstructured_mesh ( const char *  filename,
Id  ub,
Id  npts,
float *  pts,
Id  ncells,
Id celltypes,
Id conn,
Id  nvars,
Id vardim,
Id centering,
const char *const *  varnames,
1 &  vars 
)

◆ write_variables()

void gstlrn::write_variables ( Id  nvars,
const Id vardim,
const Id centering,
const char *const *  varname,
1 &  vars,
Id  npts,
Id  ncells 
)

◆ x_side()

static Id gstlrn::x_side ( Id  y_begin,
Id  y_end,
Id  z_begin,
Id  z_end,
Id  x,
Id  future 
)
static

◆ xvalid()

Id gstlrn::xvalid ( Db db,
ModelGeneric model,
ANeigh neigh,
bool  flag_kfold,
Id  flag_xvalid_est,
Id  flag_xvalid_std,
Id  flag_xvalid_varz,
const KrigOpt krigopt,
const NamingConvention namconv 
)

Standard Cross-Validation

Parameters
dbDb structure
modelModelGeneric structure
neighANeigh structure
flag_kfoldTrue if a code (K-FOLD) is used
flag_xvalid_estOption for storing the estimation: 1 for Z*-Z; -1 for Z*; 0 not stored
flag_xvalid_stdOption for storing the standard deviation: 1:for (Z*-Z)/S; -1 for S; 0 not stored
flag_xvalid_varzOption for storing the variance of the estimator: 1 to store and 0 not stored
krigoptKrigOpt structure
namconvNaming Convention
Returns
Error return code

◆ y_side()

static Id gstlrn::y_side ( Id  x_begin,
Id  x_end,
Id  z_begin,
Id  z_end,
Id  y,
Id  future 
)
static

◆ z_side()

static Id gstlrn::z_side ( Id  x_begin,
Id  x_end,
Id  y_begin,
Id  y_end,
Id  z,
Id  future 
)
static

Variable Documentation

◆ _background

double gstlrn::_background

◆ _debugOptions

EDbg gstlrn::_debugOptions = EDbg::DB
static

◆ _dilate

gstlrn::_dilate

◆ _emptyElem

PolyElem gstlrn::_emptyElem

◆ _emptyVec

gstlrn::_emptyVec

Create a Polygon by loading the contents of a Neutral File

Parameters
NFFilenameName of the Neutral File
verboseVerbose flag
Returns

◆ _facies

double gstlrn::_facies

◆ _flagMatrixCheck

bool gstlrn::_flagMatrixCheck = false
static

◆ _globalMultiThread

I32 gstlrn::_globalMultiThread = 0
static

◆ _iwork0

thread_local gstlrn::_iwork0

◆ _maxiter

Id gstlrn::_maxiter

◆ _tmax

double gstlrn::_tmax

◆ _work1

thread_local gstlrn::_work1

◆ _work2

thread_local gstlrn::_work2

◆ bessel_Old_Style

bool gstlrn::bessel_Old_Style = false
static

◆ BIGVAL

double gstlrn::BIGVAL
static

◆ bx

Id gstlrn::bx
static

◆ by

Id gstlrn::by
static

◆ bz

Id gstlrn::bz
static

◆ c_b11

double gstlrn::c_b11 = 1.
static

◆ constvect

DISABLE_WARNING_NOT_EXPORTED_FROM_DLL DISABLE_WARNING_BASE_NOT_EXPORTED_FROM_DLL typedef std::span<const double> gstlrn::constvect

◆ covaux_global

gstlrn::covaux_global
static

◆ COVINT

CovInternal gstlrn::COVINT
static

◆ covtab

MatrixSquare gstlrn::covtab
static

◆ COVWGT

Id gstlrn::COVWGT[4][5]
static
Initial value:
= {{2, -2, 0, 0, 0},
{6, -8, 2, 0, 0},
{20, -30, 12, -2, 0},
{70, -112, 56, -16, 2}}

◆ current_side_limit

Id gstlrn::current_side_limit
static

◆ currentLine

std::string gstlrn::currentLine
static

◆ d1_1_global

gstlrn::d1_1_global
static

◆ d1_2_global

gstlrn::d1_2_global
static

◆ d1_global

gstlrn::d1_global
static

◆ d1_t_global

gstlrn::d1_t_global
static

◆ DB

DbGrid* gstlrn::DB
static

◆ DB_GRID_FILL

DbGrid* gstlrn::DB_GRID_FILL
static

◆ DBIN

Db* gstlrn::DBIN
static

◆ DBOUT

Db * gstlrn::DBOUT
static

◆ DEBUG

Id gstlrn::DEBUG = 0
static

◆ DECODE

String gstlrn::DECODE
static

◆ DEF_LOCATOR

Def_Locator gstlrn::DEF_LOCATOR[]
static
Initial value:
= {{"x", 0, "Coordinate"},
{"z", 0, "Variable"},
{"v", 0, "Variance of measurement error"},
{"f", 0, "External Drift"},
{"g", 0, "Gradient component"},
{"lower", 0, "Lower bound of an inequality"},
{"upper", 0, "Upper bound of an inequality"},
{"p", 0, "Proportion"},
{"w", 1, "Weight"},
{"code", 1, "Code"},
{"sel", 1, "Selection"},
{"dom", 1, "Domain selection"},
{"dblk", 0, "Block Extension"},
{"adir", 1, "Dip direction angle"},
{"adip", 1, "Dip angle"},
{"size", 1, "Object height"},
{"bu", 1, "Fault UP termination"},
{"bd", 1, "Fault DOWN termination"},
{"time", 0, "Time variable"},
{"layer", 1, "Layer rank"},
{"nostat", 0, "Non-stationary parameter"},
{"tangent", 0, "Tangent"},
{"ncsimu", 0, "Non-conditional simulation"},
{"facies", 0, "Facies simulated"},
{"gausfac", 0, "Gaussian value for Facies"},
{"date", 1, "Date"},
{"rklow", 0, "Disc. rank for Lower bound"},
{"rkup", 0, "Disc. rank for Upper bound"},
{"sum", 0, "Constraints on the sum"}}

◆ defaultSpace

ASpaceSharedPtr gstlrn::defaultSpace = nullptr
static

Unique default global space.

◆ DEL_BLK

char gstlrn::DEL_BLK = ' '
static

◆ DEL_COM

char gstlrn::DEL_COM = '#'
static

◆ DEL_SEP

char gstlrn::DEL_SEP = ' '
static

◆ DISTANCE_NDIM

Id gstlrn::DISTANCE_NDIM = 0
static

◆ DISTANCE_TAB1

gstlrn::DISTANCE_TAB1
static

◆ DISTANCE_TAB2

gstlrn::DISTANCE_TAB2
static

◆ DX

double gstlrn::DX
static

◆ DZ

double gstlrn::DZ
static

◆ err_msg

const char* gstlrn::err_msg[]
static
Initial value:
= {
"\ntime_3d: Computations terminated normally.\n",
"\ntime_3d: [Bug] macros T3D_INF, FD_HUGE not properly set.\n",
"\ntime_3d: Multiple source but input time map is uniform.\n",
"\ntime_3d: Not enough virtual memory (malloc failed).\n",
"\ntime_3d: Recursive init failed: see message(s) above.\n",
"\ntime_3d: [Init] Illegal tolerance on inhomogeneity.\n",
"\ntime_3d: Illegal ('infinite') value(s) in array hs.\n",
"\ntime_3d: Non-physical negative value(s) in array hs.\n",
"\ntime_3d: a dimension (nx,ny,nz) is too small or negative.\n",
"\ntime_3d: args bx,by,bx not correctly set. use 1,1,1 !!!\n",
}

◆ EXIT_FUNC

void(* gstlrn::EXIT_FUNC) (void) ( void  ) = st_exit
static

◆ factor

Id gstlrn::factor[NFACTOR]
static

◆ FLAG_ARRAY

unsigned char gstlrn::FLAG_ARRAY = 16
static

Print the variable contents.

◆ flag_bb

Id gstlrn::flag_bb
static

◆ flag_bf

Id gstlrn::flag_bf
static

◆ FLAG_COLK

Id gstlrn::FLAG_COLK
static

◆ FLAG_EST

Id gstlrn::FLAG_EST
static

◆ FLAG_EXTEND

unsigned char gstlrn::FLAG_EXTEND = 4
static

Print the Db extension.

◆ flag_fb

Id gstlrn::flag_fb
static

◆ flag_ff

Id gstlrn::flag_ff
static

◆ flag_global

gstlrn::flag_global
static

◆ FLAG_LOCATOR

unsigned char gstlrn::FLAG_LOCATOR = 32
static

Print the locators.

◆ FLAG_PROF

Id gstlrn::FLAG_PROF
static

◆ FLAG_RESUME

unsigned char gstlrn::FLAG_RESUME = 1
static

Print the Db summary.

◆ FLAG_SIMU

Id gstlrn::FLAG_SIMU
static

◆ FLAG_STATS

unsigned char gstlrn::FLAG_STATS = 8
static

Print the variable statistics.

◆ FLAG_STD

Id gstlrn::FLAG_STD
static

◆ FLAG_VARS

unsigned char gstlrn::FLAG_VARS = 2
static

Print the Field names.

◆ FLAG_VARZ

Id gstlrn::FLAG_VARZ
static

◆ FORMAT

String gstlrn::FORMAT
static

◆ fp

FILE* gstlrn::fp = NULL
static

◆ FUNC_EVALUATE

void(* gstlrn::FUNC_EVALUATE) (Id ndat, Id npar, 1 &param, 1 &work) ( Id  ndat,
Id  npar,
1 &  param,
1 &  work 
)
static

◆ GAUSS_MODE

Id gstlrn::GAUSS_MODE = 1
static

◆ GIBBS_RHO

double gstlrn::GIBBS_RHO
static

◆ GIBBS_SQR

double gstlrn::GIBBS_SQR
static

◆ Heap

double** gstlrn::Heap
static

◆ HINIT

double gstlrn::HINIT
static

◆ HMAX

double gstlrn::HMAX
static

◆ hs_eps_init

double gstlrn::hs_eps_init
static

◆ Hsize

Id gstlrn::Hsize = 0
static

◆ HTOP

double gstlrn::HTOP
static

◆ id

Id gstlrn::id[6][3]
static
Initial value:
= {{1, 0, 0},
{-1, 0, 0},
{0, 1, 0},
{0, -1, 0},
{0, 0, 1},
{0, 0, -1}}

◆ IDIRLOC

Id gstlrn::IDIRLOC
static

◆ IDS

gstlrn::IDS
static

◆ IECH1

Id gstlrn::IECH1
static

◆ IECH2

Id gstlrn::IECH2
static

◆ IECH_OUT [1/2]

Id gstlrn::IECH_OUT = -1
static

◆ IECH_OUT [2/2]

Id gstlrn::IECH_OUT = -1
static

◆ INH_FLAG_LIMIT

Id gstlrn::INH_FLAG_LIMIT = 1
static

◆ INH_FLAG_VERBOSE

Id gstlrn::INH_FLAG_VERBOSE = 0
static

◆ init_stage

Id gstlrn::init_stage = 0
static

◆ invdir [1/2]

Id gstlrn::invdir[6] = {1, 0, 3, 2, 5, 4}
static

◆ invdir [2/2]

Id gstlrn::invdir[6] = {1, 0, 3, 2, 5, 4}
static

◆ IPTR

Id gstlrn::IPTR
static

◆ IPTR_EST

Id gstlrn::IPTR_EST
static

◆ IPTR_NBGH

Id gstlrn::IPTR_NBGH
static

◆ IPTR_STD

Id gstlrn::IPTR_STD
static

◆ IPTR_VARZ

Id gstlrn::IPTR_VARZ
static

◆ IPTV

Id gstlrn::IPTV
static

◆ IPTW

Id gstlrn::IPTW
static

◆ ITERATION

Id gstlrn::ITERATION
static

◆ ivars

thread_local gstlrn::ivars

◆ jvars

thread_local gstlrn::jvars

◆ KEYPAIR_NTAB

Id gstlrn::KEYPAIR_NTAB = 0
static

◆ KEYPAIR_TABS

std::vector<Keypair> gstlrn::KEYPAIR_TABS
static

◆ KOPTION

Koption gstlrn::KOPTION
static

◆ KRIGE_INIT

Id gstlrn::KRIGE_INIT = 0
static

◆ LARGE

Id gstlrn::LARGE = 9999999
static

◆ lhs_global

gstlrn::lhs_global
static

◆ longflags

gstlrn::longflags
static

local headwave flags.

◆ MaxPermAlloced

size_t gstlrn::MaxPermAlloced = 0
static

◆ messages

Id gstlrn::messages
static

◆ ModCat

Modif_Categorical gstlrn::ModCat = {0, {0, 0}, NULL, NULL}
static

◆ MODEL_INIT

Id gstlrn::MODEL_INIT = 0
static

◆ nbgh_init

thread_local gstlrn::nbgh_init

◆ NCONT

Id gstlrn::NCONT
static

◆ NDAT

Id gstlrn::NDAT
static

◆ NDIM_LOCAL

Id gstlrn::NDIM_LOCAL = 0

◆ ndir

Id gstlrn::ndir[4] = {0, 2, 4, 6}
static

◆ NORWGT [1/2]

Id gstlrn::NORWGT[4] = {2, 6, 20, 70}
static

◆ NORWGT [2/2]

Id gstlrn::NORWGT[4] = {2, 6, 20, 70}
static

◆ NPAR

Id gstlrn::NPAR
static

◆ NPAR2

Id gstlrn::NPAR2
static

◆ NPARAC

Id gstlrn::NPARAC
static

◆ NPARAC2

Id gstlrn::NPARAC2
static

◆ NPCT

Id gstlrn::NPCT
static

◆ NPCT2

Id gstlrn::NPCT2
static

◆ NTRACE

Id gstlrn::NTRACE
static

◆ numInColumn

Id gstlrn::numInColumn = 0
static

◆ NVAR

Id gstlrn::NVAR
static

◆ NWGT [1/2]

Id gstlrn::NWGT[4] = {2, 3, 4, 5}
static

◆ NWGT [2/2]

Id gstlrn::NWGT[4] = {2, 3, 4, 5}
static

◆ NX

Id gstlrn::NX
static

◆ NY

Id gstlrn::NY
static

◆ NZ

Id gstlrn::NZ
static

◆ Offset_mark_out

Id gstlrn::Offset_mark_out
static

◆ Offset_out_in

Id gstlrn::Offset_out_in
static

◆ OPTION

Id gstlrn::OPTION
static

◆ Perm

Id* gstlrn::Perm = NULL
static

◆ POLYGON

Polygons* gstlrn::POLYGON = nullptr
static

◆ pos

size_t gstlrn::pos = 0
static

◆ PT_SPILL

double* gstlrn::PT_SPILL = nullptr
static

◆ RADIUS

Id gstlrn::RADIUS[3]
static

◆ Random_congruent

thread_local Id gstlrn::Random_congruent = 20000159

◆ Random_factor

thread_local Id gstlrn::Random_factor = 105

◆ Random_gen

thread_local std::mt19937 gstlrn::Random_gen

◆ Random_Old_Style

thread_local bool gstlrn::Random_Old_Style = true

◆ Random_value

thread_local Id gstlrn::Random_value = 43241421

◆ RANK_COLCOK

Id* gstlrn::RANK_COLCOK
static

◆ READ_FUNC

void(* gstlrn::READ_FUNC) (const char *, char *) ( const char *  ,
char *   
) = st_read
static

◆ reverse_order

Id gstlrn::reverse_order
static

◆ rhs_global

gstlrn::rhs_global
static

◆ SIGNE

Id gstlrn::SIGNE
static

◆ source_at_node

Id gstlrn::source_at_node = 0
static

◆ SOUSITER

Id gstlrn::SOUSITER
static

◆ SpaceAlloced

size_t gstlrn::SpaceAlloced = 0
static

◆ SPIMG_IN

SPIMG* gstlrn::SPIMG_IN = nullptr
static

◆ SPIMG_MARK

SPIMG* gstlrn::SPIMG_MARK = nullptr
static

◆ SPIMG_OUT

SPIMG* gstlrn::SPIMG_OUT = nullptr
static

◆ STEP

Id gstlrn::STEP = 0
static

◆ string

String gstlrn::string
static

◆ SX

Id gstlrn::SX
static

◆ SXY

Id gstlrn::SXY
static

◆ SY

Id gstlrn::SY
static

◆ symbol [1/2]

const VectorString gstlrn::symbol = {"F","S","T"}
static

◆ symbol [2/2]

const VectorString gstlrn::symbol = {"F", "S", "T"}
static

◆ TABSTR

String gstlrn::TABSTR
static

◆ Tmp0

void* gstlrn::Tmp0 = NULL
static

◆ Tmp1

void* gstlrn::Tmp1 = NULL
static

◆ Tmp2

void* gstlrn::Tmp2 = NULL
static

◆ Tmp3

void* gstlrn::Tmp3 = NULL
static

◆ TX

Id gstlrn::TX
static

◆ TXY

Id gstlrn::TXY
static

◆ TY

Id gstlrn::TY
static

◆ useBinary

Id gstlrn::useBinary = 0
static

◆ var0_global

gstlrn::var0_global
static

◆ VARWGT

Id gstlrn::VARWGT[4][5] = {{1, -1, 0, 0, 0}, {1, -2, 1, 0, 0}, {1, -3, 3, -1, 0}, {1, -4, 6, -4, 1}}
static

◆ VectorNumT< double >

typedef gstlrn::VectorNumT< double >

◆ VectorNumT< float >

typedef gstlrn::VectorNumT< float >

◆ VectorNumT< Id >

typedef gstlrn::VectorNumT< Id >

◆ VectorNumT< UChar >

◆ VectorT< 1 >

typedef gstlrn::VectorT< 1 >

◆ VERBOSE_GQO

Id gstlrn::VERBOSE_GQO = 0
static

◆ VERBOSE_STEP

Id gstlrn::VERBOSE_STEP
static

◆ VFACT

double gstlrn::VFACT = 1000.
static

◆ WARN_FUNC

void(* gstlrn::WARN_FUNC) (const char *) ( const char *  ) = static_cast<void (*)(const char*)>(st_print)
static

◆ wgt_global

gstlrn::wgt_global
static

◆ work1

gstlrn::work1
static

◆ work2

gstlrn::work2
static

◆ WRITE_FUNC

void(* gstlrn::WRITE_FUNC) (const char *) ( const char *  ) = static_cast<void (*)(const char*)>(st_print)
static

◆ X0

Id gstlrn::X0
static

◆ X1

Id gstlrn::X1
static

◆ X1_LOCAL

gstlrn::X1_LOCAL

◆ X2_LOCAL

gstlrn::X2_LOCAL

◆ x_start_bb

Id gstlrn::x_start_bb
static

◆ x_start_bf

Id gstlrn::x_start_bf
static

◆ x_start_fb

Id gstlrn::x_start_fb
static

◆ x_start_ff

Id gstlrn::x_start_ff
static

◆ Y0

Id gstlrn::Y0
static

◆ Y1

Id gstlrn::Y1
static

◆ y_start_bb

Id gstlrn::y_start_bb
static

◆ y_start_bf

Id gstlrn::y_start_bf
static

◆ y_start_fb

Id gstlrn::y_start_fb
static

◆ y_start_ff

Id gstlrn::y_start_ff
static

◆ Z0

Id gstlrn::Z0
static

◆ Z1

Id gstlrn::Z1
static

◆ z_start_bb

Id gstlrn::z_start_bb
static

◆ z_start_bf

Id gstlrn::z_start_bf
static

◆ z_start_fb

Id gstlrn::z_start_fb
static

◆ z_start_ff

Id gstlrn::z_start_ff
static

◆ zam1_global

gstlrn::zam1_global
static