Strides
basic_strides<size_type, format_type>
Description
The template class basic_strides
contains weights for a given storage
format in order to map multi-indices to scalar memory indices for
tensor instances.
Example
#include <boost/numeric/ublas/tensor/strides.hpp>
int main () {
using namespace boost::numeric::ublas;
auto wf = strides<first_order>(shape{4,3,2});
for (auto i = 0u; i < wf.size(); ++i)
std::cout << wf.at(i) << std::endl;
// 1,4,12
auto wl = strides<first_order>(shape{4,3,2});
for (auto i = 0u; i < wl.size(); ++i)
std::cout << wl.at(i) << std::endl;
// 6,2,1
}
Definition
Defined in the header tensor/strides.hpp.
Public base classes
None.
Specialization
template<class format_t>using strides = basic_strides<std::size_t,format_t>
Template parameters
Parameter |
Description |
|
Unsigned integer type. |
Member types
Member type | Description |
---|---|
|
Type |
|
Unsigned integer such as |
|
Reference type which is |
|
Constant reference type which is
|
|
Pointer type which is |
|
Constant pointer type which is |
|
Layout type which can be either
|
Member Functions
Member Function | Description |
---|---|
|
Constructs an empty instance of |
|
Constructs an
instance based on the tensor extents specified by |
|
Constructs an
instance copying the content of |
|
Constructs an instance
moving the content of |
|
Constructs an instance
from |
|
Constructs an instance from
|
|
Assigns the elements
of |
|
Returns a |
|
Returns a
|
|
Returns a |
|
Returns true if the container has no elements. |
|
Returns the number of elements. |
|
Erases all elements. |
|
Returns true if all elements are equal. |
|
Returns true if some elements are not equal. |
|
Returns an |
|
Returns a |
|
Returns the private member sequence container holding all elements. |
Non-Member Functions
Function | Description |
---|---|
|
Returns relative memory location depending on the multi-index vector
|
|
Returns relative memory location depending on the indices |
Copyright (©) 2018 Cem Bassoy
Copyright (©) 2021 Shikhar Vashistha
Use, modification and distribution are subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt ).