Ginkgo
Generated from pipelines/1330831941 branch based on master. Ginkgo version 1.8.0
A numerical linear algebra library targeting many-core architectures
|
A row_major accessor is a bridge between a range and the row-major memory layout. More...
#include <ginkgo/core/base/range_accessors.hpp>
Public Types | |
using | value_type = ValueType |
Type of values returned by the accessor. | |
using | data_type = value_type * |
Type of underlying data storage. | |
Public Member Functions | |
constexpr value_type & | operator() (size_type row, size_type col) const |
Returns the data element at position (row, col) More... | |
constexpr range< row_major > | operator() (const span &rows, const span &cols) const |
Returns the sub-range spanning the range (rows, cols) More... | |
constexpr size_type | length (size_type dimension) const |
Returns the length in dimension dimension . More... | |
template<typename OtherAccessor > | |
void | copy_from (const OtherAccessor &other) const |
Copies data from another accessor. More... | |
Public Attributes | |
const data_type | data |
Reference to the underlying data. | |
const std::array< const size_type, dimensionality > | lengths |
An array of dimension sizes. | |
const size_type | stride |
Distance between consecutive rows. | |
Static Public Attributes | |
static constexpr size_type | dimensionality = 2 |
Number of dimensions of the accessor. | |
Friends | |
class | range< row_major > |
A row_major accessor is a bridge between a range and the row-major memory layout.
You should never try to explicitly create an instance of this accessor. Instead, supply it as a template parameter to a range, and pass the constructor parameters for this class to the range (it will forward it to this class).
ValueType | type of values this accessor returns |
Dimensionality | number of dimensions of this accessor (has to be 2) |
|
inline |
Copies data from another accessor.
OtherAccessor | type of the other accessor |
other | other accessor |
References gko::accessor::row_major< ValueType, Dimensionality >::lengths.
|
inlineconstexpr |
Returns the length in dimension dimension
.
dimension | a dimension index |
dimension
References gko::accessor::row_major< ValueType, Dimensionality >::lengths.
|
inlineconstexpr |
Returns the sub-range spanning the range (rows, cols)
rows | row span |
cols | column span |
References gko::span::begin, gko::accessor::row_major< ValueType, Dimensionality >::data, gko::span::end, gko::span::is_valid(), gko::accessor::row_major< ValueType, Dimensionality >::lengths, and gko::accessor::row_major< ValueType, Dimensionality >::stride.
|
inlineconstexpr |
Returns the data element at position (row, col)
row | row index |
col | column index |
References gko::accessor::row_major< ValueType, Dimensionality >::data, gko::accessor::row_major< ValueType, Dimensionality >::lengths, and gko::accessor::row_major< ValueType, Dimensionality >::stride.