Tensor
A C++ expression template library for computations on N dimensional tensors
Static Public Member Functions | List of all members
ftl::StaticMapper Struct Reference

Interface which provides static mapping (uses TMP to determine some of the mapping variables at compile time for improved performance) from indices to a single offset index and from an index offset to a list of indices. More...

#include <mapper.hpp>

Static Public Member Functions

template<typename DimSizes , typename IF , typename... IR>
static constexpr size_t indices_to_index (IF &&index_first, IR &&...indices_rest)
 Maps any number of indices which represent the location of an index in a multi-dimensional space, to a singe index offset in the contiguous memory which is representing that multi-dimensional space. More...
 

Detailed Description

Interface which provides static mapping (uses TMP to determine some of the mapping variables at compile time for improved performance) from indices to a single offset index and from an index offset to a list of indices.

Member Function Documentation

template<typename DimSizes , typename IF , typename... IR>
static constexpr size_t ftl::StaticMapper::indices_to_index ( IF &&  index_first,
IR &&...  indices_rest 
)
inlinestatic

Maps any number of indices which represent the location of an index in a multi-dimensional space, to a singe index offset in the contiguous memory which is representing that multi-dimensional space.

Parameters
[in]index_firstThe index of the element in the first dimension
[in]indices_restThe indices of the element in the other dimensions
Template Parameters
DimSizesThe list of dimension sizes for the multi-dimensional space
IFThe type of index_first
IRThe types of indices_rest

The documentation for this struct was generated from the following file: