25 template <
typename Real>
32 Real
const* F, Real smooth,
bool transformToUnitSquare);
72 template <
typename Real>
74 Real
const* Y, Real
const* F, Real smooth,
bool transformToUnitSquare)
83 if (numPoints < 3 || !X || !Y || !F || smooth < (Real)0)
91 if (transformToUnitSquare)
96 auto extreme = std::minmax_element(X, X +
mNumPoints);
97 mXMin = *extreme.first;
98 mXMax = *extreme.second;
105 extreme = std::minmax_element(Y, Y + mNumPoints);
106 mYMin = *extreme.first;
107 mYMax = *extreme.second;
143 Real
t = sqrt(dx*dx + dy*dy);
144 AMat(row, col) =
Kernel(t);
153 BMat(row, 0) = (Real)1;
154 BMat(row, 1) =
mX[
row];
155 BMat(row, 2) =
mY[
row];
181 for (row = 0; row < 3; ++
row)
186 prod[
row] += PMat(row, i) * F[i];
191 for (row = 0; row < 3; ++
row)
194 for (i = 0; i < 3; ++i)
196 mB[
row] += invQMat(row, i) * prod[i];
201 std::vector<Real> tmp(mNumPoints);
205 for (i = 0; i < 3; ++i)
207 tmp[
row] -= BMat(row, i) *
mB[i];
217 mA[
row] += invAMat(row, i) * tmp[i];
224 template <
typename Real>
inline 230 template <
typename Real>
244 Real
t = sqrt(dx*dx + dy*dy);
250 return std::numeric_limits<Real>::max();
253 template <
typename Real>
256 Real functional = (Real)0;
269 Real
t = sqrt(dx * dx + dy * dy);
283 template <
typename Real>
Real operator()(Real x, Real y) const
bool IsInitialized() const
static Real Kernel(Real t)
GMatrix< Real > MultiplyATB(GMatrix< Real > const &A, GMatrix< Real > const &B)
GLenum GLenum GLsizei void * row
#define LogError(message)
Real ComputeFunctional() const
IntpThinPlateSpline2(int numPoints, Real const *X, Real const *Y, Real const *F, Real smooth, bool transformToUnitSquare)
Quaternion< Real > Inverse(Quaternion< Real > const &d)