Skip to content

Add row and col facade for 2 dim container - #1876

Merged
JohanMabille merged 4 commits into
xtensor-stack:masterfrom
kolibri91:develop
Jan 6, 2020
Merged

JohanMabille merged 4 commits into
xtensor-stack:masterfrom
kolibri91:develop

Conversation

@kolibri91

Copy link
Copy Markdown
Contributor

This pull request is related to #1189.
Row and col shortcuts for two-dimensional containers make the code more readable.

The implementation is straight forward. The row and col function can only be called on a two-dimensional container. If the functions are called on a container with other dimension an error occurs.
If the container has compile-constant dimensions, a static_assert will fail the build.
If the container has runtime-specific dimensions, a std::invalid_argument exception is thrown.

Please check if your PR fulfills these requirements

  • The title and the 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
  • If you PR introduces backward incompatible changes, update the version number
    in both docs/source/changelog.rst and include/xtensor/xtensor_config.hpp according
    to the following rules:
    • if XTENSOR_VERSION_PATCH is already 0-dev, you have nothing to do
    • otherwise, set XTENSOR_VERSION_PATCH to 0-dev and increase XTENSOR_VERSION_MINOR by 1

@JohanMabille

Copy link
Copy Markdown
Member

Thanks for this PR! See my comments in the review.

Comment thread include/xtensor/xview.hpp
Comment thread include/xtensor/xview.hpp Outdated
Comment thread include/xtensor/xview.hpp
Comment thread include/xtensor/xview.hpp Outdated
Comment thread include/xtensor/xview.hpp
@JohanMabille

JohanMabille commented Jan 6, 2020 •

Copy link
Copy Markdown
Member

Awesome, thank you very much!

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.

2 participants