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

isclose with std::complex<float> compiler error #2730

Closed
nathan-mxr opened this issue Sep 28, 2023 · 10 comments
Closed

isclose with std::complex<float> compiler error #2730

nathan-mxr opened this issue Sep 28, 2023 · 10 comments

Comments

@nathan-mxr
Copy link

Taking test from test_xcomplex.hpp and switching double for float causes compiler error:

        xt::xarray<std::complex<float>> arg = {
        {0.40101756f + 0.71233018if, 0.62731701f + 0.42786349if, 0.32415089f + 0.2977805if},
        {0.24475928f + 0.49208478if, 0.69475518f + 0.74029639if, 0.59390240f + 0.35772892if},
        {0.63179202f + 0.41720995if, 0.44025718f + 0.65472131if, 0.08372648f + 0.37380143if}};

        xt::xarray<std::complex<float>> compare = {
        {0.401f + 0.712if, 0.627f + 0.427if, 0.324f + 0.297if},
        {0.244f + 0.492if, 0.694f + 0.740if, 0.593f + 0.357if},
        {0.631f + 0.417if, 0.440f + 0.654if, 0.083f + 0.373if}};

        auto veryclose = isclose(arg, compare, 1e-5);
        auto looselyclose = isclose(arg, compare, 1e-1);

        EXPECT_TRUE(xt::all(xt::equal(false, veryclose)));
        EXPECT_TRUE(xt::all(xt::equal(true, looselyclose)));

Severity Code Description File Line Suppression State
Error C3536 'd': cannot be used before it is initialized ...\xtensor\xmath.hpp 1746
Error C2672 'max': no matching overloaded function found ...\xtensor\xmath.hpp 1760
Error C2676 binary '+': 'std::complex' does not define this operator or a conversion to a type acceptable to the predefined operator ...\xtl\xtype_traits.hpp 94

@tdegeus
Copy link
Member

tdegeus commented Oct 10, 2023

Thanks for reporting! There might be an internal type conversion? It would be great if you would be willing to investigate.

@tdegeus
Copy link
Member

tdegeus commented Nov 9, 2023

Could you open a PR and add this to the test? Then we can all see the build logs, and debug from there

@nathan-mxr
Copy link
Author

@tdegeus I'm happy to so but won't have time today, and will be unavailable from tomorrow until early December. Should be able to open one then if still required.

@tdegeus
Copy link
Member

tdegeus commented Nov 9, 2023

Thanks. If there was no activity by the time you find the time then thanks for doing it. If someone gets to it first, then this will be documented here

@nathan-mxr
Copy link
Author

@tdegeus Opened pull request to demonstrate compiler error: #2751

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity.
It will be automatically closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 30, 2023
@spectre-ns
Copy link
Contributor

@nathan-mxr @tdegeus did this get fixed in xtl? xtensor-stack/xtl#274

@tdegeus
Copy link
Member

tdegeus commented Jan 12, 2024

I guess. A test could be added against a new xtl release to be sure.

@github-actions github-actions bot removed the Stale label Jan 13, 2024
Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity.
It will be automatically closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 13, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants