Skip to content

Conversation

@tdegeus
Copy link
Member

@tdegeus tdegeus commented Sep 7, 2020

Checklist

  • The title and commit message(s) are descriptive.
  • Small commits made to fix your PR have been squashed to avoid history pollution.
  • Tests have been added for new features or bug fixes.
  • API of new functions and classes are documented.

Description

Fixes #2135

@tdegeus tdegeus requested a review from JohanMabille September 8, 2020 09:25
Copy link
Member

@JohanMabille JohanMabille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the PR is really nice. I has a nitpicking remark regarding the definition.
We may want to add the rank member to other expressions, based on the rank of underlying expressions, but that can be done in a dedicated PR (might need additional metafunctions).

Also could you squash a bit (maybe one commit for the implementation and one for the documentation). I can do it with the UI but this prevents adding a merge commit, which is annoying when browsing the history to write the changelog.

@tdegeus
Copy link
Member Author

tdegeus commented Sep 8, 2020

Thanks @JohanMabille . It would be good to list where we would like to add rank as well, maybe in an issue? As to squashing, we could simply "Squash and merge" on GitHub to squash to a single commit. I don't see why there should be more than one commit.

@JohanMabille
Copy link
Member

JohanMabille commented Sep 8, 2020

The issue with squashing on Github is that it does not create a merge commit with a reference to the PR. So it's more complicated (and time-consuming) to track for writing the changelog before a release.

@tdegeus
Copy link
Member Author

tdegeus commented Sep 8, 2020

@JohanMabille There is a problem appearing in the CI with xt::xtensor_fixed<size_t, xt::xshape<2, 2>> that is not related to this PR I think, see below. Does it ring a bell?

In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1686                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1687                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1688                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1689/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp: In instantiation of ‘bool xt::xiterator<St, S, L>::equal(const xt::xiterator<St, S, L>&) const [with St = xt::xfunction_stepper<xt::detail::equal_to, const xt::xfixed_container<long unsigned int, xt::fixed_shape<2, 2>, (xt::layout_type)1, true, xt::xtensor_expression_tag>&, xt::xscalar<long unsigned int> >; S = xt::fixed_shape<2, 2>*; xt::layout_type L = (xt::layout_type)1]’:
1690/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1109:29:   required from ‘bool xt::operator==(const xt::xiterator<St, S, L>&, const xt::xiterator<St, S, L>&) [with St = xt::xfunction_stepper<xt::detail::equal_to, const xt::xfixed_container<long unsigned int, xt::fixed_shape<2, 2>, (xt::layout_type)1, true, xt::xtensor_expression_tag>&, xt::xscalar<long unsigned int> >; S = xt::fixed_shape<2, 2>*; xt::layout_type L = (xt::layout_type)1]’
1691/usr/include/c++/8/bits/stl_algo.h:509:21:   required from ‘bool std::all_of(_IIter, _IIter, _Predicate) [with _IIter = xt::xiterator<xt::xfunction_stepper<xt::detail::equal_to, const xt::xfixed_container<long unsigned int, xt::fixed_shape<2, 2>, (xt::layout_type)1, true, xt::xtensor_expression_tag>&, xt::xscalar<long unsigned int> >, xt::fixed_shape<2, 2>*, (xt::layout_type)1>; _Predicate = xt::all(E&&) [with E = xt::xfunction<xt::detail::equal_to, const xt::xfixed_container<long unsigned int, xt::fixed_shape<2, 2>, (xt::layout_type)1, true, xt::xtensor_expression_tag>&, xt::xscalar<long unsigned int> >]::<lambda(const value_type&)>]’
1692/home/travis/build/xtensor-stack/xtensor/include/xtensor/xoperation.hpp:938:27:   required from ‘bool xt::all(E&&) [with E = xt::xfunction<xt::detail::equal_to, const xt::xfixed_container<long unsigned int, xt::fixed_shape<2, 2>, (xt::layout_type)1, true, xt::xtensor_expression_tag>&, xt::xscalar<long unsigned int> >]’
1693/home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:49:9:   required from here
1694/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: error: no match for ‘operator==’ (operand types are ‘const xt::fixed_shape<2, 2>’ and ‘const xt::fixed_shape<2, 2>’)
1695         XTENSOR_ASSERT(this->shape() == rhs.shape());
1696/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1697     if (!(expr))                                                            \
1698           ^~~~
1699/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1700         XTENSOR_ASSERT(this->shape() == rhs.shape());
1701         ^~~~~~~~~~~~~~
1702In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor_simd.hpp:16,
1703                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:23,
1704                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1705                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1706                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1707/home/travis/build/xtensor-stack/xtensor/include/xtensor/xutils.hpp:771:17: note: candidate: ‘template<class T, class AT, xt::alloc_tracking::policy PT, class U, class AU, xt::alloc_tracking::policy PU> bool xt::operator==(const xt::tracking_allocator<T, AT, PT>&, const xt::tracking_allocator<U, AU, PU>&)’
1708     inline bool operator==(const tracking_allocator<T, AT, PT>&, const tracking_allocator<U, AU, PU>&)
1709                 ^~~~~~~~
1710/home/travis/build/xtensor-stack/xtensor/include/xtensor/xutils.hpp:771:17: note:   template argument deduction/substitution failed:
1711In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1712                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1713                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1714                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1715/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::tracking_allocator<T, AT, PT>’
1716         XTENSOR_ASSERT(this->shape() == rhs.shape());
1717/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1718     if (!(expr))                                                            \
1719           ^~~~
1720/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1721         XTENSOR_ASSERT(this->shape() == rhs.shape());
1722         ^~~~~~~~~~~~~~
1723In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1724                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1725                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1726/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:547:17: note: candidate: ‘template<class T, class A> bool xt::operator==(const xt::uvector<T, A>&, const xt::uvector<T, A>&)’
1727     inline bool operator==(const uvector<T, A>& lhs, const uvector<T, A>& rhs)
1728                 ^~~~~~~~
1729/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:547:17: note:   template argument deduction/substitution failed:
1730In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1731                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1732                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1733                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1734/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::uvector<T, A>’
1735         XTENSOR_ASSERT(this->shape() == rhs.shape());
1736/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1737     if (!(expr))                                                            \
1738           ^~~~
1739/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1740         XTENSOR_ASSERT(this->shape() == rhs.shape());
1741         ^~~~~~~~~~~~~~
1742In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1743                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1744                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1745/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1284:17: note: candidate: ‘template<class T, long unsigned int N, class A, bool Init> bool xt::operator==(const std::vector<T>&, const xt::svector<T, N, A, Init>&)’
1746     inline bool operator==(const std::vector<T>& lhs, const svector<T, N, A, Init>& rhs)
1747                 ^~~~~~~~
1748/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1284:17: note:   template argument deduction/substitution failed:
1749In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1750                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1751                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1752                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1753/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const std::vector<T>’
1754         XTENSOR_ASSERT(this->shape() == rhs.shape());
1755/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1756     if (!(expr))                                                            \
1757           ^~~~
1758/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1759         XTENSOR_ASSERT(this->shape() == rhs.shape());
1760         ^~~~~~~~~~~~~~
1761In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1762                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1763                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1764/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1290:17: note: candidate: ‘template<class T, long unsigned int N, class A, bool Init> bool xt::operator==(const xt::svector<T, N, A, Init>&, const std::vector<T>&)’
1765     inline bool operator==(const svector<T, N, A, Init>& lhs, const std::vector<T>& rhs)
1766                 ^~~~~~~~
1767/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1290:17: note:   template argument deduction/substitution failed:
1768In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1769                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1770                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1771                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1772/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::svector<T, N, A, Init>’
1773         XTENSOR_ASSERT(this->shape() == rhs.shape());
1774/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1775     if (!(expr))                                                            \
1776           ^~~~
1777/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1778         XTENSOR_ASSERT(this->shape() == rhs.shape());
1779         ^~~~~~~~~~~~~~
1780In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1781                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1782                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1783/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1296:17: note: candidate: ‘template<class T, long unsigned int N, class A, bool Init> bool xt::operator==(const xt::svector<T, N, A, Init>&, const xt::svector<T, N, A, Init>&)’
1784     inline bool operator==(const svector<T, N, A, Init>& lhs, const svector<T, N, A, Init>& rhs)
1785                 ^~~~~~~~
1786/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1296:17: note:   template argument deduction/substitution failed:
1787In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1788                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1789                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1790                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1791/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::svector<T, N, A, Init>’
1792         XTENSOR_ASSERT(this->shape() == rhs.shape());
1793/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1794     if (!(expr))                                                            \
1795           ^~~~
1796/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1797         XTENSOR_ASSERT(this->shape() == rhs.shape());
1798         ^~~~~~~~~~~~~~
1799In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1800                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1801                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1802/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1530:17: note: candidate: ‘template<class T, long unsigned int N> bool xt::operator==(const xt::const_array<T, N>&, const xt::const_array<T, N>&)’
1803     inline bool operator==(const const_array<T, N>& lhs, const const_array<T, N>& rhs)
1804                 ^~~~~~~~
1805/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1530:17: note:   template argument deduction/substitution failed:
1806In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1807                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1808                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1809                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1810/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::const_array<T, N>’
1811         XTENSOR_ASSERT(this->shape() == rhs.shape());
1812/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1813     if (!(expr))                                                            \
1814           ^~~~
1815/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1816         XTENSOR_ASSERT(this->shape() == rhs.shape());
1817         ^~~~~~~~~~~~~~
1818In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1819                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1820                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1821/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1851:17: note: candidate: ‘template<class T, long int TB, long int TE> bool xt::operator==(const xt::sequence_view<T, TB, TE>&, const xt::sequence_view<T, TB, TE>&)’
1822     inline bool operator==(const sequence_view<T, TB, TE>& lhs, const sequence_view<T, TB, TE>& rhs)
1823                 ^~~~~~~~
1824/home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:1851:17: note:   template argument deduction/substitution failed:
1825In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1826                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1827                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1828                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1829/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::sequence_view<T, TB, TE>’
1830         XTENSOR_ASSERT(this->shape() == rhs.shape());
1831/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1832     if (!(expr))                                                            \
1833           ^~~~
1834/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1835         XTENSOR_ASSERT(this->shape() == rhs.shape());
1836         ^~~~~~~~~~~~~~
1837In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1838                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1839/home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:934:17: note: candidate: ‘template<class D> bool xt::operator==(const xt::xbuffer_adaptor_base<D>&, const xt::xbuffer_adaptor_base<D>&)’
1840     inline bool operator==(const xbuffer_adaptor_base<D>& lhs,
1841                 ^~~~~~~~
1842/home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:934:17: note:   template argument deduction/substitution failed:
1843In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1844                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1845                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1846                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1847/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::xbuffer_adaptor_base<D>’
1848         XTENSOR_ASSERT(this->shape() == rhs.shape());
1849/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1850     if (!(expr))                                                            \
1851           ^~~~
1852/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1853         XTENSOR_ASSERT(this->shape() == rhs.shape());
1854         ^~~~~~~~~~~~~~
1855In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterable.hpp:13,
1856                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xcontainer.hpp:22,
1857                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:20,
1858                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1859/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1106:17: note: candidate: ‘template<class St, class S, xt::layout_type L> bool xt::operator==(const xt::xiterator<St, S, L>&, const xt::xiterator<St, S, L>&)’
1860     inline bool operator==(const xiterator<St, S, L>& lhs,
1861                 ^~~~~~~~
1862/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1106:17: note:   template argument deduction/substitution failed:
1863In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1864                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1865                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1866                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1867/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::xiterator<St, S, L>’
1868         XTENSOR_ASSERT(this->shape() == rhs.shape());
1869/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1870     if (!(expr))                                                            \
1871           ^~~~
1872/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1873         XTENSOR_ASSERT(this->shape() == rhs.shape());
1874         ^~~~~~~~~~~~~~
1875In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterable.hpp:13,
1876                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xcontainer.hpp:22,
1877                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:20,
1878                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1879/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1187:17: note: candidate: ‘template<class It, class BIt> bool xt::operator==(const xt::xbounded_iterator<It, BIt>&, const xt::xbounded_iterator<It, BIt>&)’
1880     inline bool operator==(const xbounded_iterator<It, BIt>& lhs,
1881                 ^~~~~~~~
1882/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1187:17: note:   template argument deduction/substitution failed:
1883In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1884                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1885                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1886                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1887/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::xbounded_iterator<It, BIt>’
1888         XTENSOR_ASSERT(this->shape() == rhs.shape());
1889/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1890     if (!(expr))                                                            \
1891           ^~~~
1892/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1893         XTENSOR_ASSERT(this->shape() == rhs.shape());
1894         ^~~~~~~~~~~~~~
1895In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbroadcast.hpp:26,
1896                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuilder.hpp:32,
1897                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xmanipulation.hpp:13,
1898                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xmath.hpp:28,
1899                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xcontainer.hpp:24,
1900                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:20,
1901                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1902/home/travis/build/xtensor-stack/xtensor/include/xtensor/xscalar.hpp:1079:17: note: candidate: ‘template<bool is_const, class CT> bool xt::operator==(const xt::xdummy_iterator<is_const, CT>&, const xt::xdummy_iterator<is_const, CT>&)’
1903     inline bool operator==(const xdummy_iterator<is_const, CT>& lhs,
1904                 ^~~~~~~~
1905/home/travis/build/xtensor-stack/xtensor/include/xtensor/xscalar.hpp:1079:17: note:   template argument deduction/substitution failed:
1906In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1907                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1908                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1909                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1910/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::xdummy_iterator<is_const, CT>’
1911         XTENSOR_ASSERT(this->shape() == rhs.shape());
1912/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1913     if (!(expr))                                                            \
1914           ^~~~
1915/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1916         XTENSOR_ASSERT(this->shape() == rhs.shape());
1917         ^~~~~~~~~~~~~~
1918In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuilder.hpp:33,
1919                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xmanipulation.hpp:13,
1920                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xmath.hpp:28,
1921                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xcontainer.hpp:24,
1922                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:20,
1923                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1924/home/travis/build/xtensor-stack/xtensor/include/xtensor/xfunction.hpp:930:17: note: candidate: ‘template<class F, class ... CT> bool xt::operator==(const xt::xfunction_iterator<F, CT ...>&, const xt::xfunction_iterator<F, CT ...>&)’
1925     inline bool operator==(const xfunction_iterator<F, CT...>& it1,
1926                 ^~~~~~~~
1927/home/travis/build/xtensor-stack/xtensor/include/xtensor/xfunction.hpp:930:17: note:   template argument deduction/substitution failed:
1928In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1929                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1930                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1931                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1932/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::xfunction_iterator<F, CT ...>’
1933         XTENSOR_ASSERT(this->shape() == rhs.shape());
1934/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1935     if (!(expr))                                                            \
1936           ^~~~
1937/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1938         XTENSOR_ASSERT(this->shape() == rhs.shape());
1939         ^~~~~~~~~~~~~~
1940In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuilder.hpp:35,
1941                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xmanipulation.hpp:13,
1942                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xmath.hpp:28,
1943                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xcontainer.hpp:24,
1944                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:20,
1945                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1946/home/travis/build/xtensor-stack/xtensor/include/xtensor/xoperation.hpp:611:5: note: candidate: ‘template<class E1, class E2> std::enable_if_t<xt::xoptional_comparable<E1, E2>::value, bool> xt::operator==(const xt::xexpression<D>&, const xt::xexpression<E2>&)’
1947     operator==(const xexpression<E1>& e1, const xexpression<E2>& e2)
1948     ^~~~~~~~
1949/home/travis/build/xtensor-stack/xtensor/include/xtensor/xoperation.hpp:611:5: note:   template argument deduction/substitution failed:
1950In file included from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xstorage.hpp:21,
1951                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xbuffer_adaptor.hpp:22,
1952                 from /home/travis/build/xtensor-stack/xtensor/include/xtensor/xtensor.hpp:19,
1953                 from /home/travis/build/xtensor-stack/xtensor/test/test_sfinae.cpp:14:
1954/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:38: note:   ‘const xt::fixed_shape<2, 2>’ is not derived from ‘const xt::xexpression<D>’
1955         XTENSOR_ASSERT(this->shape() == rhs.shape());
1956/home/travis/build/xtensor-stack/xtensor/include/xtensor/xexception.hpp:247:11: note: in definition of macro ‘XTENSOR_ASSERT_IMPL’
1957     if (!(expr))                                                            \
1958           ^~~~
1959/home/travis/build/xtensor-stack/xtensor/include/xtensor/xiterator.hpp:1094:9: note: in expansion of macro ‘XTENSOR_ASSERT’
1960         XTENSOR_ASSERT(this->shape() == rhs.shape());
1961         ^~~~~~~~~~~~~~
1962test/CMakeFiles/test_xtensor_lib.dir/build.make:978: recipe for target 'test/CMakeFiles/test_xtensor_lib.dir/test_sfinae.cpp.o' failed

@tdegeus
Copy link
Member Author

tdegeus commented Sep 8, 2020

Indeed, operator== does not appear in xshape_fixed. But if it would really be missing, why would all other tests pass??

@tdegeus
Copy link
Member Author

tdegeus commented Sep 8, 2020

Also there are some windows errors for xtensor_fixed but I've been told that this an expected limitation...? I think I should just comment the test based on xtensor_fixed, but in the long run it would be great to get the class to be up to specs.

@JohanMabille
Copy link
Member

That's really weird :s Looks more like a compiler issue (otherwise other builds would fail). I need to dig a bit, I don't have this part of the code in mind.

Regarding the xtensor_fixed on Windows, the issue is the compilers (MSVC 2015 and MSVC 2017) have bugs that prevent the class to fully work while it is valid C++. THerefore we disabled the tests on Windows.

@tdegeus
Copy link
Member Author

tdegeus commented Sep 8, 2020

It could indeed be a compiler bug. Shall I just comment the test here and squash so that we can merge. And then open a PR uncommenting the tests, such that we can quietly debug?

@JohanMabille
Copy link
Member

Yes it would be nice to have this one merged quickly.

@tdegeus
Copy link
Member Author

tdegeus commented Sep 8, 2020

Good to go! Will open a PR once merged.

A separate question: I guess I would have to add the member is xtensor-python too?

@JohanMabille
Copy link
Member

If you want to be able to use the has_rank metafunciton with pyarray and pytensor, yes.

@tdegeus
Copy link
Member Author

tdegeus commented Sep 8, 2020

😇

@tdegeus tdegeus merged commit 5408438 into xtensor-stack:master Sep 8, 2020
@tdegeus tdegeus deleted the rank branch September 8, 2020 15:38
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

Successfully merging this pull request may close these issues.

Test on static rank

2 participants