{
"title": "ppval",
"category": "math/interpolation",
"keywords": [
"ppval",
"piecewise polynomial",
"spline",
"pchip"
],
"summary": "Evaluate a piecewise-polynomial structure.",
"gpu_support": {
"elementwise": false,
"reduction": false,
"precisions": [
"f32",
"f64"
],
"broadcasting": "matlab",
"notes": "GPU query points are gathered to the CPU reference implementation."
},
"fusion": {
"elementwise": false,
"reduction": false,
"max_inputs": 2,
"constants": "uniform"
},
"description": "`ppval(pp, xq)` evaluates a piecewise-polynomial structure produced by `spline` or `pchip` at query points `xq`.",
"behaviors": [
"Accepts pp structures with `form`, `breaks`, `coefs`, `pieces`, `order`, and `dim` fields.",
"Uses Horner evaluation within each interval.",
"Extrapolates outside the break range, matching MATLAB pp evaluation behavior."
],
"examples": [
{
"description": "Evaluate a spline pp structure",
"input": "pp = spline([1 2 3], [1 4 9]);\nyq = ppval(pp, [1.5 2.5])",
"output": "yq = [2.25 6.25]"
}
],
"syntax": {
"example": {
"description": "Syntax",
"input": "yq = ppval(pp, xq)"
},
"points": [
"`pp` is a piecewise-polynomial structure, typically returned by `spline` or `pchip`.",
"`xq` contains query points. Scalar queries return scalars, and array queries preserve their shape.",
"RunMat evaluates each interval with Horner's method using the pp coefficient table.",
"Queries outside the break range are extrapolated from the first or last polynomial piece."
]
},
"links": [
{
"label": "spline",
"url": "./spline"
},
{
"label": "pchip",
"url": "./pchip"
}
],
"source": {
"label": "Open an issue",
"url": "https://github.com/runmat-org/runmat/issues/new/choose"
}
}