#include <vector>
#include <iostream>
#include <Eigen/Core>
#include <unsupported/Eigen/Splines>
Go to the source code of this file.
|
double | uvalue (double x, double low, double high) |
|
VectorXd | uvalues (VectorXd xvals) |
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 27 of file _test_eigen_spline.cxx.
29 typedef Spline<double,1> Spline2d;
31 const VectorXd xvals = (VectorXd(5) << 1,2,3,4,6).finished();
32 const VectorXd yvals = xvals.array().square();
35 const double step = 0.1;
38 const double uv =
uvalue(
x, xvals.minCoeff(), xvals.maxCoeff());
39 std::cout <<
"(" <<
x <<
"," <<
spline(uv).transpose() <<
"," << spline.derivatives<1>(uv) <<
")\n";
VectorXd uvalues(VectorXd xvals)
def Interpolate(x1, y1, x2, y2, yvalue)
double uvalue(double x, double low, double high)
QTextStream & endl(QTextStream &s)
double uvalue |
( |
double |
x, |
|
|
double |
low, |
|
|
double |
high |
|
) |
| |
VectorXd uvalues |
( |
VectorXd |
xvals | ) |
|
Definition at line 16 of file _test_eigen_spline.cxx.
18 const double low = xvals.minCoeff();
19 const double high = xvals.maxCoeff();
20 for (
int i=0; i<xvals.size(); ++i)
22 xvals(i) =
uvalue(xvals(i), low, high);
double uvalue(double x, double low, double high)