xmsinterp
1.0
|
Utility functions called by interpolation code. More...
#include <xmscore/points/pt.h>
#include <xmscore/points/ptsfwd.h>
#include <xmscore/misc/DynBitset.h>
Go to the source code of this file.
Classes | |
struct | xms::InterpPtInfo |
Convenience struct used in interpolation utility functions. More... | |
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... | |
Utility functions called by interpolation code.
Definition in file InterpUtil.h.
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.
a_scalars | vector of scalar values |
a_act | Activity array associated with the scalars |
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().
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.
a_pt | Location of the interpolation point. |
a_ptIdxs | Indices of the points in the a_ptLoc vector. If a_ptIdxs.empty(), then use all a_ptLoc. |
a_ptLoc | Vector of point locations |
a_2d | Calculate 2D distance squared verses 3D distance squared |
a_d2 | Vector 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().
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).
a_distSquare | Vectors of distances squared. |
a_power | The 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_modifiedShepardWeights | Specifies a method for calculating the normalized weights from the distances squared. See the code below for the reference to the journal article. |
a_w | Vector 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().
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.
xk | x value of point |
yk | y value of point |
fk | scalar value of point |
closest | information on closest points |
M | matrix filled by function |
VV | matrix filled by fucntion |
Definition at line 50 of file InterpUtil.cpp.
References xms::inNodalFuncSetUpMatrixAndVector().
Referenced by xms::inNodalFuncSetUpMatrixAndVector(), and xms::NodalFuncImpl::NodalFunc2d().
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.
xk | x value of point |
yk | y value of point |
zk | z value of point |
fk | scalar value of point |
closest | information on closest points |
M | matrix filled by function |
vv | matrix filled by function |
Definition at line 126 of file InterpUtil.cpp.
References xms::inNodalFuncSetUpMatrixAndVector3d().
Referenced by xms::inNodalFuncSetUpMatrixAndVector3d(), and xms::NodalFuncImpl::NodalFunc3d().