gstlearn  0.3.3
CCC
TurboOptimizer Class Reference

Turbo Optimizer for a specific 2-D environment,. More...

#include <TurboOptimizer.hpp>

Public Member Functions

 TurboOptimizer (int nx=2, int ny=2, double dx=1., double dy=1., double x0=0., double y0=0., double scale=1., double sill=1., int param=1, int flagOne=1)
 
 TurboOptimizer (const TurboOptimizer &tbo)
 
TurboOptimizer & operator= (const TurboOptimizer &tbo)
 
virtual ~TurboOptimizer ()
 
void setGrid (int nx=2, int ny=2, double dx=1., double dy=1., double x0=0., double y0=0.)
 
void setModelByRange (double range=1., double sill=1., int param=1)
 
void setModelByScale (double scale=1., double sill=1., int param=1)
 
void setEnviron (int flagOne=1)
 
void run (bool verbose=false)
 
VectorDouble getBlin () const
 
VectorDouble getTildeC () const
 
VectorDouble getLambda () const
 
TripletND getS () const
 
TripletND getQ () const
 
TripletND interpolate (const VectorDouble &x, const VectorDouble &y) const
 
VectorInt interpolate_rows (const VectorDouble &x, const VectorDouble &y) const
 
VectorInt interpolate_cols (const VectorDouble &x, const VectorDouble &y) const
 
VectorDouble interpolate_values (const VectorDouble &x, const VectorDouble &y) const
 
VectorInt getQ_rows () const
 
VectorInt getQ_cols () const
 
VectorDouble getQ_values () const
 
void printClass () const
 
void printMeshes () const
 
void printS (int nper_batch=5, int row_begin=0, int row_end=0, int col_begin=0, int col_end=0) const
 
void printQ (int nper_batch=5, int row_begin=0, int row_end=0, int col_begin=0, int col_end=0) const
 
int getHalf () const
 
int getCenter () const
 
int getNxred () const
 
int getPoncif () const
 
const VectorDouble & getTildeCT () const
 
const VectorDouble & getLambdaT () const
 
const VectorDouble & getQT () const
 
const VectorDouble & getST () const
 

Private Member Functions

int _getNMeshes () const
 
int _getNVertices () const
 
int _getNVertices_red () const
 
double _getMeshSize () const
 
int _getVertex (int imesh, int rank) const
 
double _getCoor (int node, int idim0) const
 
double _getCoorByMesh (int imesh, int rank, int idim0) const
 
void _fromMeshToIndex (int imesh, int *node, int *icas) const
 
void _rankToIndice (int rank, VectorInt &indice, bool minusOne) const
 
int _MSS (int icas, int icorn, int idim0) const
 
int _indiceToRank (VectorInt &indice, bool flag_complete=true) const
 
void _loadHH (VectorDouble &hh) const
 
double _rangeToScale (double range) const
 
int _coordinateToIndice (double x, double y, VectorInt &indice) const
 
double _indiceToCoordinate (int idim0, const VectorInt indice) const
 
void _printVector (const std::string &title, VectorDouble &uu, int width=10, int ndec=3) const
 
void _printMatrix (const std::string &title, int nrow, int ncol, VectorDouble &uu, int nper_batch, int row_shift=0, int col_shift=0, int width=10, int ndec=6) const
 
void _invert_3x3 (VectorDouble &uu, VectorDouble &vv, double tol=1.e-6) const
 
void _prodMatrix (int size, const VectorDouble &aa, const VectorDouble &bb, VectorDouble &cc) const
 
void _prodMatVect (int size, const VectorDouble &aa, const VectorDouble &bb, VectorDouble &cc) const
 
void _updateMargin (int idim0, VectorInt &indice) const
 
void _getRankInTemplate (VectorInt &indice1, VectorInt &indice2) const
 
int _determineInternalGrid (bool verbose)
 
VectorDouble _buildTildeC () const
 
VectorDouble _buildLambda (const VectorDouble TildeC) const
 
VectorDouble _buildS (const VectorDouble &TildeC) const
 
VectorDouble _buildBlin () const
 
VectorDouble _buildQ (const VectorDouble &ss, const VectorDouble &blin, const VectorDouble &lambda) const
 
VectorDouble _getVectorFromTemplate (const VectorDouble &vecin) const
 
TripletND _getMatrixFromTemplate (const VectorDouble &matin, int nperline) const
 
