Skip to content

Can not create CubicInterpolant with type float #11

@Jean1995

Description

@Jean1995

The following minimal example does not compile:

double func(double x) { return 1. / std::pow(x, 2); }

int main(){
    auto def = cubic_splines::CubicSplines<float>::Definition();
    def.f = func;
    def.axis = std::make_unique<cubic_splines::ExpAxis<float>>(1e2, 1e14, (size_t)100);
    def.f_trafo = std::make_unique<cubic_splines::ExpAxis<float>>(1., 0.);
    auto inter = cubic_splines::Interpolant<cubic_splines::CubicSplines<float>>(
            std::move(def), "", "");
    std::cout << func(1e5) << ", " << inter.evaluate(1e5) << std::endl;
}

I get the error

[...]/CubicInterpolation/Interpolant.hpp:17:30: error: no member named 'size' in 'cubic_splines::Axis<float>'

I believe that this has to do with the typedef typedef Axis<double> Axis in line 9 of Interpolant.hpp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions