Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not create CubicInterpolant with type float #11

Open
Jean1995 opened this issue Mar 4, 2021 · 0 comments
Open

Can not create CubicInterpolant with type float #11

Jean1995 opened this issue Mar 4, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Jean1995
Copy link
Member

Jean1995 commented Mar 4, 2021

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.

@Jean1995 Jean1995 added the bug Something isn't working label Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant