Program Listing for File CubicSplineModel.hpp

Return to documentation for file (src/navtk/utils/CubicSplineModel.hpp)

#pragma once

#include <memory>
#include <typeinfo>

#include <navtk/tensors.hpp>
#include <navtk/utils/InterpolationModel.hpp>
#include <navtk/utils/Ordered.hpp>

namespace navtk {
namespace utils {

class CubicSplineModel : public InterpolationModel {

public:
    CubicSplineModel(const std::vector<double> &x, const std::vector<double> &y);

    double y_at(double x_interp) override;

private:
    /*
     * Solution of the system of equations that describes the cubic spline model; also happens to be
     * the set of first-order terms of the polynomial coefficients, size N.
     */
    Vector der;

    /*
     * Second order terms of the splines polynomial coefficients, size N.
     */
    Vector c;

    /*
     * 3rd order terms of the splines polynomial coefficients, size N.
     */
    Vector d;
};

}  // namespace utils
}  // namespace navtk