1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #ifndef BOOST_UBLAS_TENSOR_INDEX_HPP
- #define BOOST_UBLAS_TENSOR_INDEX_HPP
- #include <cstddef>
- #include <array>
- #include <vector>
- namespace boost {
- namespace numeric {
- namespace ublas {
- namespace index {
- template<std::size_t I>
- struct index_type
- {
- static constexpr std::size_t value = I;
- constexpr bool operator == (std::size_t other) const { return value == other; }
- constexpr bool operator != (std::size_t other) const { return value != other; }
- template <std::size_t K>
- constexpr bool operator == (index_type<K> ) const { return I==K; }
- template <std::size_t K>
- constexpr bool operator != (index_type<K> ) const { return I!=K; }
- constexpr bool operator == (index_type ) const { return true; }
- constexpr bool operator != (index_type ) const { return false; }
- constexpr std::size_t operator()() const { return I; }
- };
- static constexpr index_type< 0> _;
- static constexpr index_type< 1> _a;
- static constexpr index_type< 2> _b;
- static constexpr index_type< 3> _c;
- static constexpr index_type< 4> _d;
- static constexpr index_type< 5> _e;
- static constexpr index_type< 6> _f;
- static constexpr index_type< 7> _g;
- static constexpr index_type< 8> _h;
- static constexpr index_type< 9> _i;
- static constexpr index_type<10> _j;
- static constexpr index_type<11> _k;
- static constexpr index_type<12> _l;
- static constexpr index_type<13> _m;
- static constexpr index_type<14> _n;
- static constexpr index_type<15> _o;
- static constexpr index_type<16> _p;
- static constexpr index_type<17> _q;
- static constexpr index_type<18> _r;
- static constexpr index_type<19> _s;
- static constexpr index_type<20> _t;
- static constexpr index_type<21> _u;
- static constexpr index_type<22> _v;
- static constexpr index_type<23> _w;
- static constexpr index_type<24> _x;
- static constexpr index_type<25> _y;
- static constexpr index_type<26> _z;
- }
- }
- }
- }
- #endif
|