1 #ifndef SimTK_SIMMATH_GCVSPL_UTIL_H_
2 #define SimTK_SIMMATH_GCVSPL_UTIL_H_
69 for (
int j = 0; j < K; ++j)
70 for (
int i = 0; i < ny; ++i)
71 yvec[index++] = y[i][j];
79 SimTK_gcvspl_(&x[0], &yvec[0], &ny, &wx[0], &wy[0], &m, &n, &k, &md, &val, &cvec[0], &n, &wk[0], &ier);
87 for (
int j = 0; j < K; ++j)
88 for (
int i = 0; i < n; ++i)
89 c[i][j] = cvec[index++];
94 assert(derivOrder >= 0);
95 assert(t >= x[0] && t <= x[x.
size()-1]);
96 assert(x.
size() == coeff.size());
97 assert(degree > 0 && degree%2==1);
104 int m = (degree+1)/2;
106 int interval = (int) ceil(n*(t-x[0])/(x[n-1]-x[0]));
108 const int MaxCheapM = 32;
109 Real qbuf[2*MaxCheapM];
115 int offset = (int) (&coeff[1][0]-&coeff[0][0]);
119 for (
int i = 0; i < K; ++i)
120 result[i] =
SimTK_splder_(&derivOrder, &m, &n, &t, &x[0], &coeff[0][i], &interval, q, offset);
130 #endif // SimTK_SIMMATH_GCVSPL_UTIL_H_
#define SimTK_APIARGCHECK_ALWAYS(cond, className, methodName, msg)
Definition: ExceptionMacros.h:224
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
int size() const
Definition: VectorBase.h:396
int SimTK_gcvspl_(const SimTK::Real *, const SimTK::Real *, int *, const SimTK::Real *, const SimTK::Real *, int *, int *, int *, int *, SimTK::Real *, SimTK::Real *, int *, SimTK::Real *, int *)
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:577
This class provides entry points for using the GCVSPL algorithm in terms of SimTK data types...
Definition: GCVSPLUtil.h:44
static Real splder(int derivOrder, int degree, Real t, const Vector &x, const Vector &coeff)
Includes internal headers providing declarations for the basic SimTK Core classes, including Simmatrix.
VectorBase & resize(int m)
Definition: VectorBase.h:451
This is the header file that every Simmath compilation unit should include first. ...
bool hasContiguousData() const
Definition: MatrixBase.h:838
SimTK::Real SimTK_splder_(int *, int *, int *, SimTK::Real *, const SimTK::Real *, const SimTK::Real *, int *, SimTK::Real *, int)
This is a fixed-length column vector designed for no-overhead inline computation. ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:589
static void gcvspl(const Vector &x, const Vector &y, const Vector &wx, Real wy, int m, int md, Real val, Vector &c, Vector &wk, int &ier)
#define SimTK_SIMMATH_EXPORT
Definition: SimTKmath/include/simmath/internal/common.h:64