49 RiXj.resize(cent.cols(), xs.cols());
50 for (
int iC = 0; iC < cent.cols(); iC++)
52 RiXj(iC, EigenAll) = (xs.colwise() - cent(EigenAll, iC)).colwise().norm();
54 return RiXj.array().maxCoeff();
70 NiXj = 1 + RiXj.array();
73 NiXj = (1 + RiXj.array()).inverse();
76 NiXj = (0.2 + RiXj.array()).inverse() - 1 / 1.2;
77 NiXj.array() *= (RiXj.array() < 1.0).
template cast<real>();
81 NiXj = (1 - RiXj.array()).square().square() * (RiXj.array() * 4 + 1);
82 NiXj.array() *= (RiXj.array() < 1.0).
template cast<real>();
86 NiXj = (1 - RiXj.array()).square();
87 NiXj.array() *= (RiXj.array() < 1.0).
template cast<real>();
91 NiXj = (-(RiXj.array().square())).exp();
99 template <
class Tcent,
class Tx>
104 RiXj.resize(cent.cols(), xs.cols());
105 for (
int iC = 0; iC < cent.cols(); iC++)
107 RiXj(iC, EigenAll) = (xs.colwise() - cent(EigenAll, iC)).colwise().norm() * (1. / R);
118 PT.resize(4, xs.cols());
119 PT(0, EigenAll).setConstant(1);
120 PT({1, 2, 3}, EigenAll) = xs;
123 A.setZero(xs.cols() + 4, xs.cols() + 4);
124 A.topLeftCorner(xs.cols(), xs.cols()) = M;
125 A.bottomLeftCorner(4, xs.cols()) = PT;
126 A.topRightCorner(xs.cols(), 4) = PT.transpose();
128 RHS.setZero(xs.cols() + 4, fs.cols());
130 RHS.topRows(xs.cols()) = fs;
131 auto LDLT = A.ldlt();
142 ret.setZero(xs.cols() + 4, fs.cols());
143 auto LDLTm = M.ldlt();
144 ret.topRows(xs.cols()) = LDLTm.solve(fs);
Extended enum-to-JSON serialization macro that also exposes allowed string values for JSON Schema gen...
#define DNDS_DEFINE_ENUM_JSON(EnumType_,...)
Define JSON serialization for an enum AND expose its allowed string values.
Core type aliases, constants, and metaprogramming utilities for the DNDS framework.
#define DNDS_assert(expr)
Debug-only assertion (compiled out when DNDS_NDEBUG is defined). Prints the expression + file/line + ...
JSON-to-Eigen conversion utilities and nlohmann_json helper macros.
MatrixXR RBFCPC2(Tcent cent, Tx xs, real R, RBFKernelType kernel=Gaussian)
MatrixXR FRBFBasis(TIn RiXj, RBFKernelType kernel)
MatrixXR RBFInterpolateSolveCoefs(const tSmallCoords &xs, const TF fs, real R, RBFKernelType kernel=Gaussian)
MatrixXR RBFInterpolateSolveCoefsNoPoly(const tSmallCoords &xs, const TF fs, real R, RBFKernelType kernel=Gaussian)
real GetMaxRij(const tSmallCoords ¢, const tSmallCoords &xs)
@ InversedDistanceA1Compact
Eigen::Matrix< real, 3, Eigen::Dynamic > tSmallCoords
Eigen::Matrix< real, Eigen::Dynamic, Eigen::Dynamic > MatrixXR
Column-major dynamic Eigen matrix of reals (default layout).
double real
Canonical floating-point scalar used throughout DNDSR (double precision).