int _addWeights (int icas, double x, double y, const VectorInt &indg0, VectorInt &indices, VectorDouble &lambda) const
 
VectorDouble _expandTripletToMatrix (int row_begin, int row_end, int col_begin, int col_end, const TripletND &triplet) const
 

Private Attributes

bool _isCalculated
 
int _nx
 
int _ny
 
double _dx
 
double _dy
 
double _x0
 
double _y0
 
double _scale
 
double _sill
 
int _param
 
int _poncif
 
int _center
 
int _nxred
 
int _half
 
int _flagOne
 
VectorDouble _Blin
 
VectorDouble _TildeC_T
 
VectorDouble _Lambda_T
 
VectorDouble _S_T
 
VectorDouble _Q_T
 

Detailed Description

Turbo Optimizer for a specific 2-D environment,.

with an isotropic Matérn Model

Constructor & Destructor Documentation

◆ TurboOptimizer() [1/2]

TurboOptimizer::TurboOptimizer ( int  nx = 2,
int  ny = 2,
double  dx = 1.,
double  dy = 1.,
double  x0 = 0.,
double  y0 = 0.,
double  scale = 1.,
double  sill = 1.,
int  param = 1,
int  flagOne = 1 
)

◆ TurboOptimizer() [2/2]

TurboOptimizer::TurboOptimizer ( const TurboOptimizer &  tbo)

◆ ~TurboOptimizer()

TurboOptimizer::~TurboOptimizer ( )
virtual

Member Function Documentation

◆ _addWeights()

int TurboOptimizer::_addWeights ( int  icas,
double  x,
double  y,
const VectorInt &  indg0,
VectorInt &  indices,
VectorDouble &  lambda 
) const
private

◆ _buildBlin()

VectorDouble TurboOptimizer::_buildBlin ( ) const
private

◆ _buildLambda()

VectorDouble TurboOptimizer::_buildLambda ( const VectorDouble  TildeC) const
private

◆ _buildQ()

VectorDouble TurboOptimizer::_buildQ ( const VectorDouble &  ss,
const VectorDouble &  blin,
const VectorDouble &  lambda 
) const
private

◆ _buildS()

VectorDouble TurboOptimizer::_buildS ( const VectorDouble &  TildeC) const
private

◆ _buildTildeC()

VectorDouble TurboOptimizer::_buildTildeC ( ) const
private

◆ _coordinateToIndice()

int TurboOptimizer::_coordinateToIndice ( double  x,
double  y,
VectorInt &  indice 
) const
private

◆ _determineInternalGrid()

int TurboOptimizer::_determineInternalGrid ( bool  verbose)
private

◆ _expandTripletToMatrix()

VectorDouble TurboOptimizer::_expandTripletToMatrix ( int  row_begin,
int  row_end,
int  col_begin,
int  col_end,
const TripletND &  triplet 
) const
private

Expand a sub-part of a Sparse matrix stored as triplets

Parameters
row_beginStarting Row number (included) of the Matrix to be expanded
row_endEnding Row number (included) of the Matrix to be expanded
col_beginStarting Column number (included) of the Matrix to be expanded
col_endEnding Column number (included) of the Matrix to be expanded
tripletInput matrix stored as TripletNDs
Returns
Matrix stored in full format

◆ _fromMeshToIndex()

void TurboOptimizer::_fromMeshToIndex ( int  imesh,
int *  node,
int *  icas 
) const
private

◆ _getCoor()

double TurboOptimizer::_getCoor ( int  node,
int  idim0 
) const
private

◆ _getCoorByMesh()

double TurboOptimizer::_getCoorByMesh ( int  imesh,
int  rank,
int  idim0 
) const
private

◆ _getMatrixFromTemplate()

TripletND TurboOptimizer::_getMatrixFromTemplate ( const VectorDouble &  matin,
int  nperline 
) const
private

◆ _getMeshSize()

double TurboOptimizer::_getMeshSize ( ) const
inlineprivate

◆ _getNMeshes()

int TurboOptimizer::_getNMeshes ( ) const
inlineprivate

◆ _getNVertices()

int TurboOptimizer::_getNVertices ( ) const
inlineprivate

◆ _getNVertices_red()

int TurboOptimizer::_getNVertices_red ( ) const
inlineprivate

◆ _getRankInTemplate()

void TurboOptimizer::_getRankInTemplate ( VectorInt &  indice1,
VectorInt &  indice2 
) const
private

◆ _getVectorFromTemplate()

VectorDouble TurboOptimizer::_getVectorFromTemplate ( const VectorDouble &  vecin) const
private

◆ _getVertex()

int TurboOptimizer::_getVertex ( int  imesh,
int  rank 
) const
private

◆ _indiceToCoordinate()

double TurboOptimizer::_indiceToCoordinate ( int  idim0,
const VectorInt  indice 
) const
private

◆ _indiceToRank()

int TurboOptimizer::_indiceToRank ( VectorInt &  indice,
bool  flag_complete = true 
) const
private

◆ _invert_3x3()

void TurboOptimizer::_invert_3x3 ( VectorDouble &  uu,
VectorDouble &  vv,
double  tol = 1.e-6 
) const
private

◆ _loadHH()

void TurboOptimizer::_loadHH ( VectorDouble &  hh) const
private

◆ _MSS()

int TurboOptimizer::_MSS ( int  icas,
int  icorn,
int  idim0 
) const
private

◆ _printMatrix()

void TurboOptimizer::_printMatrix ( const std::string &  title,
int  nrow,
int  ncol,
VectorDouble &  uu,
int  nper_batch,
int  row_shift = 0,
int  col_shift = 0,
int  width = 10,
int  ndec = 6 
) const
private

◆ _printVector()

void TurboOptimizer::_printVector ( const std::string &  title,
VectorDouble &  uu,
int  width = 10,
int  ndec = 3 
) const
private

◆ _prodMatrix()

void TurboOptimizer::_prodMatrix ( int  size,
const VectorDouble &  aa,
const VectorDouble &  bb,
VectorDouble &  cc 
) const
private

Perform C = A * B (A, B and C are square matrices of dimension 'size')

Parameters
sizeDimension of the square matrices
aaFirst square matrix
bbSecond square matrix
ccResulting square matrix

◆ _prodMatVect()

void TurboOptimizer::_prodMatVect ( int  size,
const VectorDouble &  aa,
const VectorDouble &  bb,
VectorDouble &  cc 
) const
private

◆ _rangeToScale()

double TurboOptimizer::_rangeToScale ( double  range) const
private

◆ _rankToIndice()

void TurboOptimizer::_rankToIndice ( int  rank,
VectorInt &  indice,
bool  minusOne 
) const
private

◆ _updateMargin()

void TurboOptimizer::_updateMargin ( int  idim0,
VectorInt &  indice 
) const
private

◆ getBlin()

VectorDouble TurboOptimizer::getBlin ( ) const

Allows retrieving the vector Blin

Returns
The Blin vector

◆ getCenter()

int TurboOptimizer::getCenter ( ) const
inline

◆ getHalf()

int TurboOptimizer::getHalf ( ) const
inline

◆ getLambda()

VectorDouble TurboOptimizer::getLambda ( ) const

Allows retrieving the vector Lambda

Returns
The Lambda vector

◆ getLambdaT()

const VectorDouble& TurboOptimizer::getLambdaT ( ) const
inline

◆ getNxred()

int TurboOptimizer::getNxred ( ) const
inline

◆ getPoncif()

int TurboOptimizer::getPoncif ( ) const
inline

◆ getQ()

TripletND TurboOptimizer::getQ ( ) const

Allows retrieving the Q sparse matrix

Returns
The returned matrix stored as Triplets

◆ getQ_cols()

VectorInt TurboOptimizer::getQ_cols ( ) const
inline

◆ getQ_rows()

VectorInt TurboOptimizer::getQ_rows ( ) const
inline

◆ getQ_values()

VectorDouble TurboOptimizer::getQ_values ( ) const
inline

◆ getQT()

const VectorDouble& TurboOptimizer::getQT ( ) const
inline

◆ getS()

TripletND TurboOptimizer::getS ( ) const

Allows retrieving the S sparse matrix

Returns
The returned matrix stored as TripletNDs

◆ getST()

const VectorDouble& TurboOptimizer::getST ( ) const
inline

◆ getTildeC()

VectorDouble TurboOptimizer::getTildeC ( ) const

Allows retrieving the vector TildeC

Returns
The TildeC vector

◆ getTildeCT()

const VectorDouble& TurboOptimizer::getTildeCT ( ) const
inline

◆ interpolate()

TripletND TurboOptimizer::interpolate ( const VectorDouble &  x,
const VectorDouble &  y 
) const

Returns the weights for interpolating points on the meshing

Parameters
xVector of X-coordinates for the target points
yVector of Y-coordinates for the target points
Returns
The triplet structure giving the interpolation weights
Note
: The triplets contain:
: - rows: the index of the target point
: - cols: the index of the node of the grid
: - values: the corresponding weight

◆ interpolate_cols()

VectorInt TurboOptimizer::interpolate_cols ( const VectorDouble &  x,
const VectorDouble &  y 
) const
inline

◆ interpolate_rows()

VectorInt TurboOptimizer::interpolate_rows ( const VectorDouble &  x,
const VectorDouble &  y 
) const
inline

◆ interpolate_values()

VectorDouble TurboOptimizer::interpolate_values ( const VectorDouble &  x,
const VectorDouble &  y 
) const
inline

◆ operator=()

TurboOptimizer & TurboOptimizer::operator= ( const TurboOptimizer &  tbo)

◆ printClass()

void TurboOptimizer::printClass ( ) const

Display the parameters of the Method (Grid and Model parameters)

◆ printMeshes()

void TurboOptimizer::printMeshes ( ) const

Print the elements of the Internal Meshing

◆ printQ()

void TurboOptimizer::printQ ( int  nper_batch = 5,
int  row_begin = 0,
int  row_end = 0,
int  col_begin = 0,
int  col_end = 0 
) const

◆ printS()

void TurboOptimizer::printS ( int  nper_batch = 5,
int  row_begin = 0,
int  row_end = 0,
int  col_begin = 0,
int  col_end = 0 
) const

◆ run()

void TurboOptimizer::run ( bool  verbose = false)

This function is compulsory as it performs the calculations and allows retrieval of the matrices

Parameters
verboseVerbose flag

◆ setEnviron()

void TurboOptimizer::setEnviron ( int  flagOne = 1)

Generic method to set all the remaining terms of the class

Parameters
flagOneStarting value for numbering of rows and columns in TripletND

◆ setGrid()

void TurboOptimizer::setGrid ( int  nx = 2,
int  ny = 2,
double  dx = 1.,
double  dy = 1.,
double  x0 = 0.,
double  y0 = 0. 
)

Definition of the 2-D non rotated Grid

Parameters
nxNumber of nodes along X
nyNumber of nodes along Y
dxMesh of the grid along X
dyMesh of the grid along Y
x0Origin of the grid along X
y0Origin of the grid along Y

◆ setModelByRange()

void TurboOptimizer::setModelByRange ( double  range = 1.,
double  sill = 1.,
int  param = 1 
)

Definition of the Model (single isotropic Matérn structure) by range

Parameters
rangeRange of the structure
sillSill of the structure
paramMatérn parameter (third parameter)

◆ setModelByScale()

void TurboOptimizer::setModelByScale ( double  scale = 1.,
double  sill = 1.,
int  param = 1 
)

Definition of the Model (single isotropic Matérn structure) by scale

Parameters
scaleScale of the structure
sillSill of the structure
paramMatérn parameter (third parameter)

Member Data Documentation

◆ _Blin

VectorDouble TurboOptimizer::_Blin
private

◆ _center

int TurboOptimizer::_center
private

◆ _dx

double TurboOptimizer::_dx
private

◆ _dy

double TurboOptimizer::_dy
private

◆ _flagOne

int TurboOptimizer::_flagOne
private

◆ _half

int TurboOptimizer::_half
private

◆ _isCalculated

bool TurboOptimizer::_isCalculated
private

◆ _Lambda_T

VectorDouble TurboOptimizer::_Lambda_T
private

◆ _nx

int TurboOptimizer::_nx
private

◆ _nxred

int TurboOptimizer::_nxred
private

◆ _ny

int TurboOptimizer::_ny
private

◆ _param

int TurboOptimizer::_param
private

◆ _poncif

int TurboOptimizer::_poncif
private

◆ _Q_T

VectorDouble TurboOptimizer::_Q_T
private

◆ _S_T

VectorDouble TurboOptimizer::_S_T
private

◆ _scale

double TurboOptimizer::_scale
private

◆ _sill

double TurboOptimizer::_sill
private

◆ _TildeC_T

VectorDouble TurboOptimizer::_TildeC_T
private

◆ _x0

double TurboOptimizer::_x0
private

◆ _y0

double TurboOptimizer::_y0
private

The documentation for this class was generated from the following files: