xmsinterp  1.0
InterpUtil.cpp File Reference

Utility functions called by interpolation code. More...

Go to the source code of this file.

Functions

void xms::inNodalFuncSetUpMatrixAndVector (double xk, double yk, double fk, const std::vector< InterpPtInfo > &closest, double **M, double *VV)
 Sets up matrices for nodal function calculations. Refactored out of GMS. More...
 
void xms::inNodalFuncSetUpMatrixAndVector3d (double xk, double yk, double zk, double fk, const std::vector< InterpPtInfo > &closest, double **M, double *vv)
 Sets up matrices for nodal function calculations. Refactored out of GMS. More...
 
void xms::inDistanceSquared (const Pt3d &a_pt, const std::vector< int > &a_ptIdxs, const std::vector< Pt3d > &a_ptLoc, bool a_2d, std::vector< double > &a_d2)
 Computes the distance squared between the point "a_pt" and the other points. The other points are defined by looking up the location in "a_ptLoc" using the index stored in "a_ptIdxs". The "a_d2" vector is then filled with the distance squared. If "a_2d" is true then we only do the x,y distance. More...
 
void xms::inIdwWeights (const std::vector< double > &a_distSquare, double a_power, bool a_modifiedShepardWeights, std::vector< double > &a_w)
 Computes the idw weights that would be assigned to points associated with the distance squared that is passed in: "a_d2". The function can handle any power ("a_power") associated with the idw calculation and there is an option for the Modified Shepard Weights as well (see the reference in the code). More...
 
bool xms::inAllScalarsEqual (const std::vector< float > &a_scalars, const DynBitset &a_act)
 Check to see if the all of the values in the scalars array are the same. It will also take into account the activity that is passed in. More...
 

Detailed Description

Utility functions called by interpolation code.

Definition in file InterpUtil.cpp.

Function Documentation

◆ inAllScalarsEqual()

bool xms::inAllScalarsEqual ( const std::vector< float > &  a_scalars,
const DynBitset a_act 
)

Check to see if the all of the values in the scalars array are the same. It will also take into account the activity that is passed in.

Parameters
a_scalarsvector of scalar values
a_actActivity array associated with the scalars
Returns
true if all values are equal.

Definition at line 363 of file InterpUtil.cpp.

References xms::inAllScalarsEqual().

Referenced by xms::inAllScalarsEqual(), xms::InterpIdwImpl::SetNodalFunction(), xms::InterpLinearImpl::SetUseCloughTocher(), and xms::InterpLinearImpl::SetUseNatNeigh().

◆ inDistanceSquared()

void xms::inDistanceSquared ( const Pt3d a_pt,
const std::vector< int > &  a_ptIdxs,
const std::vector< Pt3d > &  a_ptLoc,
bool  a_2d,
std::vector< double > &  a_d2 
)

Computes the distance squared between the point "a_pt" and the other points. The other points are defined by looking up the location in "a_ptLoc" using the index stored in "a_ptIdxs". The "a_d2" vector is then filled with the distance squared. If "a_2d" is true then we only do the x,y distance.

Parameters
a_ptLocation of the interpolation point.
a_ptIdxsIndices of the points in the a_ptLoc vector. If a_ptIdxs.empty(), then use all a_ptLoc.
a_ptLocVector of point locations
a_2dCalculate 2D distance squared verses 3D distance squared
a_d2Vector of distances squared that is filled in by this function

Definition at line 266 of file InterpUtil.cpp.

References xms::inDistanceSquared(), xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

Referenced by xms::inDistanceSquared(), xms::InterpIdwImpl::InterpWeights(), and xms::NodalFuncImpl::NfForPt().

◆ inIdwWeights()

void xms::inIdwWeights ( const std::vector< double > &  a_distSquare,
double  a_power,
bool  a_modifiedShepardWeights,
std::vector< double > &  a_w 
)

Computes the idw weights that would be assigned to points associated with the distance squared that is passed in: "a_d2". The function can handle any power ("a_power") associated with the idw calculation and there is an option for the Modified Shepard Weights as well (see the reference in the code).

Parameters
a_distSquareVectors of distances squared.
a_powerThe exponent used in the inverse distance weighting function. Normally this would be 2 and thus the distances squared could be used. However if the power is not 2 then the distance must be calculated and the exponent applied.
a_modifiedShepardWeightsSpecifies a method for calculating the normalized weights from the distances squared. See the code below for the reference to the journal article.
a_wVector of weights filled in by this function. This will be the same size as a_distSquare and each value will correspond to the respective distance squared.

Definition at line 305 of file InterpUtil.cpp.

References xms::inIdwWeights().

Referenced by xms::inIdwWeights(), xms::InterpIdwImpl::InterpWeights(), and xms::NodalFuncImpl::NfForPt().

◆ inNodalFuncSetUpMatrixAndVector()

void xms::inNodalFuncSetUpMatrixAndVector ( double  xk,
double  yk,
double  fk,
const std::vector< InterpPtInfo > &  closest,
double **  M,
double *  VV 
)

Sets up matrices for nodal function calculations. Refactored out of GMS.

Parameters
xkx value of point
yky value of point
fkscalar value of point
closestinformation on closest points
Mmatrix filled by function
VVmatrix filled by fucntion

Definition at line 50 of file InterpUtil.cpp.

References xms::inNodalFuncSetUpMatrixAndVector().

Referenced by xms::inNodalFuncSetUpMatrixAndVector(), and xms::NodalFuncImpl::NodalFunc2d().

◆ inNodalFuncSetUpMatrixAndVector3d()

void xms::inNodalFuncSetUpMatrixAndVector3d ( double  xk,
double  yk,
double  zk,
double  fk,
const std::vector< InterpPtInfo > &  closest,
double **  M,
double *  vv 
)

Sets up matrices for nodal function calculations. Refactored out of GMS.

Parameters
xkx value of point
yky value of point
zkz value of point
fkscalar value of point
closestinformation on closest points
Mmatrix filled by function
vvmatrix filled by function

Definition at line 126 of file InterpUtil.cpp.

References xms::inNodalFuncSetUpMatrixAndVector3d().

Referenced by xms::inNodalFuncSetUpMatrixAndVector3d(), and xms::NodalFuncImpl::NodalFunc3d().