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

Multiselection compilation issue #231

Open
davidbrochart opened this issue Jun 6, 2019 · 0 comments
Open

Multiselection compilation issue #231

davidbrochart opened this issue Jun 6, 2019 · 0 comments

Comments

@davidbrochart
Copy link
Member

I'm trying to do a multiselection, like so:

#include "xframe/xvariable.hpp"
#include "xframe/xvariable_view.hpp"

int main(int argc, char* argv[])
{
    auto dim = xf::dimension({"lat", "lon"});
    auto coord = xf::coordinate({{"lat", xf::axis({"a", "b", "c"})},
                                 {"lon", xf::axis({"d", "e", "f"})}});
    xt::xarray<double> data
          {{1., 2., 3.},
           {4., 5., 6.},
           {7., 8., 9.}};
    auto var = variable(data, coord, dim);

    std::cout << var << std::endl;

    std::cout << xf::select(var, {{"lat", xf::range("a", "b")}, {"lon", xf::range("d", "f")}}) << std::endl;

    return 0;
}

But I get the following error:

In file included from /home/david/tmp/xframe/test.cc:2:0:
/home/david/soft/miniconda3/include/xframe/xvariable_view.hpp: In instantiation of 'struct xt::xcontainer_inner_types<xf::xvariable_view<xf::xvariable_container<xf::xcoordinate<xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> >, xtl::mpl::vector<int, long unsigned int, char, xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> > >, long unsigned int, xf::hash_map_tag>&, xt::xarray_container<xt::uvector<double, std::allocator<double> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&>&> >':
/home/david/soft/miniconda3/include/xtensor/xsemantic.hpp:38:82:   required from 'class xt::xsemantic_base<xf::xvariable_view<xf::xvariable_container<xf::xcoordinate<xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> >, xtl::mpl::vector<int, long unsigned int, char, xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> > >, long unsigned int, xf::hash_map_tag>&, xt::xarray_container<xt::uvector<double, std::allocator<double> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&>&> >'
/home/david/soft/miniconda3/include/xtensor/xsemantic.hpp:196:11:   required from 'class xt::xview_semantic<xf::xvariable_view<xf::xvariable_container<xf::xcoordinate<xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> >, xtl::mpl::vector<int, long unsigned int, char, xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> > >, long unsigned int, xf::hash_map_tag>&, xt::xarray_container<xt::uvector<double, std::allocator<double> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&>&> >'
/home/david/soft/miniconda3/include/xframe/xvariable_view.hpp:63:11:   required from 'class xf::xvariable_view<xf::xvariable_container<xf::xcoordinate<xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> >, xtl::mpl::vector<int, long unsigned int, char, xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> > >, long unsigned int, xf::hash_map_tag>&, xt::xarray_container<xt::uvector<double, std::allocator<double> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&>&>'
/home/david/soft/miniconda3/include/xframe/xvariable_view.hpp:1098:60:   required from 'auto xf::select(E&&, std::map<typename std::decay<_Tp>::type::key_type, xf::xaxis_slice<L> >&&) [with E = xf::xvariable_container<xf::xcoordinate<xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> >, xtl::mpl::vector<int, long unsigned int, char, xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> > >, long unsigned int, xf::hash_map_tag>&, xt::xarray_container<xt::uvector<double, std::allocator<double> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&>&; L = xtl::mpl::vector<int, long unsigned int, char, xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> > >; typename std::decay<_Tp>::type::key_type = xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> >]'
/home/david/tmp/xframe/test.cc:17:94:   required from here
/home/david/soft/miniconda3/include/xframe/xvariable_view.hpp:54:113: error: 'xf::xvariable_base<xf::xvariable_container<xf::xcoordinate<xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> >, xtl::mpl::vector<int, long unsigned int, char, xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> > >, long unsigned int, xf::hash_map_tag>&, xt::xarray_container<xt::uvector<double, std::allocator<double> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&> >::value_type {aka double}' is not a class, struct, or union type
         using temporary_data_type = xoptional_assembly<xarray<typename optional_type::value_type>, xarray<bool>>;
                                                                                                                 ^
/home/david/soft/miniconda3/include/xframe/xvariable_view.hpp:55:103: error: 'xf::xvariable_base<xf::xvariable_container<xf::xcoordinate<xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> >, xtl::mpl::vector<int, long unsigned int, char, xtl::xbasic_fixed_string<char, 55, 5, xtl::string_policy::silent_error, std::char_traits<char> > >, long unsigned int, xf::hash_map_tag>&, xt::xarray_container<xt::uvector<double, std::allocator<double> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&> >::value_type {aka double}' is not a class, struct, or union type
         using temporary_type = xf::xvariable_container<temporary_coordinate_type, temporary_data_type>;
                                                                                                       ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant